On the FFmpeg documentation (here, and here) I read that, by default, FFmpeg chooses to extract frames at 25 frames per second (otherwise you can specify a framerate with the -r option)
My problem is that I have a folder with dozens of videos, each of them recorded at different frame rates, so my question is:
Is there a way to ask FFmpeg to extract frames from a video at the “native” frame rate (i.e. the original frame rate at which the video was recorded)?
In case it matters, I am working with MP4 files
To get the original frame rate:
Example Output:
You can futher pipe it to sed
... | sed 's/\sfps//'to keep only the25, and store it into a variable, so you can use that variable to convert the videos e.g.ffmpeg -r $originalFps.grep -owill extract the match, instead of the whole line containing the match.[0-9]\{1,3\}will match one to three digits\sfpswill match a white space followed by ‘fps’