Spacey
Spacey

Reputation: 3011

How to force ffmpeg to use all the images in a directory?

I have a directory of images, (*.png)s, and I am trying to make a movie out of them using ffmpeg.

The images are named in multiple of 50, so I have: images_0000.png, then, images_0050.png, then images_0100.png, then images_0150.png, etc, all the way to images_4950.png, and so I have 100 images in total.

I use the following command to make my movie:

ffmpeg -r 10 -pattern_type glob -i '*.png' -c:v libx264 movie.mp4

This works fine to make the movie, however when I play it, does not look like every image is being used. That is, if I step through frame by frame, I see that some images are not being displayed, and it looks like they were skipped. (I know because every image has it's name written on it).

So, how do I force ffmpeg to use every image in the directory, such that every step forward in the movie, will show the corresponding image?

Thanks.

EDIT: Here is the complete screen dump of the command:

enter image description here

Upvotes: 3

Views: 4437

Answers (1)

VocoJax
VocoJax

Reputation: 1549

Comment from llogan said it all.

use -framerate and not -r in your pipeline. Something like:

ffmpeg -framerate 10 -pattern_type glob -i '*.png' -c:v libx264 movie.mp4

The -r acts like a filter and will filter out from your input to match the targeted framerate.

Upvotes: 1

Related Questions