On 24.07.2011 21:07, André Weidemann wrote:
Here are two simple lines to convert a jpg image to mpeg2:
convert $Pict -background '#000000' -resize 1920x1080 -gravity center -extent 1920x1080 /tmp/test.jpg ffmpeg -i /tmp/temp.jpg -an -vcodec mpeg2video -b 2500 -s 1920x1080 -qscale 2 -f mpeg2video $Mpeg
Note: Depending on your distro, ffmpeg may not support mpeg2 video encoding.
For mpeg4 the ffmpeg line looks like this: ffmpeg -i /tmp/temp.jpg -an -vcodec mpeg4 -b 2500 -s 1920x1080 -qscale 2 -threads 4 -f mp4 $Mpeg
For libx264 it looks like this: ffmpeg -i /tmp/temp.jpg -an -vcodec libx264 -vpre lossless_ultrafast -s 1920x1080 -qscale 2 -threads 4 -f mp4 $Mpeg
Note that "-f mp4" means the output is not raw mpeg-4/H.264 but in the mp4 file format.
For raw video (like mpeg2video in your first example), for MPEG-4 one can use "-f m4v" and for H.264 "-f h264".
The -vpre parameter requires a preset. They can usually be found under /usr/share/ffmpeg/libx264-*.ffpreset.
If you want a 10 second video at 25 fps, you can do it like this:
ffmpeg -loop_input -t 10 -r 25 -i /tmp/temp.jpg -an -vcodec mpeg4 -b 2500 -s 1920x1080 -qscale 2 -threads 4 -f mp4 $Mpeg
You may want to adjust the number of threads according to the number of cores in your machine.
André
vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr