I have been fighting quite a lot right now to try to make image magick convert all sorts of images (jpeg, png, gif will be enough) into a jpeg. However this jpeg needs to really standard (sampling, format, resolution...) this because I want to feed the images after to avconv to make a video and it's quite strict regarding to files. Currently this is what I do:
Code: Select all
convert "$J" -background '#000000' -resample '72x72' -resize "640x480" -gravity center -extent "640x480" -sampling-factor '4:2:2' -type TrueColor -quality 75% jpeg:"$J.jpg"
Code: Select all
Input stream #0:0 frame changed from size:640x480 fmt:yuvj422p to size:160x120 fmt:yuvj422p
Input stream #0:0 frame changed from size:160x120 fmt:yuvj422p to size:320x240 fmt:yuvj422p
Input stream #0:0 frame changed from size:320x240 fmt:yuvj422p to size:88x128 fmt:yuvj420p
[mjpeg @ 0x101838800] only 8 bits/component accepted
Error while decoding stream #0:0
Input stream #0:0 frame changed from size:88x128 fmt:yuvj420p to size:120x160 fmt:yuvj420p
Thx