FFmpeg generates different number of frame for ORIGINAL and CONVERTED files even though they have same duration and frame rate

Viewed 276

I have two files with the following configuration. I am extracting frames using FFmpeg and then encoding the frames with MediaCodec using the frame duration to calculate timestamp in android.

While processing the first file, FFmpeg generates around 3000 plus frames but for the second file, FFmpeg generates only around 1500 frames.

As I am using the frame duration to encode video, the output video duration changes for the above case. What is it that I am doing wrong? And Why FFmpeg generates a different number of frames?

VID-20210223-WA0009.mp4

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID-20210223-WA0009.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
  Duration: 00:00:50.39, start: 0.000000, bitrate: 1410 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 480x848, 1345 kb/s, 59.96 fps, 59.94 tbr, 600 tbn, 1200 tbc (default)
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 62 kb/s (default)
At least one output file must be specified

VID-20210223-WA0009_1.mp4

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID-20210223-WA0009_1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.48.100
  Duration: 00:00:50.39, start: 0.000000, bitrate: 1376 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc), 480x848, 1301 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 62 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
At least one output file must be specified

0 Answers
Related