Score:0

Understanding the syntax of ffmpeg: Save every 10th frame as jpg

bs flag

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!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.