How to compile Chromium with MP3/AAC and H264 support

5,701

In order to complete the official instructions, you will see other info on this github page to compile Chromium with all codecs (default codecs + AAC, H264/AVC, H265/HEVC, MPEG-4). It focuses Windows OS but is similar on MacOS. Use the GN flags. Note H265/HEVC compile is more complex.

For example, we use this settings to build and share our own Chromium versions for Windows and MacOS (Binaries available on this website). So you can do a similar Chromium version yourself! ;)

Share:
5,701

Related videos on Youtube

comfreak
Author by

comfreak

Updated on September 18, 2022

Comments

  • comfreak
    comfreak over 1 year

    My question is similar to this one that was asked nearly 3 years ago.

    I would like to compile Chromium with support for MP3, AAC, etc. on Mac OS X (I'm using 10.11.6 El Capitan). So far I managed to compile it with standard settings according to the instructions on chromium.org. After running the HTML5Test I realized that by default it doesn't compile with support for proprietary codecs like MP3.

    After some googling I found this page on the Chromium.org website which mentioned some compiler flags:

    ffmpeg_branding
      Overrides which version of FFmpeg to use
      Default: $(branding)
      Values:
        Chrome - includes additional proprietary codecs (MP3, etc..) for use with Google Chrome
        Chromium - builds default set of codecs
    
    proprietary_codecs
      Alters the list of codecs Chromium claims to support, which affects <source> and canPlayType() behaviour
      Default: 0(gyp)/false(gn)
      Values:
        0/false - <source> and canPlayType() assume the default set of codecs
        1/true - <source> and canPlayType() assume they support additional proprietary codecs
    

    I added both to my args.gn using gn args out/gn but it resulted in a linker error when building with dozens of lines like this:

    duplicate symbol  in: 
        obj/components/policy/proto/libproto_internal.a(device_management_backend.pb.o)
    

    I removed the first flag and run ninja again, which resulted in the same linker error after only a few seconds. I switched things around and now left out the second flag I added and it started compiling all over again.

    After compiling successfully for another hour, it results in the same version like previously giving me the same HTML5Test result of not supporting MP3/AAC.

    My question is now, how can I compile Chromium with support for these codecs?

    • 1110101001
      1110101001 over 7 years
      Were you able to get it working? If so could you share the binary?