2

I have a 40 second mp4 recorded at 60 fps. I'm trying to get the exact number of frames in the mp4 (rather than assuming 40 * 60 = 2400). I found two methods the count the number of frames:

  1. ffmpeg -i test6.mp4 -f null - result = 2371
  2. ffmpeg -i test6.mp4 test6/out-%04d.jpg result = 2401

The first just prints the total number, and the latter extracts each frame as a jpg. Why do these produce different results?

1 Answers1

3

That can happen when your source is not CFR but VFR and you do conversion to CFR as in your second command.

  • 3
    To the OP, fps mode is handled by the vsync option. Default is auto, so ffmpeg does it as per muxer flag. Add `-vsync 0` to avoid drops or duplication. – Gyan Feb 18 '19 at 05:40
  • awesome little comment here fixed my problem – danday74 Apr 07 '22 at 09:07