[Libav-user] Which codec/parser/filter I missed to open a MP4 file ?

hanguofu hanguofu at 163.com
Thu May 19 10:03:07 CEST 2016

I worked out my window application ( in the form of exe ) based on example remixing.c to concat a series of identical mp4 files. So far so good.

Since my project only caters to MP4 file with AAC and H.264 , I replace the original av_register_all() with the following functions to minimize the generated binary :

// this function is located in allcodecs.c
void  my_avcodec_register_all(void)
    static int initialized;
    if (initialized)
    initialized = 1;
      REGISTER_DECODER (H264, h264);
      REGISTER_ENCDEC  (MPEG4, mpeg4);
      REGISTER_ENCDEC  (AAC, aac);
      REGISTER_PARSER  (AAC, aac);
   REGISTER_PARSER  (H264, h264);
        REGISTER_PARSER(MPEG4VIDEO,         mpeg4video);
      REGISTER_BSF     (H264_MP4TOANNEXB, h264_mp4toannexb);
      REGISTER_BSF(MPEG4_UNPACK_BFRAMES,  mpeg4_unpack_bframes);

// this function is located in allformats.c
void my_av_register_all(void)
    static int initialized;
    if (initialized)
    initialized = 1;
        my_avcodec_register_all() ;        
      REGISTER_MUXER    (MP4, mp4);
       REGISTER_MUXDEMUX (H264, h264);
       REGISTER_DEMUXER  (AAC, aac) ;

Unfortunately , the following avformat_open_input returns with an error message :
Invalid data found when processing input

Of course , if I use the original av_register_all()  then anything is fine. For your information , my targeted mp4 files have the following av_dump_format :

[h264 @ 01C37000] Warning: not compiled with thread support, using thread emulation
[aac @ 01C2E2E0] Warning: not compiled with thread support, using thread emulation
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'h264_aac.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.45.100
  Duration: 00:01:00.04, start: 0.036281, bitrate: 1005 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720,
 865 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
      handler_name    : SoundHandler

Is there sth. I missed when I modified the function ?

Regards !

Guofu Hang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160519/0522a75d/attachment.html>

More information about the Libav-user mailing list