You can find the documentation on the FFmpeg homepage.
The fps
filter has multiple options, one being fps
. So, to declare that option, you have to call:
-vf fps=fps=1/60
↑ ↑ ↑
| | |
| | |__ value
| |______ option
|__________ filter
You could also write -vf fps="fps=1/60"
, of course.
So, when you use 1/60
that means 1/60 frames per second, or 1 frame per 60 seconds. In any case the difference between this and -r 1/60
is that a filter is applied before any -r
option. Both commands you gave should work in theory, however the -r
one creates too many output frames for me (but I'm not the first one to notice). Stick with the fps
filter.
Note that there is another filter called framerate
, which is similar to fps
, but not the same. Instead of duplicating or dropping frames to achieve the target framerate, it will interpolate frames, i.e. merging adjacent frames to create new images.
If you dissect the command you will find that image2
is the option value of -f
. This specifies the output format. In general, you can use it in ffmpeg
like this:
ffmpeg -f input-format -i input-file -f output-format output-file
In your example, we told ffmpeg
to use the image2
muxer, which allows you to output single image files from video, by specifying a pattern like %02d
for the output name.
The -f image2
is superfluous here as the muxer should be chosen automatically when you use an image output format.
The image2
demuxer also has a framerate
option that allows you to specify the assumed input file framerate. For example, if you have a slideshow that consists of one picture every second, use -framerate 1
as an input option. See here for some examples.
Thank you so much:D i don't even know there's filter option! – Juneyoung Oh – 2013-04-21T13:13:36.873
-vf
and-filter:v
mean the same, but it's more apparent that it's a filter with the-filter
one, of course. I had a talk with someone on the FFmpeg mailing list and they also said that-r
shouldn't be used to set the frame rate for the output.-filter:v fps
is preferred. – slhck – 2013-04-21T13:16:44.353@slhck As a trivial and mostly unrelated side note,
ffplay
doesn't seem to like-filter:v
compared to-vf
(but it has been a while since I've tried due to travel). – llogan – 2013-04-28T16:10:37.383