Author Topic: No downmixing for 6ch AC3 streams?  (Read 17760 times)

Anamon

  • Newbie
  • *
  • Posts: 3
No downmixing for 6ch AC3 streams?
« on: July 11, 2012, 08:05:22 PM »
I have a problem with 6ch AC3 streams that is consistently reproducible. I get this problem because I would like to transcode recordings with 5.1 AC3 sound to my iPad for watching them on the go. Since the iPad doesn't support AC3 decoding (and only has stereo output anyway) I want to downmix the audio stream to 2.0 AAC or MP3.

The problem is that Avidemux never seems to do any mixing, independent of what setting is selected for Audio Filters > Mixer, if the source stream is AC3. This happens in Avidemux 2.5.6, but has been happening for numerous versions before that, for as long as I've used Avidemux. In particular, I have found that:

» Transcoding to AAC or MP3 without mixing:
Left channel is quiet (no data or LFE); right channel is a copy of either L or R.
» Transcoding to MP2 without mixing:
Left channel is a copy of either L or R; right channel is quiet (no data or LFE).
» Transcoding to AAC or MP3 with Mixer setting Stereo or Dolby Pro Logic or Dolby Pro Logic II:
Left channel is a copy of either L or R; right channel is quiet (no data or LFE).
I have confirmed these by examining the resulting files in Audacity 1.3.

None of the settings will, as would be expected, mix L+LS+C+LFE into the left and R+RS+C+LFE into the right channel. In fact, I cannot find a setting that preserves the Center channel of the original stream, which in recordings of professional productions will contain all the voices.

Related threads: this one from 2008 mentions the same issue and reports the problem solved with another source file, not stating whether the working one still used an AC3 stream. And this one from 2009 states that the behaviour I expect would actually be the intended one, i.e. for these mixer settings Avidemux should actually downmix the audio streams, and not just randomly discard channels (if it would map L to L and R to R, there would at least be some discernible logic behind it).

Is this a bug, or am I doing something wrong? Or is downmixing not supported for AC3 streams by design? If the latter is the case, I think the 'Mixer' label in the Audio Filters dialogue should probably be renamed when the active source stream is AC3, since "mixing" would be kind of a misnomer for what Avidemux actually ends up doing.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: No downmixing for 6ch AC3 streams?
« Reply #1 on: July 12, 2012, 08:10:45 AM »
5.1 down mix to stereo: Seems to be working fine in 2.6?
5.1.jpg as seen in audacity (LFE = blue track showing)
Stereo.jpg is the stereo AAC (Faac) downmix in avidemux
Original HD 5.1 videoclip from BBC 64MB : https://rapidshare.com/files/537987528/BBC5-1HD.zip
Please note the above file has TWO audio Tracks. You need to select 1st AC3 track, deselect mp2 stereo track, before proceding.
Stereo down mix in avidemux 2.6 55MB: https://rapidshare.com/files/1204809946/bbcstereo.zip
« Last Edit: July 12, 2012, 09:14:30 AM by Jan Gruuthuse »

Anamon

  • Newbie
  • *
  • Posts: 3
Re: No downmixing for 6ch AC3 streams?
« Reply #2 on: July 15, 2012, 05:20:50 PM »
That is interesting, thank you for the example. Your file downmixes fine for me as well, even in Avidemux 2.5.6.
In all my recordings I have never found a 6-channel AC3 stream that downmixed correctly like this. I am going to try my own recordings again in Avidemux 2.6. If that still fails, I'll start looking into any differences I can find between the container and streams of your recording vs. mine.
I don't suppose the choice of the container itself should make a difference for this.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: No downmixing for 6ch AC3 streams?
« Reply #3 on: July 16, 2012, 09:10:17 AM »
If that would be the case that your AC3 5.1 don't down mix correctly, if these are from the same source: hardware or provider, dvb s/s2/t/t2/c/c2 stream? It could be helpful if you upload original sample to Rapidshare or similar service and provide a link to it. That way the developer(s) can check if something needs tweaking. I will have a look if I have the same problem with those samples. Keep in mind if 5.1 is DTS that could be an issue, as far as understand this.

avidemux wiki: how to Cut TS sample

Anamon

  • Newbie
  • *
  • Posts: 3
Re: No downmixing for 6ch AC3 streams?
« Reply #4 on: July 30, 2012, 03:08:15 AM »
I am still investigating this. Currently I don't have any samples, but the next time I encounter the problem I will try to isolate it and upload a sample.

One possible cause that has entered my mind is that it could be due to the audio channel configuration changing over the course of one video (within the same audio stream). When recording, sometimes the programme will be in AC3 6ch while the stream switches to AC3 2ch for commercial breaks etc. Avidemux (and FFMPEG in general) seem to deal with this very badly, they appear to look at the stream format at the beginning of the file and simply assume it remains the same. If the recording started during a commercial, before the programme began, I cannot even get the 6-channel audio into Audacity. I will have 2 channels throughout, with the problem described above during the actual programme (surround channels as L and R). However I'm positive that I also had the problem with recordings that began with 6-channel audio, and I cannot be sure what happens then before I have another such recording to investigate. I would be curious though how the problem could still occur from the beginning of the file (which it did), if the switch to 2-channel happens only some length into the stream.

If this turns out to be the problem, then I guess one solution would be to just cut the actual programme segments with 6-channel audio by splitting the stream, then re-concatenating the parts, before transcoding and remuxing it. That, however, would already be too much work for me, since my usage scenario is transcoding recordings for my iPad to watch exactly once before I delete them again.

JoeZeppy

  • Newbie
  • *
  • Posts: 1
Re: No downmixing for 6ch AC3 streams?
« Reply #5 on: May 25, 2013, 11:46:26 PM »
I just discovered the same thing. I have a copy of The Newsroom in mkv, AC3 audio, trying to convert for iPad. Copy video, convert the audio to Faac, MP4 muxer. everything else is default.

the intro music sounded perfect, but the actual episode sounds terrible. About 6 minutes or so in, two actors are on set talking, and there is literally no dialog at all, only background ambient noise. I'm assuming this is rear channel information.

I tried again, this time downmix to stereo, same result.

This is the source file
http://rapidshare.com/files/1910732042/The.Newsroom.2012.S01E03.720p.HDTV.x264-IMMERSE.mkv

And this is the converted file
http://rapidshare.com/files/483765440/The.Newsroom.2012.S01E03.mp4

bernd_b

  • Full Member
  • ***
  • Posts: 103
Re: No downmixing for 6ch AC3 streams?
« Reply #6 on: May 26, 2013, 07:13:25 AM »
That's the whole 1.,3GB and not a sample?! :-\ as proposed two post before. Would take about 6 hours to download it, not talking of the TV-Station you recorded it from ... 8)

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: No downmixing for 6ch AC3 streams?
« Reply #7 on: May 26, 2013, 08:29:15 AM »
Have you checked if other audio tracks are present? When I record from digital TV (dvb-s/s2) I have all audio tracks in the mpeg-ts stream. I can then select the position where the audio tracks should be present. In your case that could mean either switch tracks from 0 to 1 and 1 to 0 or omitting the AC3 track.
Avidemux Main Menu (textual): Audio: Select Track: make the choices there.
« Last Edit: May 26, 2013, 08:43:47 AM by Jan Gruuthuse »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: No downmixing for 6ch AC3 streams?
« Reply #8 on: May 27, 2013, 08:33:26 AM »
I just discovered the same thing. I have a copy of The Newsroom in mkv, AC3 audio, trying to convert for iPad. Copy video, convert the audio to Faac, MP4 muxer. everything else is default.

the intro music sounded perfect, but the actual episode sounds terrible. About 6 minutes or so in, two actors are on set talking, and there is literally no dialog at all, only background ambient noise. I'm assuming this is rear channel information.

I tried again, this time downmix to stereo, same result.

This is the source file
http://rapidshare.com/files/1910732042/The.Newsroom.2012.S01E03.720p.HDTV.x264-IMMERSE.mkv

>8>8
Don't understand completely? Why are you down mixing to stereo? The source file has only AC3 stereo component! Use one minute section and try what works best: mp4 / mp4v2 muxer. AAC: Faac / lav.
Codec: aac
 Sample rate: 48khz
 Bitrate: 160kbps
 Channels: Stereo
« Last Edit: May 27, 2013, 08:51:21 AM by Jan Gruuthuse »

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10974
Re: No downmixing for 6ch AC3 streams?
« Reply #9 on: May 27, 2013, 10:23:35 AM »
It starts as stereo but switches to 5.1 later on

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: No downmixing for 6ch AC3 streams?
« Reply #10 on: May 27, 2013, 10:35:46 AM »
I see, got only tiny partial download: not downloading 7 hours.
Would this work: make new copy while setting marker [A ] where 5.1 starts and then save video with copy for both audio/video with mkv muxer?

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10974
Re: No downmixing for 6ch AC3 streams?
« Reply #11 on: May 28, 2013, 07:16:30 AM »
I looked into it
Avidemux can cope with channel layout changing, but not with changing the # of channels at the moment