ffmpeg -i myvid.mp4 -r 25 -t 100 image-%d.jpeg
Is the command I'm using to extract frames and it's working just like I expected. However I'd also like to look at the timestamps of the frames. At whatever precision. 100 miliseconds is good enough for me. Can ffmpeg do this?
Providing additional details,
When I run the above command i get around 100 JPEGs, I guess there is a 1 to 1 (or many to 1) correspondence between these JPEGS and frames of the video. I would like to know the timestamp of the frame that was output as a JPEG image 'i'.
Additionally I tried ffprobe but I find it reports even the video duration inaccurately 🙁
Best Answer
What you can do is "simulate" the image writing process by filtering with the
fps
filter, then usingffprobe
to show the timestamps of the generated frames. This means that at 25 fps, the 50th frame (like your 50th image) will have a PTS of 2.00 seconds.You do it like this:
Will output:
These are the timestamps for each output image. You can actually combine the list of frames and the timestamps:
Will create a file with:
Note that this may result in extraneous lines if there are too many frames or too many lines of info output. It seems a little inaccurate there.