Skip to content

Feature request: Add E-AC3 7.1 output and E-AC3 in MP4 muxing. #1085

Open

Description

@Nomis101

Original title: Passthru of E-AC3 on MP4 not possible and missing 7.1 option

Description of problem or feature request

I found two issues in HandBrake using the MP4 file format for E-AC3.

  1. The HandBrake docs states

The following source format’s can be passed thru.
E-AC3
https://handbrake.fr/docs/en/latest/advanced/surround-sound.html

But, I have a MKV movie file which contains an E-AC3 5.1 audio stream. This movie I want to convert to m4v and preserve the audio stream (Passthru). But I only can select AC3 (convert) as an option. There is no E-AC3 Passthru. This is only available for MKV.

  1. The AppleTV 4K supports E-AC-3 (Dolby Digital Plus 7.1 surround sound).
    https://www.apple.com/apple-tv-4k/specs/
    So, I have a movie that I would like to convert for the AppleTV which has an TrueHD 7.1 audio stream. I would like to preserve the 7.1 audio channels. But if using the m4v file format I only can down mix the audio to 5.1. There is no option for E-AC3 7.1 (or any other audio format supporting 7.1 channels).

Steps to reproduce the problem

  1. Get a mvk file that contains an E-AC3 stream. Try to convert it to m4v and Passthru the audio stream.
  2. Get a mkv file that contains a TrueHD 7.1 audio stream. Try to convert it to m4v for the Apple TV and preserve the 7.1 channels array.

HandBrake version (e.g., 1.0.0)

Version 20171228023706-bcfb612-master (2017122801)

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.3 High Sierra, Windows 10 Creators Update)

macOS 10.3 High Sierra

Error message text or screenshot

Type or paste text and/or drag and drop image.

HandBrake Activity Log required (see https://handbrake.fr/docs/en/latest/help/activity-log.html)

Drag and drop file or...

Paste log text between these markers.

Activity

  1. bradleysepos commented on Dec 28, 2017

    @bradleysepos
    Contributor

    Unfortunately, our muxer cannot embed EAC3 into MP4. The documentation article you site is a carryover from the old wiki, and right at the top highlighted in yellow says, "This article is a draft and may contain incomplete or incorrect information."

    Anyway, sorry for the trouble. Marking as an enhancement.

  2. added this to the 1.2.0 milestone on Dec 28, 2017
  3. changed the title [-]Passthru of E-AC3 on MP4 not possible and missing 7.1 option[/-] [+]Feature request: Add E-AC3 7.1 output and E-AC3 in MP4 muxing.[/+] on Dec 28, 2017
  4. bradleysepos commented on Dec 28, 2017

    @bradleysepos
    Contributor

    Regarding 7.1, I'm pretty sure this is a limitation in our upstream libraries at this time. We hope to resolve this, too.

  5. jstebbins commented on Dec 28, 2017

    @jstebbins
    Contributor

    There are a number of things that moving to ffmpeg will allow us to do. Muxing eac3 to mp4 is among them, as well as muxing opus and flac. Encoding 7.1 eac3 however is not supported. aac, opus, and flac all support 7.1 in ffmpeg.

  6. Nomis101 commented on Dec 29, 2017

    @Nomis101
    ContributorAuthor

    There are a number of things that moving to ffmpeg will allow us to do. Muxing eac3 to mp4 is among them, as well as muxing opus and flac.

    OK, than I'm hoping for 1.2.0 and keep the original MKV file for now. :-)

    Encoding 7.1 eac3 however is not supported. aac, opus, and flac all support 7.1 in ffmpeg.

    I found two bugs regarding eac3
    https://trac.ffmpeg.org/ticket/4608
    https://trac.ffmpeg.org/ticket/3595
    But it doesn't look like they will fix this anytime soon. AppleTV also supports AAC, but I can not find informations about the max channels for AAC.

  7. bradleysepos commented on Dec 29, 2017

    @bradleysepos
    Contributor

    Apple TV should support at least 5.1 AAC. The problem is most receivers don’t. So you end up listening to a PCM stereo mixdown.

  8. JimmyK814 commented on Apr 17, 2018

    @JimmyK814

    I have been fighting a battle with lax EAC3 support for many years. I first gained interest in 2011 and have been trying to get some improvements going. Believe it or not, it's much better now. You can successfully MUX a 7.1 EAC3 source file into an MKV where before that was a challenge. Even Windows Media Player can output EAC3 7.1 via PCM or the bitstream to a compatible AVR or receiver.

    Sadly most implementations of EAC3 only support he basic 5.1 channels or even just decoding the AC3 core. I've been trying to submit bug reports and talk to authors and developers to improve support for 7.1 channel EAC3. Kodi currenly will play DD+ 7.1, but only 5.1 channels PCM. It will pass a 7.1 channel bitstream but not correctly, to where most receivers will error out.

    I've been working with some people on VLC supporting this. 7.1 channel EAC3 will play as a 5.1 PCM on the latest nightly builds now, compared to not playing at all. I am planning to test the bitstream option on VLC later today to see if that has been corrected.

    It would be completely awesome to have support in handbrake for EAC3 with 7.1 channels. I feel that it is a much better companion for X265 than AAC because DD+ is already so widely supported where AAC has no hardware support.

    I purchased a Dobly Media encoder years ago that allows me to make DD+ 7.1 sample files if I can help at all. I do not mind helping with any testing or providing test files, etc. The extra 4 channels added for the 8 channel audio always seems to be an afterthought.

    The extra 4 channels replace the two rear channels in 5.1 that's present in the core, as I'm sure anyone who can ready up on the spec would know.

  9. richardpl commented on Apr 18, 2018

    @richardpl

    @JimmyK814 FFmpeg supports E-AC-3 7.1

  10. galad87 commented on Jun 5, 2018

    @galad87
    Contributor

    Muxing added in 1157255
    FFmpeg encoder doesn't seems to support 7.1

  11. Nomis101 commented on Jun 5, 2018

    @Nomis101
    ContributorAuthor

    Thanks for fixing this. I can now encode E-AC3 up to 5.1, 7.1 is down mixed to 5.1.
    As a workaround I encoded the 7.1 stream as AAC using ffmpeg (copy video stream) and than transcoded it in HandBrake using AAC Passthru. This plays on my AppleTV 4k. Would it be possible to allow 7.1 AAC muxing in HandBrake directly, now with the benefit of ffmpeg?

  12. galad87 commented on Jun 5, 2018

    @galad87
    Contributor

    I wonder why 7.1 is disabled in the Core Audio AAC encoder, does anyone remember the reason?

  13. bradleysepos commented on Jun 5, 2018

    @bradleysepos
    Contributor

    Looks like it wasn't enabled in 93117ad

  14. Nomis101 commented on Jun 5, 2018

    @Nomis101
    ContributorAuthor

    I enabled 7.1 AAC for my own build. Playback works nicely on macOS 10.13 and tvOS.

  15. bradleysepos commented on Jul 1, 2018

    @bradleysepos
    Contributor

    Tracking parity:

    • E-AC3 7.1 in MP4 passthru on Linux
    • E-AC3 7.1 in MP4 passthru on Mac
    • E-AC3 7.1 in MP4 passthru on Windows
    • E-AC3 7.1 in MP4 passthru on CLI
  16. sr55 commented on Sep 21, 2018

    @sr55
    Contributor

    Windows: 7310e70

  17. sr55 commented on Sep 21, 2018

    @sr55
    Contributor

    Edit: Nevermind

  18. modified the milestones: 1.2.0, 1.3.0 on Oct 3, 2018
  19. galad87 commented on Nov 27, 2018

    @galad87
    Contributor

    EAC3 7.1 is already working. The dec3 atom is not totally right yet.

  20. Nomis101 commented on Dec 1, 2018

    @Nomis101
    ContributorAuthor

    The dec3 atom is not totally right yet.

    Can this be fixed or is this a ffmpeg issue?

  21. modified the milestones: 1.3.0, Unscheduled on Jan 1, 2019
  22. JimmyK814 commented on Jan 23, 2019

    @JimmyK814

    Just curious what was unscheduled here?
    Do we have the ability to encode E-AC3 at 7.1 now into any containers, or is it only not supported in the mp4 containers?

  23. sr55 commented on Jan 23, 2019

    @sr55
    Contributor

    We don't really schedule things. Generally it'll only added to a github release after it's been done.

    So, nothing has changed here.

  24. warrex1979 commented on Jan 3, 2022

    @warrex1979

    EAC3 7.1 is already working. The dec3 atom is not totally right yet.

    Unusual (?) channel layouts like the following work when converting to 8 channel FLAC in ffmpeg while Handbrake only offers to downmix to 5.1:

    Info from ffmpeg: eac3 (AC-3 / 0x332D4341), 48000 Hz, 8 channels (FL+FR+FC+LFE+SL+SR+TFL+TFR), fltp, 1512 kb/s

    Info from Handbrake: eac3, rate=48000Hz, bitrate=1512000 English (E-AC3) (7.1 ch) (1512 kbps)

    Are you aware of this and will this be changed in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions