Page 1 of 1

ffmpeg: Generate video from single image

Posted: Mon Apr 04, 2011 4:05 pm
by ^rooker
I needed to generate a video from a single source image only - not an image sequence.

Here's how to do it with ffmpeg:

The generic form (I've used bash-syntax style $XXX variable names):

Code: Select all

ffmpeg -loop_input -f image2 -i $INPUT_IMAGE -r $FPS -vframes $DURATION -an -vcodec $VIDEO_CODEC -pix_fmt $COLOR_SPACE $OUTPUT_VIDEO
For example, your image is called "signal_placeholder.png" and you want to create a video with 25 frames per second (fps), a duration of 1 Minute (=1500 frames), Video codec "FFv1", no audio and colorspace for default SD PAL video (=YUV 4:2:2):

Code: Select all

ffmpeg -loop_input -f image2 -i signal_placeholder.png -r 25 -vframes 1500 -an -vcodec ffv1 -pix_fmt yuv422p output.avi
If you prefer to have the duration in seconds rather than frames, you can replace the "-vframes" argument with "-t".