Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th December 2019, 21:31   #1  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 173
Fix change of channels in ac3

Hi Guys, I have a recorded ac3 file here.

It starts as a 2.0 but changes to 5.1 after a while.
So the problems begin, because I want to keep the 5.1 part and also the 2.0 part.
But every program I tried fails. They only read the 2.0 header and progress unchanged on those 5.1 sections.

So my question is: Is there a way on commandline to fix this, there are two prefered ways for me:
1. Insert empty channels into ac3 and change headers to simulate a 5.1 (with silent surround channels).
2. Demux to wav and fill up channels with silence to get a constant 6-channel-wav.
mbcd is offline   Reply With Quote
Old 18th December 2019, 22:04   #2  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by mbcd View Post
1. Insert empty channels into ac3 and change headers to simulate a 5.1 (with silent surround channels).
Some TV broadcasting companies use this method as it prevents AVR's from flicking between 2 channel and multi-channel modes...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 18th December 2019, 22:14   #3  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 173
Yes, and this is nice to do so, but my file uses the other method, that means I have both channel-configurations in same file which causes lots of problems using it.


But also bad to use this method, you think you get 6 channel, but its only stereo ... cheaters ;-)))))

So any commandline program out there that can fix this to 6ch somehow?
mbcd is offline   Reply With Quote
Old 19th December 2019, 10:50   #4  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by mbcd View Post
1. Insert empty channels into ac3 and change headers to simulate a 5.1 (with silent surround channels).
Without decode it to wavs is impossible.

Quote:
2. Demux to wav and fill up channels with silence to get a constant 6-channel-wav.
But before you need split your ac3 in parts.
Read this:
https://forum.doom9.org/showthread.p...95#post1447695
https://forum.doom9.org/showthread.p...48#post1853648
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 19th December 2019 at 10:52.
tebasuna51 is offline   Reply With Quote
Old 19th December 2019, 14:21   #5  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 173
@tebasuna51:
Thank you very much for that hint, I will look into it.

I finally got a solution.
ffmpeg is able to handle it.
The file starts with 2.0 and changes to 5.1. ffmpeg identifies it as 2.0 (stereo), but if I decode it to wav an explicit define a 6ch, it takes care of the changes and I get a correct result. It is all handeled correctly I dont loose audio anywhere. But there is no way to identify that is is a 6ch anywhere. No tool is capable to tell that there is a change inside.
mbcd is offline   Reply With Quote
Old 20th December 2019, 01:33   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
In the past I've resorted to DirectShow for that sort of thing. You can specify the number of channels with ffdshow's Mixer filter and that's what it'll output regardless of the input channel count. I know there's a plugin for loading ffdshow in Avisynth directly called ffavisynth.dll, but it's been so long since I've used it I can't remember if it's video-only.

You can achieve the same when converting with foobar2000 by using the Channel Mixer DSP. I recall there was an issue/oddity with it's up-mixing for a certain channel configuration (can't remember) but in this case you'd disable any up-mixing anyway and just tell it to output 6 channels. The Matrix Mixer DSP can do the same by adding the left and right channels to the surround/LFE channels at a volume close to silence (it doesn't create channels unless they contain audio).



Edit: I just realised the bitrate for lossy encoding increases quite a bit when the channels have almost silent audio rather than silence, so I don't recommend the Matrix Mixer method any more.

Last edited by hello_hello; 20th December 2019 at 01:41.
hello_hello is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.