How can I safely use AC-3 in my app?

There are multiple open source implementations of the AC-3 encoder and decoder. Some general guidance:

  • Remove any code that encodes, decodes, parses, muxes, or demuxes E-AC-3 (“Dolby Digital Plus”), MLP, or TrueHD. These are still covered by several patents.
  • Avoid using trademarks such as “Dolby Digital” in your user interface, support articles, app description, and marketing materials. Use the generic terms “AC-3” or “A/52” to refer to the audio technology.

The following open source libraries implement AC-3:

  • libavcodec in ffmpeg (LGPLv2.1+) and libav (LGPLv2.1+)
    • Decoder and encoder for AC-3
    • To compile only the AC-3 decoder: --disable-everything --enable-decoder=ac3 --enable-demuxer=ac3 --enable-parser=ac3 (then enable other parsers, demuxers, muxers, decoders, and encoders that you need)
    • To compile the AC-3 decoder and the AC-3 encoder: --disable-everything --enable-encoder=ac3 --enable-decoder=ac3 --enable-muxer=ac3 --enable-demuxer=ac3 --enable-parser=ac3 (then enable other parsers, demuxers, muxers, decoders, and encoders that you need)
    • Warning: When preparing to use libavcodec in any product, you should always start by disabling all encoders, decoders, parsers, muxers, demuxers, bitstream filters, protocols, filters, and hwaccels, then selectively enabling the ones that your product absolutely needs. To do this, use --disable-everything as your first ./configure option. This will help protect your product from unnecessary intellectual property disputes as well as some security vulnerabilities. If you have not added --disable-everything as your first option, you should at least manually disable the encoders, decoders, muxers, demuxers, and parsers for eac3, mlp, and truehd.

liba52 (GPLv2) used by VLC and others

  • Decoder only for AC-3

valib from AC3Filter (GPLv2)

  • Decoder and encoder for AC-3. Note: Build process does not allow easy removal of patented E-AC-3 code.

Will Dolby pretend that they still have patent rights to AC-3?


In 2012, Dolby bought a vague submarine patent from Panasonic, US6339757 (“Bit allocation method for digital audio signals”). The patent describes an optimization for audio encoders. (… for MiniDisc, using the Sony ATRAC codec.) Dolby has started claiming that Dolby Digital and all of their own products are already implementing this patent.

The good news:

  • The patent only affects encoders, not decoders.
  • Common open source implementations of the AC-3 encoder, such as ac3enc.c in ffmpeg’s libavcodec, do not infringe this (incredibly vague) patent. In particular, they do not adjust bit allocation after initial initialization, and do not optimize bit allocation by psychoacoustic criteria.
  • Dolby hasn’t updated their ETSI IPR listing of standard-essential patents to include US6339757, indicating that they do not believe this patent is required to implement an AC-3 encoder or decoder. In Panasonic’s 9 years of ownership, they also did not allege that this patent was essential to AC-3 implementation, despite claiming numerous other standard-essential patents in DVD and digital television standards.

How can I make sure this never happens again?

  • Donate to the Electronic Frontier Foundation to help fight abuses of the patent system.
  • Embrace open codecs such as Opus, FLAC, and VP9.