i want to save every 10th frame of a video (.mp4) as a JPEG file. I found this line here on the internet:
ffmpeg -i /videopath/videoname.mp4 -vf "select=not(mod(n\,10))" -vsync vfr -q:v 2 /imagepath/img_%04d.jpg
I actually works, but I don't quite understand it. I already read the documentation of ffmpeg and found some explanations.
- The
-i
parameter is clear.
-vf
creates the filtergraph to filter the stream. There is a manual for the filtergraph syntax but I can't make heads or tails out of it. So is select
the filtername without the @? And the string behind the =
is the "filter_arguments"? Is it acutally a filterchain separate with the comma ,
?
-vsync
: Set video sync method / framerate mode. But shouldn't be "-fps_mode"? Is vfr 2
the parameter of this command? If yes, it this what it does: "Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp"? But why is there another parameter in between?
-q
: Is this the same as "-qscale"? If yes, What does the explanation mean? "Use fixed quality scale (VBR)". And what does the argument v
do?
So, you see I'm not very experienced with ffmpeg, but I'm trying to understand. Thank you very much for your help!