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 > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th August 2011, 00:02   #401  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
After the HydrogenAudio listening test determined that fhgaac was superior to Nero AAC I decided to do some tests:

1. Speed is pretty much the same. FHGAAC is a tad slower than Nero (17 min vs. 16 min), but this is hardly significant.

2. Since FHG does not support ABR (and CBR is not really desirable), quality mode looks like the optimal mode to do a comparison. But this is not so easy:

Nero has a quality scale from 0.00 to 1.00. FHG uses VBR presets in the range of 1 to 5. LameXP only has a slider for the Nero style quality settings, so it somehow maps the Nero settings to the FHG settings.

In my first test I used a quality setting of 0.30 (which roughly corresponds to an average bitrate of 96 kbp/s). For Nero I got a file size of 67.2 MB, for FHG the file was much smaller (49.1 MB). The 0.30 quality setting was mapped to FHG VBR 2.

The next encode with FHG was done with a quality setting of 0.40 which corresponded to a FHG setting of VBR 3. This time the file size was almost identical to the encode done with Nero using a quality setting of 0.30.


I do not have the means to test the quality of the encoded files, my audio hardware is just too shabby. All encoded files sounded pretty much identical to me. But it looks like the mapping of the Nero quality settings to the FHG settings is not perfect yet.


Another hint:
If you want to use the FHG encoder but you do not care for WinAmp, you can extract the necessary files from the installer executable without actually installing WinAmp. Download the WinAmp installer, open it with 7zip and extract the required files.


Cheers
manolito
manolito is offline   Reply With Quote
Old 30th August 2011, 00:55   #402  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by manolito View Post
Nero has a quality scale from 0.00 to 1.00. FHG uses VBR presets in the range of 1 to 5. LameXP only has a slider for the Nero style quality settings, so it somehow maps the Nero settings to the FHG settings. But it looks like the mapping of the Nero quality settings to the FHG settings is not perfect yet.
I am using a mapping that will map 0.00 to 1 and 1.00 to 5. The values between 0.00 and 1.00 are mapped to values between 1 and 5 in a linear fashion.

As the quality parameter of the FHG encoder only accepts integers, the values have to be rounded. That makes the mapping kind of coarse-grained...

Quote:
Originally Posted by manolito View Post
If you want to use the FHG encoder but you do not care for WinAmp, you can extract the necessary files from the installer executable without actually installing WinAmp. Download the WinAmp installer, open it with 7zip and extract the required files.
I know. But I don't think it would be very "fair" to tell people to extract the encoder plugin without actually installing Winamp
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 30th August 2011, 23:23   #403  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Bug normalizing multichannel wav files

While testing the fhgaac encoder I stumbled upon a severe bug which probably has been there for quite a while:

After converting a 6-ch AC3 to a 6-ch AAC I noticed that the volume of the encoded file was way lower than the volume of the original AC3. Then I did the same encode using Nero, but the volume was still way too low. So I figured that this was a AAC issue, and I thought I might get better results using LameXP's normalize feature.

But it turned out that this approach did not work at all. SoX seemed to do its thing normally, but afterwards the encode stopped immediately. No matter if Nero or FHG was chosen as the encoder. Looks like the SoX output is not usable for ther AAC encoders. Here is the log:
Quote:
LameXP v4.03 (Build #676), compiled on 2011-08-27 at 16:14:23

-------------------------------

E:/DOKUME~1/Achim/LOKALE~1/Temp/1ca6b065a50346d48d45cb45e7cb39e8/tool_valdec.exe I:\test.ac3 -w I:\\bc36e19738db4fdf932efd5a9a240637.wav

Opening audio output PCM16 3/2.1 (5.1) 48000...
---------------------------------------
Frames/errors: 166277/0
System time: 766202ms
Process time: 582247ms
Approx. 10.94% realtime CPU usage

Exited with code: 0x0000

-------------------------------

E:/DOKUME~1/Achim/LOKALE~1/Temp/1ca6b065a50346d48d45cb45e7cb39e8/tool_sox.exe -V3 -S --temp . I:\\bc36e19738db4fdf932efd5a9a240637.wav I:\\6b54e1c909f1409da8eab7f2ef915619.wav gain -n -0.50

E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe: SoX v14.3.2
E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe INFO formats: detected file format type `wav'
E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe INFO wav: EXTENSIBLE
Input File : 'I:\\bc36e19738db4fdf932efd5a9a240637.wav'
Channels : 6
Sample Rate : 48000
Precision : 16-bit
Duration : 01:28:40.45 = 255381504 samples ~ 399034 CDDA sectors
File Size : 42949672.19G
Bit Rate : 42949672.842949672.19G
Sample Encoding: 16-bit Signed Integer PCM
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe INFO sox: Overwriting `I:\\6b54e1c909f1409da8eab7f2ef915619.wav'
Output File : 'I:\\6b54e1c909f1409da8eab7f2ef915619.wav'
Channels : 6
Sample Rate : 48000
Precision : 16-bit
Duration : 01:28:40.45 = 255381504 samples ~ 399034 CDDA sectors
Sample Encoding: 16-bit Signed Integer PCM
Endian Type : little
Reverse Nibbles: no
Reverse Bits : no
Comment : 'Processed by SoX'
E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe INFO sox: effects chain: input 48000Hz 6 channels
E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe INFO sox: effects chain: gain 48000Hz 6 channels
E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe INFO sox: effects chain: dither 48000Hz 6 channels
E:\DOKUME~1\Achim\LOKALE~1\Temp\1ca6b065a50346d48d45cb45e7cb39e8\tool_sox.exe INFO sox: effects chain: output 48000Hz 6 channels
Done.

Exited with code: 0x0000

-------------------------------

E:/Programme/LameXP/fhgaacenc.exe --vbr 3 --dll E:/Programme/LameXP/enc_fhgaac.dll I:\\6b54e1c909f1409da8eab7f2ef915619.wav I:\\test.mp4

fhgaacenc version 20110822 by tmkk
E:\Programme\LameXP\enc_fhgaac.dll

Exited with code: 0x0000
The log does not indicate any problems, but the resulting AAC file had a length of 64 ms. Using the Nero AAC encoder made no difference, so I tend to assume that SoX cannot normalize multichannel WAV files. What do you think?


Cheers
manolito
manolito is offline   Reply With Quote
Old 30th August 2011, 23:37   #404  |  Link
mike20021969
Registered User
 
Join Date: Jul 2007
Location: UK
Posts: 336
Quote:
Originally Posted by manolito View Post
Another hint:
If you want to use the FHG encoder but you do not care for WinAmp, you can extract the necessary files from the installer executable without actually installing WinAmp. Download the WinAmp installer, open it with 7zip and extract the required files.
I download Winamp from winamp.com. I extracted all the files with 7Zip, I couldn't find anything with an FHG reference. The were lots of folders and dll's. What is the file name to search/look for?
mike20021969 is offline   Reply With Quote
Old 30th August 2011, 23:48   #405  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by mike20021969 View Post
I download Winamp from winamp.com. I extracted all the files with 7Zip, I couldn't find anything with an FHG reference. The were lots of folders and dll's. What is the file name to search/look for?
Please follow the instructions included with the 'FHG AAC Encoder Add-in' package:
http://lamexp.git.sourceforge.net/gi...=HEAD#71a113b0

@manolito
The reason why the audio converted from the AC-3 source appears to have a lower volume is because AC-3 has much bigger dynamic range.
Also I can confirm that there is a problem with the normalization filter. It's not only the AAC encoder. The same issue occurs with OggEnc, for example.
I will have to investigate what is going wrong here. But I will be away for the next few days, so please be patient...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 30th August 2011 at 23:51.
LoRd_MuldeR is offline   Reply With Quote
Old 3rd September 2011, 22:37   #406  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
err.. adding concentric folders still don't work?
Motenai Yoda is offline   Reply With Quote
Old 4th September 2011, 22:52   #407  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Am I supposed to know what a "concentric" folder is?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 4th September 2011, 23:40   #408  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
RE normalization filter:

This has nothing to do with the decoder or encoder which LameXP uses. It is solely a SoX issue. And the problem was already present in V. 4.02 final.

For a test just try to convert a 6ch WAV (does not matter if it is in the Extensible Format or not) to a normalized 6ch WAV. Fails...


Cheers
manolito
manolito is offline   Reply With Quote
Old 4th September 2011, 23:42   #409  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by manolito View Post
RE normalization filter:

This has nothing to do with the decoder or encoder which LameXP uses. It is solely a SoX issue. And the problem was already present in V. 4.02 final.

For a test just try to convert a 6ch WAV (does not matter if it is in the Extensible Format or not) to a normalized 6ch WAV. Fails...


Cheers
manolito


Can this be reproduced with the "official" SoX binaries for Win32?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 5th September 2011, 02:12   #410  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
Quote:
Originally Posted by LoRd_MuldeR View Post
Am I supposed to know what a "concentric" folder is?
in a simple way "one inside another" but I think "recursive" can best be understood by a dev.

ie
a folder "Micky Maus"
a folder "Goofy" into "Micky Maus"
an mp3 into "Goofy"

re normalization filter
there is an WaveGain(S) too
Quote:
This is a special version of WaveGain that is designed to be used to apply ReplayGain to
a number of mono wave files that comprise the individual channels within a multi-channel
audio stream. For example, the 6 mono wave files that would comprise a 5.1 audio stream.

Processing regards the mono wave files as an album, but applies the gain that was computed
for the single loudest track to all of the tracks, There is a command line option, '-m',
that will cause the program to pause following the analysis phase to allow the user to
enter a dB adjustment that will be added to the value computed by the ReplayGain algorithm.
It is the user's responsibility to ensure that clipping will not result from the value
entered.

You may find other uses for this version. Input is not limited to mono files, but the style of processing will necessarily limit where it may be appropriate to use this.
edit: when "save output files to the same location where the input file is located" but "prepend relative source file path to output file" is still checked (even if greyed), it works right?

Last edited by Motenai Yoda; 5th September 2011 at 02:45.
Motenai Yoda is offline   Reply With Quote
Old 5th September 2011, 02:55   #411  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by Motenai Yoda View Post
in a simple way "one inside another" but I think "recursive" can best be understood by a dev.
There is an option to add a folder in a recursive way. So what exactly is the problem?

(Seems to work as expected for me)

Quote:
Originally Posted by Motenai Yoda View Post
when "save output files to the same location where the input file is located" but "prepend relative source file path to output file" is still checked (even if greyed), it works right?
The "prepend relative source file path to output file" option does not apply, if "save output files to the same location where the input file is located" is enabled.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 5th September 2011 at 11:14.
LoRd_MuldeR is offline   Reply With Quote
Old 5th September 2011, 13:46   #412  |  Link
Motenai Yoda
Registered User
 
Motenai Yoda's Avatar
 
Join Date: Jan 2010
Posts: 709
1- ok but I would expect it was the default method for drag'n'drop
2- look http://www.youtube.com/watch?v=MwyXFIObdug

Last edited by Motenai Yoda; 5th September 2011 at 13:48.
Motenai Yoda is offline   Reply With Quote
Old 5th September 2011, 14:09   #413  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by Motenai Yoda View Post
ok but I would expect it was the default method for drag'n'drop
Nope, when folders are added via drag&drop it is not done in a recursive way by default.

It's implemented that way, because adding a folder recursively might add a HUGE number files which can take a very long time.

Maybe the default behavior can be changed in a way that will trigger "recursive" mode when a folder that only contains sub-folders (but no files) is dropped.

(I want to avoid adding yet another option for this)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 5th September 2011, 15:13   #414  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by LoRd_MuldeR View Post


Can this be reproduced with the "official" SoX binaries for Win32?
Unfortunately yes...

I tried with the current version of SoX (14.3.2), but it behaves exactly the same as the built-in version.


Cheers
manolito
manolito is offline   Reply With Quote
Old 5th September 2011, 15:26   #415  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Thx for the info. At least it's not a build issue then
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 5th September 2011, 18:13   #416  |  Link
b66pak
Registered User
 
b66pak's Avatar
 
Join Date: Aug 2008
Location: The Land Of Dracula (Romania - EU)
Posts: 934
also broken with 14.3.1 or 14.3.0...
_
__________________
if you ask a question and somebody give you the correct answer don't forget to leave a "thank you" note...
Visit The Land Of Dracula (Romania - EU)!
b66pak is offline   Reply With Quote
Old 5th September 2011, 22:32   #417  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
This evening I did some more tests: SoX' gain filter doesn't fail with all multi-channel sources. And it only fails on some when the "-n" option is used

Anyway, if I also add the "-e" or "-b" option that seems to fix the issue. At least for my samples that failed before. Consequently LameXP will now use "-ne" instead of "-n" only.

Hopefully it works with your sample too. A new build is available via auto-update...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 5th September 2011 at 22:37.
LoRd_MuldeR is offline   Reply With Quote
Old 5th September 2011, 23:39   #418  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Yes, this fixes it...

It adds a little to the encoding time, but I could not break it using all kinds of multichannel input files.

I still find it hard to explain why omitting the -e or -b option causes SoX to completely screw up the conversion. Strange...


Anyway, it works now, thanks again.


Cheers
manolito
manolito is offline   Reply With Quote
Old 6th September 2011, 20:30   #419  |  Link
b66pak
Registered User
 
b66pak's Avatar
 
Join Date: Aug 2008
Location: The Land Of Dracula (Romania - EU)
Posts: 934
Quote:
Originally Posted by LoRd_MuldeR View Post
This evening I did some more tests: SoX' gain filter doesn't fail with all multi-channel sources. And it only fails on some when the "-n" option is used

Anyway, if I also add the "-e" or "-b" option that seems to fix the issue. At least for my samples that failed before. Consequently LameXP will now use "-ne" instead of "-n" only.

Hopefully it works with your sample too. A new build is available via auto-update...
this have to be a temporary solution! because -ne is not even close to -n...

-ne will rise the loudness of the central channel if its peak is lower than the side channels or will rise the loudness of the side channels if its peaks is lower than the central channel...

in other words the some level of DRC will be applied...
_
__________________
if you ask a question and somebody give you the correct answer don't forget to leave a "thank you" note...
Visit The Land Of Dracula (Romania - EU)!
b66pak is offline   Reply With Quote
Old 6th September 2011, 21:04   #420  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by b66pak View Post
this have to be a temporary solution!
As I am not a SoX developer, this is not in my hands, unfortunately.

(And nope, I'm not currently planning to add yet another tool to LameXP for normalization)

Quote:
Originally Posted by b66pak View Post
because -ne is not even close to -n...

-ne will rise the loudness of the central channel if its peak is lower than the side channels or will rise the loudness of the side channels if its peaks is lower than the central channel...
I am aware that "-ne" works slightly different.

Anyway, generally I would assume that all channels had been recorded at the same levels. And if not, that's probably unintentionally.

So their peaks should be at the same volume too!

A channel would only be "amplified" more than the others, if there is not a single peak in that channel for the whole duration of the audio...

Quote:
Originally Posted by b66pak View Post
in other words the some level of DRC will be applied...
Might be applied.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 6th September 2011 at 21:59.
LoRd_MuldeR is offline   Reply With Quote
Reply

Tags
aac, aotuv, flac, lame, lamexp, mp3, mp4, ogg, oggenc, opus, vorbis

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 09:31.


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