View Full Version : AC3 encoding
King_Diamond
14th August 2005, 17:24
I encoded a 5.1 wav audio file to 5.1 ac3. The ouput seems good on pc but when played on a set top player, sounds fluctuates to highs and lows. Each song starts at normal level but when it reaches higher db, the sound level decreases. This is repeated every time there is a db increase or decrease. It sounds horrible to the ears.
I encoded the file using the default settings of surcode. I was wondering if this has to do with the dynamic range compression. If I set dynamic compression to none, would I solved the problem? Or is it an issue of other settings?
Any help would be much appreciated.
mic
14th August 2005, 19:07
There's some really good info in the stickies, particularly the one on ac3. I'm not expert with surcode, but while waiting for one to answer your question, it definitely does sound like a compression prob., with the way your stand-alone is reading the settings anyway, so try an encode without & burn to a rewritable.
King_Diamond
14th August 2005, 19:37
I read the detailed post of SomeJoe and that is why I came to this conclusion. In the meantime, I re-encoded the file. I have to burn it and try it. Will post the result later.
King_Diamond
14th August 2005, 22:39
The result is much better but the problem still persist at certain instances (not so frequent like before). The problem seems to be at instances were mid & high frequencies gain db.
Now I'm wondering to check dialog norm which I set at -27db and Bitstream Mode which I set to Complete Main. Any ideas on these settings? Btw the file I'm working on is only music.
King_Diamond
14th August 2005, 22:57
Btw is there a free software to measure RMS for dial norm?
Mug Funky
15th August 2005, 08:54
this isn't intended for dialnorm, however i've found that ReplayGain scans come out remarkably close to just the right level for a -27dB dialnorm (and you can set mix level to 89dB as well, though i'm not sure this makes a difference).
so you could use a little free proggy called WaveGain to pre-process your wav file, then feed that to surcode. although i don't know if it handles 6ch wavs. if it doesn't try use Foobar2000 to do it - it's also got a replaygain scanner.
one thing you might consider doing is turn off DRC on your standalone player. turn it back on if you need it (like you're getting dinner and can't hear the TV over the cooking noises in the quiet bits), but a decent sized stereo is MUCH more impressive with DRC turned off and the volume turned high. try turn it up so that dialogue in the movie is the level of a person talking normally in the room. then everything else should sound right.
mic
15th August 2005, 20:44
Any ideas on these settings?
If it helps, this is the default for sofo/sony plugin:
-------------------------------
Bitstream mode: Main audio service: Complete main
Audio coding mode: 2/0 (L,R) .... 5.1 etc...
Sample rate: 48 kHz
Data rate: 192 kbps Audio bandwidth: 20.34 kHz
Dialog Normalization: -3 dB, -6 dB, -27 dB (3 main templates)
Save data in Intel byte order (LSB first): unchecked
Enable extended bitstream information: unchecked
Input filtering
Digital de-emphasis: unchecked
DC high-pass filter: checked
Bandwidth low-pass filter: checked
Dynamic range compression:
Line mode profile:
& RF mode profile: choice of: Film: Standard / Film: Light / Music: Standard / Music: Light
RF overmodulation protection: unchecked
------------------------------
RE: Free Software, Audacity at Sourceforge handles multichannel wav files, but I haven't played with it all that much to say how good it is.
------------------------------
IN the total guess dept., as suggested by Mug Funky, what is the condition of, & how did you get original 5.1 file? Assuming no prob. there, would it be worth the effort to decode your new ac3 into separate wav files with Besweet, Belight, or whatever, and check those for prob. that might have been introduced by ac3 encode?
And if (or in case) it helps, I have used wav files that were by themselves OK (verified in Sound Forge), but when imported into a Vegas 5.1 project, showed clipping on individual channels when previewing with all 6 tracks. [Don't know why -- just reduced levels and it works]
I don't know how much if any simularity there might be between the two SOFO/Sony apps, if they share anything or not, but with the amount of time & work you've invested so far, would it be worth it to reduce levels across the board on your 5.1 wav just to see what happens?
King_Diamond
15th August 2005, 22:19
@Mug Funky
I have WaveGain but I don't know where to check RMS. Yes surcode handles 6ch wavs.
My standalone player does not have turning DRC on or off. As I said above, I encoded the file without DRC & the result was much better. On a decent stereo these "anomalies" are heard cause on pc, I won't hear the difference.
I have the 6 mono wav files and the 5.1 wav file (which I both did) and are all heard good. The content is only music so there's not the dialogue problem, which is why I'm wondering what the dialnorm setting would correctly be. The problem rises when encoded to ac3. So I concluded that it has to do with the settings.
@mic
Yes that helps mic. Thanks a lot. Infact I had turned the RF overmodulation on in the last try. As a start, I will turn it off again.
All the other settings seem to be the ones I used. As for the Bistream Mode, I was wodering if using Music & Effects instead of Complete Main would have any difference since the contect is only music.
Re the dialnorm, I used -27db but according to the sticky of SomeJoe, if this is not set correctly, the outcome won't be nice, or something like that. He suggests to check the RMS to set the dialnorm correctly. That's the reason I need a free software to do this. I will check WaveGain again as suggest by Mug Funky and will have a look at Audacity as well.
And if (or in case) it helps, I have used wav files that were by themselves OK (verified in Sound Forge), but when imported into a Vegas 5.1 project, showed clipping on individual channels when previewing with all 6 tracks. [Don't know why -- just reduced levels and it works]
I had this problem as well. Through previous experience, I learnt that everything in Dolby Digital has to be under 0db, as 0db is the maximum output level. This is not my problem now as I already had to redo all under 0db. You are right, hell of a work!
King_Diamond
24th August 2005, 13:16
Sorry for being long to reply but I was very busy.
I tried turning off the RF overmodulation and changed the Bitstream Mode to Music and Effects. The result is much better. However, mid frequencies (1K-6K) are a bit too high.
If I set the dial norm to -29db or -31db instead of -27db, would this have an effect on mid frequencies if the bitstream is set to music and effects? I read in dolby site that this mode does not "allocate" a vocals channel.
mic
25th August 2005, 01:42
Glad it's better:)
I'm really unsure about dial norm when set to Music & fx. When I've used lower numbers & set for film/video, the result is usually quieter.
bobcat56458
25th August 2005, 14:54
Audacity will accept a 5.1 wave file as an input file but I believe when you go to save it after editing you can only get a stereo wave file as the output.
King_Diamond
26th August 2005, 15:35
@mic
I encoded the file using lower dial norm under music and effects but the result is still the same. Any more ideas?
@bobcat
Thanks for your suggestion but after the work it took me to do it 6 channel, I will certainly not go back to 2 channel.
mic
26th August 2005, 22:55
Thinking....
...Thinking.......
......Guessing...... :confused:
I have been and will keep thinking about this...
Brainstorming with the keyboard, if you had the prob with a wav file(s) on your PC I'd probably jump at either poorly implemented dynamic compression, or wrong compression settings. My portable has menu controls for the level or use of compression, but I hadn't remembered that till just now as I've never set it.
The other thing that occurs, but is more a random thought that might inspire an idea, I had a prob once with a PC -- turned out the speakers (which were remans) were wired with different polarity. Meant the right and left were out of phase and canceled each other out at some freq... Not that your speakers are bad, but could there be something going on with phase/phase delay?
I'll keep thinking... :(
King_Diamond
27th August 2005, 11:12
Thanks for your help and thinking mic.
The wav file is fine. The problem is after it is encoded. What do you mean with "dynamic compression"? If you are refering to DRC while encoding the ac3 file, I used no DRC.
As regards the speakers, I checked them and they are ok. Still original DVDs don't have this problem. It's just with the file I encoded. I strongly believe that I am doing something wrong with the settings of encoding. I am not well versed in the field so I don't know what else I can try. I read losts of posts and websites but still can't figure out the correct settings I should use.
Btw this is my first 6 channel ac3. I previously encoded 2 channel ac3 and did not have this problem.
King_Diamond
27th August 2005, 11:43
mic,
I have an idea now, thanks to Tebasuna. I was reading a post where Tebasuna stated that wav and ac3 files have different channel order. I didn't know this so now I'm wondering if this is the case. Is there a software to verify this and that can swap channels for the ac3 file?
Tebasuna,
If you are reading this, your help would be much appreciated.
tebasuna51
27th August 2005, 13:51
I don't know Surcode, only ac3enc and Sonic Foundry Soft Encode and in this two encoders you need remap the wav 6 chan from (FL, FR, C, LFE, SL, SR) to (FL, C, FR, SL, SR, LFE).
To do this channel remapping you can use WaveWizard. See my post in http://forum.doom9.org/showthread.php?t=95265&page=3
In Sonic Foundry Soft Encode you can remap the channels inside them, but in Surcode ...?
Edit:
There are a wav for test the encoder order but I don't found the link now. But is easy to make one:
1) Record a mono wav (FL.wav) with your voice saying: "Front Left", "Front Right", "Center", ...
2) Copy them to FR.wav, C.wav, LFE.wav, SL.wav and SR.wav
3) Edit the 6 files and mute your voice when you don'y say the name of the wav.
4) Open the 6 wav in WaveWizard in the correct wav order (FL, FR, C, LFE, SL, SR) and make a Test.wav with 6 channels.
You can use this Test.wav with any encoder to test the correct channel order.
You can make a new Test_order_ac3.wav with WaveWizard and the preset "ac3 order ..." in channel mapping. Encode in Surcode and listen if is ok.
King_Diamond
27th August 2005, 17:04
tebasuna
I just did the test you explained without remapping the channels, that is, from wav to ac3 and surprisingly, all the channels were in the right place. Is this possible?
mic
27th August 2005, 19:07
The wav file is fine. The problem is after it is encoded. What do you mean with "dynamic compression"? If you are refering to DRC while encoding the ac3 file, I used no DRC.
Sorry for not writing more clearly...:(
Dynamic compression, especially when it's in a hardware box, evens out the volume, reducing highest levels, boosting lowest levels. I had remembered that my one player has hardware compression. Does your player have this as well, and is it adjusted to full-range?
As regards the speakers, I checked them and they are ok.
Again, apologies for thinking at the keyboard rather then thinking more about how I said it.
At large concerts or in clubs where the accoustics are poor, they have big speakers in the rear that send an out of phase signal to the stage. Think of it as an anti-sound wave. When the sound waves meet in the air, they partly cancel each other out, and this way they can control what the listener hears.
Creating 5.1 audio from 2 channel, sometimes using any sort of suround effects, & optionally while encoding to ac3, the rear channels can be phase shifted, to make them seem further away. My thought was could the sound from your rear speakers be canceling out what you hear from the front? The ac3 encoding control I have is an optional 90 degree phase shift for the suround, but if this were added to a 90 degree shift done while creating the 5.1, that could I imagine create this sort of anti or reverse sound wave.
It is kind of out-there I think as possible theories go :) and I probably wouldn't mention it except for recalling how dramatic the effect was just on 2 speakers placed either side of a monitor.
tebasuna51
27th August 2005, 21:00
tebasuna
I just did the test you explained without remapping the channels, that is, from wav to ac3 and surprisingly, all the channels were in the right place. Is this possible?
Why not?. All encoders/decoders must know the standard order of your input/output formats and make this transparent to the user.
The problem is don't be compliant with this rule, like BeSweet-azid to decode ac3 or BeSweet-ac3enc for encode (Sonic Foundry also, but is a very old soft).
The same problem occurs with Aac, the pair Faac/Faad is compliant but Nero Frontend not (need a remapping to internal aac order C, FL, FR, SL, SR, LFE). When I make a ac3 -> aac with Nero I have C <-> FL and the remainder ok (ac3 order: FL, C, FR, SL, SR, LFE).
I think is a good point for Surcode and, sorry, is not your problem with your set top player. I read this thread and think the problem is in the decoder not in the encoder. I'm not a expert in ac3 (just now a student) but this are my reasons:
- The ac3 stream generated by the encoder send, in each frame, the BSI (Bit Stream Information) and the audio data. The audio data is always in full dynamic range and, in the BSI, inform to the decoders (with other datas, i think not relevant for the problem) about the Dialog Normalization and the proper attenuation for this block/frame according the selected Dynamic Range Compression in the encoder.
- The BSI can be superseded for the decoder and apply another compression.
- If you encode with Dynamic Range Compression to None (and RF also unchecked) no data over attenuation is send in BSI, only Dialog Normalization can affect to the decoder.
- AFAIK, no data about frecuency range are send in the BSI and don't think Surcode have problem with this. (About your comment: "mid frequencies (1K-6K) are a bit too high.").
- The Dynamic Range Compression must be used if your original wav have a wide range of values ( in a movie: whisper dialog and explosion, in classic music: a flute solo and full orchestra sound, ...). For modern music I recommend set it to None and select -20 db to Dialog Normalization (remember I'm a ac3 student, not a expert, but I think with this value you remain in the most linear part of a curve imposed by an disobedient decoder).
Your problem may be like if you use, in the PC, the Ac3 filter (decoder) and check the Normalization on the fly. It begin with a gain x and when it reach a peak it down the gain and so on. I think you can search the problem in your set top decoder/player.
I can't help you more. Good luck.
King_Diamond
28th August 2005, 16:32
Sorry for not writing more clearly...:(
Dynamic compression, especially when it's in a hardware box, evens out the volume, reducing highest levels, boosting lowest levels. I had remembered that my one player has hardware compression. Does your player have this as well, and is it adjusted to full-range?
No problem mic. Thanks for your help. I didn't find this option on my hardware box.
My thought was could the sound from your rear speakers be canceling out what you hear from the front? The ac3 encoding control I have is an optional 90 degree phase shift for the suround, but if this were added to a 90 degree shift done while creating the 5.1, that could I imagine create this sort of anti or reverse sound wave.
I encoded the file using the 90 degree phase shift and without. The problem is the same in both cases however, with this option checked, the surround speakers sound nicer.
I think is a good point for Surcode and, sorry, is not your problem with your set top player. I read this thread and think the problem is in the decoder not in the encoder. I'm not a expert in ac3 (just now a student) but this are my reasons:
- The ac3 stream generated by the encoder send, in each frame, the BSI (Bit Stream Information) and the audio data. The audio data is always in full dynamic range and, in the BSI, inform to the decoders (with other datas, i think not relevant for the problem) about the Dialog Normalization and the proper attenuation for this block/frame according the selected Dynamic Range Compression in the encoder.
Thanks for you detailed reply. I tried it on 2 different decoders and the result is still the same. I left the BSI unchecked. Do you think I should check this? I am not quite sure what this does.
- The Dynamic Range Compression must be used if your original wav have a wide range of values ( in a movie: whisper dialog and explosion, in classic music: a flute solo and full orchestra sound, ...). For modern music I recommend set it to None and select -20 db to Dialog Normalization (remember I'm a ac3 student, not a expert, but I think with this value you remain in the most linear part of a curve imposed by an disobedient decoder).
I don't know if I understood this. Yes there is modern music in the file. Are you suggesting that I should set dial norm to -20db? Wouldn't that increase mid frequencies?
mic
28th August 2005, 20:35
Maybe try a stereo ac3 based on ft channels -- might indicate a [strange] prob. in the original wav or introduced by encoding to ac3 if prob. persisted -- or if it didn't, a mix prob. in player using 5.1 ac3 you created.
Winmedia audio has straight-forward 5.1 encoding, & many DVD players support wma. I don't know however how many support multi-channel wma, if at all. If it was possible, might it be easier then trying another method of ac3 creation? Just to test anyway...
Do you have on-line storage where you could post a section of wav file where prob. occurs? Maybe somebody could spot something, upload/email results of alternate ac3 conversion etc.?
tebasuna51
29th August 2005, 04:00
I tried it on 2 different decoders and the result is still the same. I left the BSI unchecked. Do you think I should check this? I am not quite sure what this does.
If uncheck the BSI any settings (Dialog Normalization, ...) in the encoder is ignored, only audio data (always in full Dynamic Range) is passed to the decoder and treated with the decoder settings.
I don't know if I understood this. Yes there is modern music in the file. Are you suggesting that I should set dial norm to -20db? Wouldn't that increase mid frequencies?
With Dial Norm -27db, and using Dinamyc Range Compression, all sounds between 0db and -7db are attenuated (independently of frequency range).
I test ac3enc and Soft Encode and don't have problems with frequency range. I don't know Surcode.
King_Diamond
29th August 2005, 14:25
@mic
I had tried 2 channel ac3 and it was fine but it was not music. Will give it a try with music.
Will try wav file on dvd player and get back to you.
Sorry, no online storage but I can email a piece if anyone is interested.
@tebasuna
Sorry, it's not the BSI that is unchecked but the Extended BSI. Still didn't figure out for what this is.
I am trying with dial norm to -20db and no DRC. Will post the result.
Btw before Surcode i tried using Soft Encode but it was frequently freezing.
King_Diamond
30th August 2005, 17:05
@ mic, tebasuna
I am happy to inform you that I finally got the result I wanted. The -20db dial norm worked perfectly. I thought that setting dial norm further away from 0db would lower mid frequencies, like vocals/dialog. It seems that I was wrong.
Thanks to both of you for your valuable help.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.