Frame rate and movies from images
I am using ffmpeg to create movies from a directory of images. This is the command I use: ffmpeg -i imagedir/%05d.jpg -b 1800 video.mp4 This works great except that I want to be able to slow down the playback to say 6 frames per second. I tried this: ffmpeg -i imagedir/%05d.jpg -r 6 -b 1800 video.mp4 Which does playback at 6 frames per second, but what seems to be happening is that ffmpeg is also skipping frames. So if I have say 506 images in the images directory, the resulting movie uses only 123 frames. I can see where this something you might want, if you don't want the duration of the output movie to change with different frame rates, but is there a way to force it to use all the frames and extend the duration? I tried using the -vframes flag but it didn't seem to do anything: ffmpeg -i imagedir/%05d.jpg -r 6 -vframes 506 -b 1800 video.mp4 thanks, josh
On date Thursday 2008-10-23 10:49:34 -0400, Josh Rooke-Ley encoded:
I am using ffmpeg to create movies from a directory of images. This is the command I use:
ffmpeg -i imagedir/%05d.jpg -b 1800 video.mp4
This works great except that I want to be able to slow down the playback to say 6 frames per second. I tried this:
ffmpeg -i imagedir/%05d.jpg -r 6 -b 1800 video.mp4
Which does playback at 6 frames per second, but what seems to be happening is that ffmpeg is also skipping frames. So if I have say 506 images in the images directory, the resulting movie uses only 123 frames. I can see where this something you might want, if you don't want the duration of the output movie to change with different frame rates, but is there a way to force it to use all the frames and extend the duration? I tried using the -vframes flag but it didn't seem to do anything:
ffmpeg -i imagedir/%05d.jpg -r 6 -vframes 506 -b 1800 video.mp4
Currently you can't achieve that with SVN ffmpeg, check libavfilter-soc and the setfps filter. Regards. -- ffmpeg-user random tip #25 If you can't achieve a result with a particular command, always post the command. It's easier for who is replying to fix an error rather than to provide a complete solution, also this way you're showing your own effort thus improving your karma.
On Thu, Oct 23, 2008 at 3:49 PM, Josh Rooke-Ley <josh at uncommonprojects.com>wrote:
I am using ffmpeg to create movies from a directory of images. This is the command I use:
ffmpeg -i imagedir/%05d.jpg -b 1800 video.mp4
This works great except that I want to be able to slow down the playback to say 6 frames per second. I tried this:
ffmpeg -i imagedir/%05d.jpg -r 6 -b 1800 video.mp4
Which does playback at 6 frames per second, but what seems to be happening is that ffmpeg is also skipping frames. So if I have say 506 images in the images directory, the resulting movie uses only 123 frames. I can see where this something you might want, if you don't want the duration of the output movie to change with different frame rates, but is there a way to force it to use all the frames and extend the duration? I tried using the -vframes flag but it didn't seem to do anything:
ffmpeg -i imagedir/%05d.jpg -r 6 -vframes 506 -b 1800 video.mp4
thanks,
josh
You might want to take a look at blender (pretty steep learning curve - but very good documentation) that would only take you a few seconds to achieve.
Dan.
You made an error for not recognizing the difference between -r as an input option or output option. If your source is a series of image sequence, ffmpeg will assume the frame rate of 25 FPS if none is specified as the input option; if your source is a video file, the frame rate of the source will be regarded as input option if none is specified. Just type -r "6" before -i should serve your purpose, if I understand you correctly. -r before -i will force the frame rate on the source while ignoring the frame rate of the source, which will result in slowing down or speeding up of the playback of the video. -r after -i is the frame rate for output video, which if the frame rate is high enough, will preserve the playback speed or the length by adding or dropping frames. If the source is of variable frame rate, specifying a different frame rate as the output option may cause the output video out of sync with audio, mainly due to changing frame rate of the source itself; even though the input video is perfectly in sync with audio. Encoding a video into a series of image sequences and specifying a frame rate as an output option can force the frame rate to be constant while preserving the original length. -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Frame-rate-and-movies-from-images-t... Sent from the FFmpeg-users mailing list archive at Nabble.com.
Thanks for your reply. If I attempt to use -r as an input option, ffmpeg gives me the error: Could not set video options: Input/output error. I think this is because my input is not a series of image sequences nor is it a video file. It is real time streaming from an AJA Capture Source. As such, I am unable to set the frame rate of the input. Any other ideas are welcome and appreciated. Thanks. -----Original Message----- From: ffmpeg-user-bounces@ffmpeg.org [mailto:ffmpeg-user-bounces@ffmpeg.org] On Behalf Of thljcl Sent: Sunday, July 21, 2013 7:31 PM To: ffmpeg-user@ffmpeg.org Subject: Re: [FFmpeg-user] Frame rate and movies from images You made an error for not recognizing the difference between -r as an input option or output option. If your source is a series of image sequence, ffmpeg will assume the frame rate of 25 FPS if none is specified as the input option; if your source is a video file, the frame rate of the source will be regarded as input option if none is specified. Just type -r "6" before -i should serve your purpose, if I understand you correctly. -r before -i will force the frame rate on the source while ignoring the frame rate of the source, which will result in slowing down or speeding up of the playback of the video. -r after -i is the frame rate for output video, which if the frame rate is high enough, will preserve the playback speed or the length by adding or dropping frames. If the source is of variable frame rate, specifying a different frame rate as the output option may cause the output video out of sync with audio, mainly due to changing frame rate of the source itself; even though the input video is perfectly in sync with audio. Encoding a video into a series of image sequences and specifying a frame rate as an output option can force the frame rate to be constant while preserving the original length. -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Frame-rate-and-movies-from-images-t... Sent from the FFmpeg-users mailing list archive at Nabble.com. _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
participants (5)
-
Jason Palmer -
josh@uncommonprojects.com -
mail.dharris@googlemail.com -
stefano.sabatini-lala@poste.it -
thljcl