Is this possible without losing any quality ? Or is there a way to extract the wavs out of an 6 Channel AAC
+ Reply to Thread
Results 1 to 19 of 19
Last edited by TheRandomOne; 23rd Jun 2017 at 07:55.
aac is already a highly compressed format and you've already lost most quality in the conversion to it. if you convert to ac3 with a similar or higher bitrate there will be minimal addition quality lost. probably not anything you would hear comparing the 2.--
"a lot of people are better dead" - prisoner KSC2-303
So how can I get the 6 channel wavs ?
ffmpeg -i "input.aac" -c:a ac3 -b:a 640k "output.ac3"
ffmpeg -i "input.aac" "output.wav"
ffmpeg -i "input.aac" -filter_complex "channelsplit=channel_layout=5.1[FL][FR][FC][LFE][BL][BR]" -map "[FL]" front_left.wav -map "[FR]" front_right.wav -map "[FC]" front_center.wav -map "[LFE]" lfe.wav -map "[BL]" back_left.wav -map "[BR]" back_right.wav
No gui program can do it ? Im no good with command lines
Thanks so now I have 6 wavs from the John Wick Blu-Rays (Both Movies) so now Im wondering is there anyway to make music quieter ? Like in the club scene in the first one horrible with how loud the music is in that & other scenes
ffmpeg has an audio compressor called LoudNorm. There's a GUI for it here. Normally you'd give it a single multichannel file that it'd compress and output as a single multichannel wave file. The default settings should work reasonably well. It accepts the following input file types:
aac, aiff, flac, m4a, mp2, mp3, mp4, ogg, wav, wma
I don't know why, as ffmpeg can convert to most of the common audio formats, but for some reason the GUI will only output wave or MP3. I assume if the output is MP3 it'll automatically downmix to stereo.
You should be able to use WinLoud to compress your AAC audio and convert to a multichannel wave file though, then you could convert the wave file to ac3 with another audio converter.
Audacity, normalize and save them as combined 6 channel AC3. I don't know in which order/sequence to load them in audacity. Could anyone tell me the order?
The standard wave file channel order is FL, FR, C, LFE, SL, SR, but it's easier to import the original AAC directly. Audacity probably won't do it "out of the box" but it can if it's using ffmpeg for decoding. It's extremely anal about the version of ffmpeg you use, so you have to follow the instructions here.
Once it's done Audacity can import the AAC file directly. It'll be converted to 32 bit PCM and it'll appear as 6 individual wave files in the order I previously mentioned.
I don't use Audacity much but I think it's normalising (assuming you mean peak normalising) works on each channel individually. It'll increase each track until their peaks are at maximum, which will very likely mess up the balance between front and surround etc. It's probably better to increase the volume of each track by the same amount. You can do that by selecting all tracks (select one, then Ctrl+A) and using the Amplify function. It'll automatically default to the maximum amplification for the loudest track without clipping. Click okay, and it'll amplify all the tracks by that amount, keeping their relative volumes the same.
To export as AC3 you need ffmpeg as you do for importing. In preferences, there's an option under Export to "use custom mix". That has to be selected otherwise you can only export to stereo. When it's selected, you're given a chance to re-arrange the channel order just before saving the exported file. If you import the AAC directly or use the channel order I mentioned for your individual wave files, you can just export to AC3 "as is".
Last edited by hello_hello; 27th Jun 2017 at 01:25.
@ hello_hello - Thank you. Nowadays audio of almost all movies are to highest volume and they are clipped. I used to separate the audio as the wave, load them into FFmpeg enabled Audacity and Normalize maximum amplitude to minus 0.2 dB. When I open the audio file, all the clipped portions would be shown in red. After normalizing, I will save the audio to the desired format.
I just realised I made a mistake when I wrote the order in my post above. I did it like this:
C, FR, FC, LFE, SL, SR
I guess I wasn't thinking because there's two centre channels. It should be:
FL, FR, C, LFE, SL, SR
I've corrected my previous post.
Lossy codecs might have peaks at maximum, or even a little above maximum (as they can store peaks above 0dB), or when they're decoded the peaks might end up a little above maximum and therefore they'll be clipped if they're decoded as normal PCM waves, as PCM can't contain peaks above 0dB or maximum, but it doesn't necessarily mean the peaks are necessarily "clipped" while still in lossy format.
If you export lossy multichannel audio to standard 16/24 bit wave files, that's when the peaks might get clipped.
If you import the multichannel audio directly into Audacity with ffmpeg, it should be imported as 32 bit float, and while I don't use Audacity much myself, that should mean the peaks can be above 0dB without being "clipped".
I don't know how Audacity's clipping detection works. Whether it just looks for peaks above zero or it checks for "flattened" peaks, but if you import without converting to wave first and normalise to a little below 0dB, then export, the process shouldn't "clip" the peaks. If there's already clipped peaks... ie if they were clipped before being converted to AC3 etc, that's of course out of your control.
As a general rule, if you import the 5.1ch audio into Audacity as a single file you don't have to worry about channel order. The wave file channel order is how I described (now I've correct it):
FL, FR, C, LFE, SL, SR
For AC3 it's:
FL, C, FR, SL, SR, LFE
And for DTS and AAC it's:
C, FL, FR, SL, SR, LFE
But when you import/decode multichannel AC3 or AAC etc, it's always remapped to the wave file channel order on a PC, so that's how it'll appear in Audacity. When you export as AC3 or AAC etc, it's remapped to the appropriate order by the encoder.
If you use a program to extract individual wave files it might just extract them in the order they're stored in the file and you'll have to re-arrange them, but if you import and export as a multichannel file you shouldn't need to think about it.
loudnorm without it.
The single-pass mode worked well, but as for the dual-pass mode, after using the measurement command, I have no idea where is the location of the loudness stats.
Also, what command should I use to run this script?
It looks like Ruby but I know nothing about it or what you'd need to run it. Someone else might.
I'm far from an ffmpeg expert, but after a bit of messing around I found following command line works. Edit it to suit your file names and locations (obviously), save it as a .bat file and the measurements will be displayed in the command prompt window when it's done (sorry about the code tags but it stops the forum tuning some of the command line into smilies).
"C:\Program Files\encoders\ffmpeg.exe" -i "E:\noisy.mp3" -af loudnorm=I=-16:TP=-1.5:LRA=11:print_format=summary -f null - PAUSE
"C:\Program Files\encoders\ffmpeg.exe" -report -i "E:\noisy.mp3" -af loudnorm=I=-16:TP=-1.5:LRA=11:print_format=summary -f null - PAUSE
I don't understand the LoudNorm options fully yet as I've really only messed with it a little for testing. I did discover print_format=json looks like this:
"input_i" : "-18.44", "input_tp" : "-7.80", "input_lra" : "5.20", "input_thresh" : "-28.51", "output_i" : "-14.70", "output_tp" : "-1.50", "output_lra" : "3.00", "output_thresh" : "-24.74", "normalization_type" : "dynamic", "target_offset" : "-1.30"
Input Integrated: -18.4 LUFS Input True Peak: -7.8 dBTP Input LRA: 5.2 LU Input Threshold: -28.5 LUFS Output Integrated: -14.7 LUFS Output True Peak: -1.5 dBTP Output LRA: 3.0 LU Output Threshold: -24.7 LUFS Normalization Type: Dynamic Target Offset: -1.3 LU
Loudnorm is quite an impressive filter. There is one thing that bugs me about it, though: after setting LRA to 1, I got an output of 9, which is not very accurate.
EDIT: The author mentions this problem here (final notes), he says that it should be accurate after sufficient integration time. Pardon my ignorance, but what does he mean?
Last edited by rowjekto; 4th Jul 2017 at 07:03.
I had to look up the spec to find out what LRA means. Loudness Range, apparently. I don't know why it's not just LR, but anyway, if it's the range of volume variation throughout the audio, as I understand it an LRA of one would probably be impossible or sound like crap if it wasn't.
I looked at the track I scanned yesterday (now I know what LRA means). It was a hard rock song, fairly compressed, and it still has an LRA of three. The vague description here:
"LRA: Loudness range. Describes the variation of loudness levels within a program on a macroscopic scale. Not to be confused with
“dynamic range”, which is the distance between the noise floor and the highest possible peak of a signal path. It is based on statistics and
uses the 3-second-short-term loudness levels."
To my way of thinking an LRA of one would mean if two people were talking and there were some birds chirping faintly in the background, during any decent break in the conversation the bird chirping would have to be the same volume as the speech. That's the impression I get anyway...
I don't fully understand why LoudNorm needs two passes to do a better job (although admittedly I haven't tried two passes), and for a single pass it doesn't seem to be very exact at achieving the specified target volume. The foobar200 R128 compressor DSP has no settings to adjust, you add it to the conversion chain and go, but the output is rarely much off -18 LUFS. LoudNorm is also quite slow.
I found when I did some testing, the EBU R128 scanning compression methods could be a bit slow to respond. According to this:
"The EBU R128 loudness standard gives us our integrated loudness definition: The measurement input to which the gating threshold is applied is the loudness of the 400 ms blocks with a constant overlap between consecutive gating blocks of 75%. The loudnorm AGC uses this definition to calculate an appropriate correction envelope."
The window size and overlap appear to be set in stone, whereas for some normalisers you can adjust it, and that seems to be where some of the fun is, although I'm hardly an expert. Compressing audio is definitely an art of juggling compromises though.
I made a few samples from a source I used for testing a while ago as it was handy (see the attachments). The uncompressed source was already at -18 LUFS. I ran it through the various compressors while converting to wave each time, scanned the wave files, saved the volume info, then converted to AAC while adjusting each to -18 LUFS. After all that I scanned the AAC files.
Assuming the ReplayGain scan is correct (R128 algorithm) and they're the same over-all volume, it's interesting to look at the peak differences. Maybe it's just where the audio "frames" fell in relation to the volume changes, but the foobar2000 R128 compressor effectively amplified the first gun shot relative to the source even though it squished the rest of them. I'm pretty sure LoudNorm did something similar when I first tested it with a different sample (single pass). The difference in peaks for the Dynamic Audio Normaliser samples is due to reducing the window/frame size. I didn't alter the amplification. The first few seconds of each sample shows various levels of volume pumping where the background noise is amplified. It's hard to win, but if you do find the magic settings, please let me know.
I generally use the Dynamic Audio Normaliser with a smaller frame size than the default (-f 150 or less), or a WnAmp DSP to compress on playback with similar settings, courtesy of ffdshow. For those two you can adjust the amount of amplification (they both work by amplifying the quieter parts rather than compressing anything). My personal preference is to have them react very quickly to volume changes, but not to adjust the volume too much because I dislike any audible "volume pumping", so there's still some dynamic range, but not enough that I need to be adjusting the volume all the time at night while everyone else is asleep.
Edit: There's also another "compressor" called LoudMax you might want to try. It works much the same as RockSteady or the Dynamic Audio Normalizer, although the only GUI control is a threshold level. I use the VST version via a foobar2000 plugin for running VST DSPs. It can compress pretty hard without sounding unnatural. The only thing I've found odd about it (and I've not used it a lot) is after compressing and then normalising to -18 LUFS as I did with the samples below, the LoudMax version always seems to sound a bit quieter over-all. I'm not sure why. Maybe my ears are wrong.
Last edited by hello_hello; 5th Jul 2017 at 08:59. Reason: spelling