No downmixing for 6ch AC3 streams?

Started by Anamon, July 11, 2012, 08:05:22 PM

Previous topic - Next topic

Anamon

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

#1
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

Anamon

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

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

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

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

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

#7
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.

Jan Gruuthuse

#8
Quote from: JoeZeppy 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

>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

mean

It starts as stereo but switches to 5.1 later on

Jan Gruuthuse

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

I looked into it
Avidemux can cope with channel layout changing, but not with changing the # of channels at the moment