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

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th March 2011, 01:13   #1  |  Link
rik1138
Registered User
 
Join Date: Mar 2008
Location: LA
Posts: 620
Editing AC3 header information...

I found a couple of threads about this, but they all ended in discussions about why the question was asked, not if there was a way to do it...

Is there a tool out there that can edit the header of an AC3 file? I need to change the Dolby Prologic surround flags in a bunch of AC3 files, and was looking for a tool to allow me to do that (without re-encoding, just changing the header info...)

Being able to change all the settings would be nice (Bitstream mode, dial norm, input filtering, etc...), but the surround flag is an important one right now...

Any help?

I tried encoding the same file with and without Prologic too look at what has changed, but the flag that is changed is different on every 'frame' of audio apparently... Simple search&replace won't work.
rik1138 is offline   Reply With Quote
Old 19th March 2011, 02:53   #2  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
- Bitstream mode, for what?
- input filtering, to late the signal was already filtered.
- Dial Norm, you can use eac3to (or DN31-Ac3.exe attached).
- Set the DPL flag, you can use DplAc3.exe attached.

[EDIT]
New attachement here including also SplitAc3, DNx_eac3 with sources and 64/32 bits versions.

The DNx_ac3 and DNx_eac3 are now DNx_Any and solving a bug detected in DNx_eac3
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 29th September 2021 at 16:59. Reason: update link
tebasuna51 is offline   Reply With Quote
Old 19th March 2011, 04:06   #3  |  Link
rik1138
Registered User
 
Join Date: Mar 2008
Location: LA
Posts: 620
Quote:
Originally Posted by tebasuna51 View Post
- Bitstream mode, for what?
- input filtering, to late the signal was already filtered.
- Dial Norm, you can use eac3to (or DN31-Ac3.exe attached).
- Set the DPL flag, you can use DplAc3.exe attached.
Wasn't sure which of those settings actually do something to the audio file itself, or are just flags for the decoder to do stuff... (I.e., input filtering..)

Bitstream Mode, options are:
Complete Main
Music & Effects
Visually Impared
... Etc.

Not sure what they do actually, just one of the options in the encoder. Never know when you might need to change something.

RF overmodulation, is that a 'flag', or does it actually change the audio during encoding? Something I'd like to be able to turn off without re-encoding, if that's an option.

Being able to change the prologic flags will be a huge help, thanks a lot for that! Will this allow changing between all 3 settings, or does it just turn PL on?

Thanks again, Rik
rik1138 is offline   Reply With Quote
Old 19th March 2011, 04:35   #4  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
To know about data en AC3 header read:
Digital Audio Compression Standard (AC-3, E-AC-3) Revision B

DplAc3.exe turn PL on.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 19th March 2011, 10:02   #5  |  Link
TDiTP_
Registered User
 
Join Date: Jul 2010
Location: Siberia
Posts: 50
Is there utility that can change DN to any value? Not only to -31dB.

And may be utility for change "Center mix level" and "Surround mix level"
TDiTP_ is offline   Reply With Quote
Old 19th March 2011, 10:47   #6  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
I don't know.

But you have the code, isn't difficult make the changes:
1) Read 1 frame
2) Change the value
3) Reconstruct crc1
4) Goto 1 until end of file
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 16th April 2011, 07:01   #7  |  Link
nickintheforest
Registered User
 
Join Date: Apr 2011
Posts: 8
Quote:
Originally Posted by TDiTP_ View Post
Is there utility that can change DN to any value? Not only to -31dB.
ChangeDN
You may use
Code:
change_dn.exe input.ac3 DN
where DN is integer of [0..31]
For testing this tool you may use test.exe
Code:
test.exe 1.ac3 27
FileSize : 315820288 bytes
SamplCod : 0 (2=32, 1=44.1, 0=48 KHz.)
BitRate  : 448 Kb/s
FrameSize: 1792 bytes
DialNorm: -31db
0xXX
0xXX
First hex-value is byte (bytes) where is the information of DialNorm in first audio frame.
Second - other frames.
Of course, they must coincide.
If ac3 is mono then hex-values will be for example
Code:
3b 80
3b 80
DN bits are bits beginning 13 bit of BSI.
3B 80 = 00011101 10000000
11011 = 27

If 3/2 (L, C, R, SL, SR) или 3/1 (L, C, R, S)
Code:
DC
DC
DN bits are bits beginning 17 bit of BSI
0xDC = 11011100 (bin)
11011 = 27

Else DN bits are bits beginning 15 bit of BSI
Code:
с3 60
с3 60
с3 60 = 11000011 01100000
11011 = 27
--------
Russian forum

tebasuna51, thanks for source.
Attached Files
File Type: 7z ChangeDN.7z (9.1 KB, 237 views)

Last edited by tebasuna51; 14th January 2013 at 13:22. Reason: Add attachment to avoid dead links
nickintheforest is offline   Reply With Quote
Old 13th January 2012, 17:55   #8  |  Link
Abradoks
Registered User
 
Join Date: Mar 2008
Posts: 71
Both links are dead now. Here is mirror: ChangeDN.7z

[Also dead]

Last edited by tebasuna51; 16th January 2021 at 10:48.
Abradoks is offline   Reply With Quote
Old 13th January 2012, 18:16   #9  |  Link
Midzuki
Unavailable
 
Midzuki's Avatar
 
Join Date: Mar 2009
Location: offline
Posts: 1,480
Thanks!
Midzuki is offline   Reply With Quote
Old 14th January 2021, 12:20   #10  |  Link
junh1024
Registered User
 
Join Date: Mar 2011
Posts: 59
Hi, is it possible to modify ChangeDN to work on E-AC3 files too?

E-AC3 Specification


Sample E-AC3 file


Currently, the tool gives a crc1 error.
junh1024 is offline   Reply With Quote
Old 16th January 2021, 19:46   #11  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
@junh1024
This one work with your sample:

[EDIT]DNx_eac3.exe and DNx_ac3.exe included in AC3Util.7z in the second post
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 12th June 2021 at 17:45.
tebasuna51 is offline   Reply With Quote
Old 17th January 2021, 11:05   #12  |  Link
junh1024
Registered User
 
Join Date: Mar 2011
Posts: 59
Thank you tebasuna51, it seems to work on EC3 files of other bitrates . Can I upload the sources & binaries from this thread to Github as a backup?

PS: The EC3 is actually EC3 Atmos, so hopefully they still work on AVR.
junh1024 is offline   Reply With Quote
Old 17th January 2021, 19:23   #13  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by junh1024 View Post
Can I upload the sources & binaries from this thread to Github as a backup?
All are simple free soft.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 3rd October 2021, 13:11   #14  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by junh1024 View Post
Thank you tebasuna51, it seems to work on EC3 files of other bitrates . Can I upload the sources & binaries from this thread to Github as a backup?

PS: The EC3 is actually EC3 Atmos, so hopefully they still work on AVR.
Do you upload them to Github?
Because the eac3 management was buggy, the new one DNx_Any work now for AC3 or EAC3.

But I can confirm the MKVToolNix issue, even with the CRC correct in my new version, my AVR (Denon) can't play like Atmos the modified EAC3.

I have a EAC3 Atmos with DN -14 tha play at very low volume, changed to DN -31 play at high volume but not like Atmos, changed one more time to -14 my AVR play like Atmos again.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 14:22.


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