[Libav-user] Erratic encoding issue: Crazy framerates.

Talgorn François-Xavier fxtalgorn at yahoo.fr
Thu Sep 3 10:23:07 CEST 2015


Hi all,

Thank you in advance for your help.
I wrote a program that takes videos as input (H264), process filters on it and encode a modified video in MP4 (simple profile).
Everything works fine but the fact that some videos are encoded with crazy frame rates, like 2500 or 24000 fps.
I assume the problem is related to the way I manage timestamps. I tried tens of workarounds to no avail.
Here is the resulting infos of both an example that fails and another that is OK.

Any help would be a relief. Thanks!

----------------------------
AN EXAMPLE THAT FAILS
----------------------------
H264 ORIGINAL VIDEO
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MS-EPI.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42mp41
    creation_time   : 2014-02-06 23:02:05
  Duration: 00:01:12.44, start: 0.000000, bitrate: 7175 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 960x540, 7041 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
    Metadata:
      creation_time   : 2014-02-06 23:02:05
      handler_name    : Module de gestion vid?o
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2014-02-06 23:02:05
      handler_name    : Module de gestion sonore


FAILED RESULTING ENCODED VIDEO (2501.39 fps)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_MS_MS-EPI.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.15.102
  Duration: 00:01:12.45, start: 0.000000, bitrate: 453 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 32430 kb/s, 2501.39 fps, 2500 tbr, 10k tbn, 2500 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

-----------------------------
AN EXAMPLE THAT WORKS
-----------------------------
ORIGINAL H264 VIDEO
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Coco.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2015-05-31 07:54:08
  Duration: 00:00:15.00, start: 0.000000, bitrate: 352 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 252 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      creation_time   : 2015-05-31 07:54:08
      handler_name    : IsoMedia File Produced by Google, 5-11-2011

CORRECT RESULTING ENCODED VIDEO
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_Coco.mp4':=    0B f=0/0   
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.15.102
  Duration: 00:00:15.00, start: 0.000000, bitrate: 893 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 811 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
   1.81 A-V: -0.004 fd=   0 aq=    6KB vq=   37KB sq=    0B f=0/0   


More information about the Libav-user mailing list