0

I am stuck at a problem of frame extraction using ffmpeg. I am pointing out a given frame duration in video editors like filmora and shotkut (both coherent upto 2 places of milliseconds) and then I am using that duration in ffmpeg to extract all the frames at the native framerate. However, I don't get the perfect coherence when I see the first frame extracted and the corresponding image in editors(vlc, wondershare, filmora all same) both are different.

Please find an example of the command below :

ffmpeg -i "/mnt/sda1/Downloaded_Videos/25mm_Videos/24-12_21/0840.mp4" -ss 00:09:50.18 -to 00:10:49.22 /mnt/sda1/ExtractedFrames/25mm/24Dec_test/frame%5d_0r_0840_00095018_00095018.png

The extracted frame frame_0_0r_0840_00095018_00095018.png is different from the image or frame loaded in editors and vlc player when going to timestamp : 00:09:50.18.

  • Are the editors showing `00:09:50.18` or `00:09:50:18`? – Gyan Dec 29 '21 at 04:35
  • They are showing 09:50:18 which I am converting to 09:50.18 – Avik Mukherjee Dec 30 '21 at 07:35
  • So, `:18` is the frame counter for that second, and it starts from 0. You have to convert it to milliseconds. Suppose the video is 30 fps. Then `:18` --> 18/30 = `0.60`. So, it should be `00:09:50.60`. – Gyan Dec 30 '21 at 07:45
  • Thanks for the info @Gyan. It was spot on. I was able to resolve the issue. I think this should be the marked answer. – Avik Mukherjee Jan 03 '22 at 22:25

1 Answers1

0

Thanks for the valuable comment @Gyan. The framecount does the trick for ex. 00:00:10:20 -> signifies the 20th frame of the 10th second in the video whereas 00:00:10.20 -> signifies the frame at the 200th milli-second for the 10th second of the video.

Conversion : Know the video fps : 00:00:10:20 = 00:00:10.(20 * 1000)/fps