PDA

View Full Version : free ac3 encoding


dragongodz
26th December 2005, 05:07
having read through this section etc i have found references to Besweet not always producing 100% compliant ac3 streams. i have also read Headache could produce better but was not always 100% aswell. a lot of these threads are pretty old though.

so i am just wondering if anybody who can reproduce these problems has tried the latest cvs version of FFMpeg or even QuEnc 0.62 experimental(which uses a slightly older than cvs version of libavcodec) to see if they were any better.

thanks for your time.

Mug Funky
26th December 2005, 11:46
only problem i've heard of besweet having is if it is used on a flat menu, it will not play at all on some models (pioneer i think)

[edit]

btw, it'd be cool if it was possible to set stuff like DRC type, dialog normalization, RF overmodulation protection, etc. in quenc. i have no idea what defaults it is assuming when i encode with it (though the output is pretty good on the limited tests i've done).

dragongodz
27th December 2005, 01:56
having a quick look through the libavcodec source it appears it doesnt support DRC etc. just very basic ac3 encoding. still its something and free which is why i was curious if it still had the occasional problems mentioned in the past.

video_magic
28th December 2005, 01:04
I had also been wondering about AC3 being DVD compliant since I had read this from several months ago http://www.videohelp.com/forum/userguides/129419.php

So I haven't been using Besweet, but I have used Mencoder then FFMPeg instead - I don't know how compliant their AC3 are but I haven't read otherwise as far as I can recall.

dragongodz
28th December 2005, 11:52
yes the problem seems to be most posts on the problems are very old, such as 2004. since there has been a few updates to the ac3 encoder with FFMpeg i thought i would ask so those that can test if there is a problem could let us know.

m1ckran
28th December 2005, 13:21
@dragongodz

I am a complete ignoramous regarding coding dvd applications, so I have very little useful input to make. On the other hand, I have used BeSweet/BeLight in an attempt to boost the level of AC3 soundtracks and adjust the equalisation.

This is a very tricky operation involving lots of trial and error due to the introduction of audible distortions. Perhaps I'm just not very good with BeLight but I find it tricky to use (no criticism intended). Being from the UK, I believe that all commercial dvd's here use AC3 soundtracks. I've certainly never come accross anything else.

If you consider going ahead with your project, I would love to see a utility that could process AC3 files without introducing distortions, could fade-in and fade-out sections or clips, and could convert between multi-channel and stereo. A single foolproof app would be great.

I've got a feeling that it might not be viable, in which case it would be a pity. But it's good to see someone considering a new project. I'm surprised you've not received more feedback!

BigDid
28th December 2005, 22:08
The author of Belight is Kurtnoise (not dragongodz) unless I am mistaken ;)

I too have difficulties to recode ac3 to lower ac3 bitrate.

I aim for:
3/2 AC3 recode with usually 256kb bitrate
Normalisation (or dialog normalisation reduction)
Usually "normal" dynamic compression
Automatic or adjustable gain to reach or be near original volume level (average)


Belight actually misses (unless I have'nt seen it) the gain part (Besweet commandline can do it)
Ac3machine has nearly all this features except that auto find maximum gain is too low : on 3 or 4 samples it goes for 6-7db, much lower than original or normalised mp3 so I go manually for 9 to 10db.
9 to 10db is still lower than original but more than 10db is tricky: distorsion or clicks/pops are not far !

I am not good enough in audio to tune Besweet params so I would gladly see in Ac3 machine or Belight the features automatic gain+ manual gain :)

Did

Kurtnoise
29th December 2005, 05:01
I am not good enough in audio to tune Besweet params so I would gladly see in Ac3 machine or Belight the features automatic gain+ manual gain :)
For Automatic Gain, you can use HybridGain/PostGain/PreGain Presets.

For Manual Gain...you can write manually the right parameter in the command line. But I can add this feature.

m1ckran
29th December 2005, 10:37
Greetings Kurtnoise13

I hope you don't think I was being critical of your work. It's been a godsend and has let me do things I probably could not have otherwise done.

It's just that I'm not particualarly adept at the intricacies and implications of most of the programs I use. I've probably been breaking golden rules and doing things I shouldn't but that's one way to learn about the software you use.

I still find that I need to experiment with BeSweet/BeLight to get the results I want, so an idiot-proof program would help me to work quicker and more reliably.

I realise there are copyright issues involved and developers like yourself are also learning as they go along. All I can say is that I admire people like you
who release software for the benefit of us all.

Happy New Year.

:thanks:

dragongodz
29th December 2005, 11:07
it's good to see someone considering a new project.
well its not really a new project. i work on QuEnc with Nic, amazing how many people dont realise it even considering i have done a few of the releases. so really its to do with the ac3 encoding already there. to find out if there are any problems and if so exactly what etc.

I'm surprised you've not received more feedback!
yes i would have thought there may have been a little bit of interest in finding out if free ac3 encoding was ok now or still had some rare-ish problems. guess not.

tebasuna51
29th December 2005, 11:52
I'm surprised you've not received more feedback!
I'm interested, but I don't found QuEnc 0.62 (only QuEnc 0.61).
And I take ffmpeg CVS 2005-09-09 from http://www.free-codecs.com/download/ffmpegGUI.htm and is very limited.
Where are latest cvs version of FFMpeg?

Kurtnoise
29th December 2005, 16:54
If you consider going ahead with your project, I would love to see a utility that could process AC3 files without introducing distortions, could fade-in and fade-out sections or clips, and could convert between multi-channel and stereo. A single foolproof app would be great.
http://www.doom9.org/belight-advancedsettings.htm

Could be a good start for you...:)


@tebasuna : http://kurtnoise.free.fr/ffmpeg.7z (only for ac3 encoding/Decoding)

m1ckran
29th December 2005, 17:22
Thanks.
I'll check both of them them out.

BigDid
29th December 2005, 20:40
For Automatic Gain, you can use HybridGain/PostGain/PreGain Presets.
:thanks: Kurtnoise, I'am going to try that and report back when possible. I just misssed that part in the Belight settings page: http://www.doom9.org/index.html?/belight-advancedsettings.htm

For Manual Gain...you can write manually the right parameter in the command line. But I can add this feature.
Wont need it if the above works, but who knows?

Happy holidays

Did

dragongodz
30th December 2005, 02:45
I don't found QuEnc 0.62 (only QuEnc 0.61).
0.62 experimental - http://nic.dnsalias.com/QuEnc_PrettyExperimental.zip

BigDid
30th December 2005, 05:52
Some tests for 1 ac3file extrated from a vob, it seems:

-Ac3 machine uses the -g max command for the auto find max gain (8.2db)

Belight
-No -ota just normalisation gives 8.035db
With dynamic compression normal+ dialog normalisation+ normalise to 98%:
-Pregain gives 8.386 for besweet and -0.175 for azid, sum= 8.211db
-Postgain gives 0.175 for besweet and total 8.035db for azid
-Hybridgain gives total 8.035db for azid

Can't get the --maximize command to work
Info:The AGK audio normalization commandline for mp3 output gives 17.7db !!
So with an avi file having 1mp3 original audio(from agk)+ 1ac3 audio the relative volume difference is 8.5db between the 2 audio files

@Kurtnoise: Please consider implementing a manual gain command in Belight

Did

dragongodz
30th December 2005, 14:27
can discussion about using Belight please be done in its own thread ?

i started this one in regards to FFMpeg and QuEnc(which uses avcodec from FFMpeg).

tebasuna51
30th December 2005, 19:36
@dragongodz
I agree with your comment, but I include Beligth here to compare like encoder.

I make a test with 4 free ac3 encoders:

ffmpeg (the version from Kurtnoise post)
QuEnc 0.62 (your link)
BeLigth (last beta version)
HeadAC3he v0.24-a13

The ac3 header (and other info) is always:
SampleRate 0 : 48000 KHz.
BitRate 15 : 448 Kb/s. (384 with QuEnc62)
Version (bsid) 8 : Estandar.
Bit Stream mode (bsmod) 0 : main audio service: complete main (CM)
Audio coding mode (acmod) 7 : 3/2 - L, C, R, SL, SR
Center Mix Level 1 : 0.595 (-4.5 dB)
Surround Mix Level 1 : 0.500 (-6 dB)
Low Frequency Effects channel 1 : Present
Dialogue normalization - 31 dB
CopyRight bit 0
Original bit 1
Block switch flags 0
Dither flags 31
RF Overmod. Protec. 0 : Not present
Dynamic Range gain 0 : Not present
-----------------------------------------------
FileLength : 1120000 bytes. (956928 with QuEnc62)
Frames : 625 (623 with QuEnc62)
Duration : 20 seconds (19.936 with QuEnc62)
1) QuEnc62 lose 2 frames (64 ms. short) and max bitrate allowed 384.

2) Common comments:
- Center Mix Level and Surround Mix Level don't match with the default recommended by Dolby 0.707 (-3 dB)
- Dialogue normalization don't match with the recommended by Dolby (between -27 dB for Action Film and -15 dB for Music)
- Don't exist info about Dynamic Range gain

3) Settings:
- The only allowed parameter is BitRate (except HeadAC3he). For QuEnc max 384.
- In HeadAC3he there are also DRC (without effect), Low pass filter for surround (?), and Global Gain (see the next point).

4) Output volume level:
- There is a common problem (maybe from original libraries), the max output level is always -6 dB (50%).
- Only HeadAC3he can solve this problem. From a input with max volume level 0 dB (100% normalized), and setting Global Gain to 6 dB, I obtain a max output level -0.05 dB (99%).

Conclusions:
- There are not control about important parameters (DialNorm, DRC, Mix levels, ...) and the decoders can't use BSI info to decode the stream.
- HeadAC3he with Global Gain 6 dB is, by the moment, my choice. The other three encoders are equivalents.

BigDid
30th December 2005, 19:56
can discussion about using Belight please be done in its own thread ?...
You are right, thank you for your patience, I will do that.

@tebasuna51
I did'nt talk about headac3he because I think it changed the channel mapping so at the moment my choice is still ac3machine with manual gain

Did

tebasuna51
30th December 2005, 20:36
@BigDid
All encoders need the same channel remapping FL-C-FR-SL-SR-LFE, only Belight make this remapping auto because the bsn.dll, ac3enc.dll used with WaveWizard need the remapping.

For QuEnc I use a GetChannel(1,3,2,5,6,4) inside the .avs input.
For ffmpeg or HeadAC3he you can use WaveWizard to remap the wav channels with the preset 'ac3 order for SoftEncode or ac3enc'.
If you use ffmpeg with the new BeHappy a GetChannel(1,3,2,5,6,4) is auto used.

dragongodz
31st December 2005, 07:04
tebasuna51 - thank you for your tests. i will have to have a look at what can be done about some of the issues you raised.

can anybody who has had ac3 encoding cause problems, such as on pioneer players, in the past also test to see if the same problems are still there for them aswell ?

dragongodz
8th May 2006, 02:06
ok new QuEnc released incase anyone missed it and was interested in testing the ac3 encoding changes.

the mix levels and dialnorm should be as reccomended now and the low volume fixed.

http://forum.doom9.org/showthread.php?t=110888

tebasuna51
10th May 2006, 04:01
the mix levels and dialnorm should be as reccomended now and the low volume fixed.
Nice!.

Only one question about bitrate list:
448 recommended for ac3 5.1
32, 48, ... unusable even for mp2

Thanks.

dragongodz
10th May 2006, 13:20
Only one question about bitrate list:
yes i will do some more with audio next version aswell. if you look at the 0.70 changelog though you will see there was quite a lot done in other areas aswell. so ye 1 step at a time. :)

danpos
10th May 2006, 23:54
@tebasuna51

I did download the most new ffmpegGUI and did a trascode from a WAV PCM (previously processed with another tool in order to normalize it) to AC3 using:

AC3 audio stream - encoded with ffmpegGUI 0.3c (http://rapidshare.de/files/20140932/audio_sample-ffmpegGUI.ac3.html) .

AC3 audio stream - encoded with QuEnc 0.7 (http://www.megaupload.com/pt/?d=ZPF2BPR4) .

Could you compare these 2 audio streams encoded with the different tools ? For my ears the audio output by the QuEnc seems better than the audio output by the ffmpegGUI.

TIA,

tebasuna51
11th May 2006, 03:20
Could you compare these 2 audio streams encoded with the different tools ? For my ears the audio output by the QuEnc seems better than the audio output by the ffmpegGUI.
Really your samples are quite different.
Decoding with azid QuEnc.ac3, I get 1440 overflows with a max at +4dB, decoding ffmpeg.ac3 I get a max value at -2dB.

Then QuEnc.ac3 is 6dB more loud than ffmpeg.ac3 but distorted for the clipping.

But, I can't reproduce your test. I use the decoded wav from ffmpeg.ac3 normalized 100%, and I make a new reencode with QuEnc 0.7 and ffmpeg.exe CVS_2006-04-28.

Now my quenc.ac3 only have one overflow (0.5dB) and ffmpeg.ac3 is at 0dB.

About the quality...you can't expect too much with 128 Kb/s ac3.

danpos
11th May 2006, 06:29
@tebasuna51

THX for yours tests. :)

Cheers,

killerhex
14th May 2006, 07:03
does ac3 have a shell extension like mkv and other format to tell the info about the audio file like i encode a mp3 into ac3 but it doesnt have an id tag

Kurtnoise
14th May 2006, 07:09
MQM (http://www.burrrn.net/?page_id=5) ?

raquete
14th May 2006, 07:32
MQM (http://www.burrrn.net/?page_id=5) ?
Kurt,it's wonderful,thank you!
:thanks:

dragongodz
14th May 2006, 07:37
ac3tool can also give you information

http://www.videohelp.com/tools?tool=AC3Tool

raquete
14th May 2006, 07:44
thank you too dragongodz!

:-)

raquete
17th May 2006, 05:18
dragongodz,
as i can't find any guide and the readme inside the ac3tool don't have explanations about the parameters and details of the results,can you tell me what means each line from the AC3 analysis? (of course,some are obvious)

Bitrate: 576Kbit (48k)
Mode: complete main (CM)
Audio Mode: 3/2 L,C,R,SL,SR+LFE
Center mix level: -4.5dB
Surround mix level: -6.0dB
Dialogue level: -31dB
Stream: original stream
.............
[00:03:21.472] E2: In-file error: EOF

thanks!