ffmpeg: Generate video from single image

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

ffmpeg: Generate video from single image

Post 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".
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply