Command line program to convert image to video

39ster

Junior Member
Joined
Dec 12, 2009
Messages
174
Reaction score
59
I need a command line program to encode a video using an image file (png, jpeg, etc). I tried ffmpeg and mencoder but can't figure out how to set the duration. The video will always be 0 seconds long. I need to show the image for like 5-10 seconds. Anyone know how? It must be command line (for automation)
 
ffmpeg -r 10 -b 1800 -i Baraba.jpg Baraba.mp4
 
Just tried and the video is still only 0 seconds in duration. The image only shows for like a millisecond.

EDIT:

part of the console output:

Input #0, image2, from 'test.png':
Duration: 00:00:00.02, start: 0.000000, bitrate: N/A

I need to set the duration but don't know how.
 
Okay just figured the option "-loop 1" and "-vframes num"

so for others who need help with this, do the command line like:

ffmpeg -loop 1 -vframes 10 -r 10 -b 1800 -i test.png out.mp4

where -vframes 100 determines how much frames you want to write...so this is 100 frames at 10 frames/sec (-r 10). so it would be 10 seconds long.
 
Back
Top