convert from multiple format/size to fixed size/format jpeg
Posted: 2013-04-26T06:49:45-07:00
Hi everybody,
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:
Some of my files are smaller than 640x480 some bigger, I've got some png and a few jpeg coming from different cameras. and this creates files which seem similar (seen from a regular viewer) but avconv refuses them because they don't seem to have the same size/resolution. I this helps here is the error returned by avconv:
I have searched more or less everywhere and I don't really know what I am missing so if you could help me it would be perfect.
Thx
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