VideoHelp Forum
+ Reply to Thread
Results 1 to 29 of 29
Thread
  1. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    I understand it is unlikely I can do it in one step. But if I can select/load a number of AVI files, demux into a foilder, use Audacity to normalise the audio. I am then happy to use mkvmerge to remux them all again.

    Must work with Windows 7.
    Quote Quote  
  2. Vdub in batch mode can demux the files. Check this nice guide.

    I should add you will have to open them individually to get the audio delay. Check this guide for that (BTW, this is a better procedure if your AVI's have MP3 audio). In the stream list, right click the entry to get the details.
    Last edited by nic2k4; 18th Jul 2014 at 11:15.
    Quote Quote  
  3. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    Thanks. I'll have a look. Quite a bit of reading to do.
    Quote Quote  
  4. If you're going to end up with MKV..... maybe remux the AVIs as MKVs first, then use MKVCleaver to extract the audio (because it'll batch extract). When remuxing, you'll need to check the original MKVs for any audio delay with MediaInfo.

    Or you can extract the audio from MKVs with gMKVExtractGUI and it'll write any audio delay to the file name of the extracted audio, but it doesn't batch extract.

    And after typing all that, I remembered this: https://forum.videohelp.com/threads/255147-Mini-Guide-Normalizing-Audio-for-Multiple-AVI-files
    Quote Quote  
  5. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    Mmm. Remuxing to MKV makes sense - one can do so much more with an MKV.

    Gave it a test drive. Found I had to convert h264 to AVI with mkvCleaver otherwise no time-code in the video.
    With my current set of files I use an audio converter to convert the AC3s to MP3, for Audacity to work with. (There is not a lot of software for editing AC3!)
    As for the thread-link, that system amplifies the audio by a fixed amount, rather than normalising it. Not the same thing at all.

    Anyway, this is what I now do:
    MediaInfo: Check for audio delay
    mkvCleaver: Remux to MKV (Convert h264 to AVI)
    Free Audio Converter: Convert AC3s to MP3
    Audacity: Apply Chains (Normalise)
    MKVMegerGUI: Mux AVI and "cleaned" MP3 to final MKV, applying original audio delay

    Works perfectly, thanks.
    Quote Quote  
  6. Originally Posted by NDMMackay View Post
    Gave it a test drive. Found I had to convert h264 to AVI with mkvCleaver otherwise no time-code in the video.
    Maybe I'm not following your process, but it sounds like you're extracting the video. If so, there's no need. You can work with the audio only and remux the new version, replacing the old, by opening the original AVI/MKV with MKVMergeGUI (along with the new audio). Or if you want to keep the files as AVIs, you can replace the audio with VirtualDub/VirtualDubMod.

    Originally Posted by NDMMackay View Post
    With my current set of files I use an audio converter to convert the AC3s to MP3, for Audacity to work with. (There is not a lot of software for editing AC3!)
    Doesn't Audacity import/export audio as wave or re-encode it to output MP3? If so, you'll be re-encoding it twice. If you want to use Audacity, it'd be better to convert the AC3 to a wave file.
    Alternatively, you could convert the AC3 to MP3 and adjust it with MP3Gain. If you don't want to apply ReplayGain, MP3Gain has a traditional normalising function (it needs to be enabled in it's settings). It can adjust MP3 volume losslessly (no re-encoding). Alternatively you can open MP3s with MP3DirectCut. It'll normalise MP3s the traditional way, also losslessly. And the process would be much faster than importing an MP3 into Audacity and exporting it.

    Originally Posted by NDMMackay View Post
    As for the thread-link, that system amplifies the audio by a fixed amount, rather than normalising it. Not the same thing at all.
    No it doesn't.
    Normalising isn't the same as making the volumes the same. If two tracks have the same average volume, but one has a peak 10dB louder than the other, when the peaks are normalised to 0dB, the first will be 10dB quieter than the other, on average.
    Normalising can help keep volumes similar, but they will vary a bit. Alternatively ReplayGain analyses the audio and adjusts it according to how loud it sounds. It aims for a "target volume". It's designed for music, but works pretty well for soundtrack audio.

    I've not used those batch files myself, but it seems "Avi_Gain_Lossless.bat" works for MP3 audio by applying ReplayGain. It appears to only work if the original audio is already MP3. The other two batch files seem to apply compression, which I wouldn't do.

    If it was me.....
    I'd convert the AC3 to MP3 and then adjust their volumes using MP3Gain and ReplayGain. If you do, I find for soundtrack audio it's best to set the target volume to 86dB, or 83dB to be perfectly safe. That way you should be able to adjust them all to the same target volume without clipping. The default is 89dB, which is fine for music, but soundtrack audio tends to be a bit more dynamic. Or MP3Gain will normalise the way Audacity does it.

    If you happen to use foobar2000, you can batch convert with it. It'll also run a ReplayGain analysis and save the result to tags in the files. It can then use the tags to apply the appropriate ReplayGain adjustment while converting. So you could load dozens of AC3 files into a playlist, highlight them all, right click and run a ReplayGain analysis, then right click and select convert. You could convert them to AC3/AAC/MP3/FLAC etc etc while applying ReplayGain in a single operation.
    It'd probably only work for stereo to stereo conversions though. Downmixing to stereo would probably require an extra step.

    Just some thoughts.........
    Last edited by hello_hello; 22nd Jul 2014 at 07:38.
    Quote Quote  
  7. Bit confused now - or we talking about audio (level) normalization or about audio (loudness) normalization? Unless this is really necessary (0dBFS) level normalization shall bee at around -3.0103dBFS (this prevent digital clipping), loudness is different story.
    Last edited by pandy; 22nd Jul 2014 at 10:00.
    Quote Quote  
  8. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    I missed the ability to use MKVMergeGUI to essentially "swap" contents. Climbing in too fast.
    It seems the work flow should be:
    1) If AVI, remux to MKV with MKVMergeGUI
    2) Extract audio with MKVCleaver
    3) If audio is AC3 convert to MP3
    4) Use MP3Gain (Track Analysis) to 83dB (This will make ALL material the same perceived level, albeit a bit softer, but with virtually no risk of clipping.)
    5) Use MKVMergeGUI to remove "old" audio and add "fixed" audio.
    Quote Quote  
  9. 1). Yes. You can of course demux the audio from the original AVIs but batch extracting it with MKVCleaver after remuxing might be less work. Or you could try batch extracting (effectively) with Video To Video Converter. You can open a bunch of AVIs (for example), select AC3 from the list of conversion presets, change the audio codec to "copy" and you should end up with just the AC3 audio. If you've got lots of them to do.....

    2) Yes.

    3) Yes. You have to re-encode AC3 audio to adjust the volume anyway....

    4) Yes. ReplayGain isn't perfect, but it's pretty good. A few times I've been encoding a bunch of episodes from a DVD, so after I've extracted the audio, I've run ReplayGain on them for a look-see. Ideally, the audio should be the same volume to begin with, and that's generally what ReplayGain reports, to within a couple of dB or less.

    After you've run a track analysis using MP3Gain, you'll see there's a couple of columns labelled "Clip" and "Clip (track)" which may contain info. The former reports if the track already has peaks above maximum (unlike wave files, lossy formats can store peaks above 0dB). The second shows any tracks which will still have peaks above maximum after Track Gain has been applied. If I'm adjusting the volume of a bunch of episodes from the same TV series (for example), I tend to start at 89dB and reduce the target volume until there's nothing in the "Clip (track)" column, and use whatever target volume that might be. I find it's usually around 86dB, give or take. If I wanted all audio to always have the same volume, I'd probably stick with 83dB. Very, very occasionally you might still find a soundtrack with peaks 1 or 2 dB above maximum but it's nothing to worry about. Depending on the playback hardware those peaks might be "clipped" on playback, but even so, you'd probably need bionic ears to hear it.
    Assuming the AC3 in question is the original audio, I'd be interested in how much it appears to need adjusting after a ReplayGain scan. I've found it's generally very little.... the volume would probably already be around ReplayGain's target volume of 86dB and there mightn't be much headroom for increasing it without the peaks clipping, so even if you can, chances are it'll only be a couple of dB.... not worth the effort. If the audio's a re-encoded version of the original, then all bets are off..... there's no way to know if or how much the volume was adjusted during the process.

    If you want to compare normalising methods before committing yourself, use MP3Gain's "Options/Advanced" menu and enable the maximising feature. Once you do, you can right click on a bunch of files and select "max no clip analysis" and "apply max no clip gain". That'll give you MP3s normalised the traditional way.... peaks at maximum. Then run a track analysis to see if, or how much, volume difference ReplayGain reports between tracks, and have a listen yourself. If you agree, apply ReplayGain.

    PS. If you run a Track Gain analysis and listen to the MP3s, make sure you either use a player which ignores the ReplayGain tags, or lets you disable ReplayGain, or run ReplayGain on copies of the MP3s and listen to the originals. Some players will read the tags and adjust the volume on playback and you won't hear any of the volume differences ReplayGain might be reporting. That's how ReplayGain was supposed to work originally, but very few hardware players support ReplayGain tags (most software audio players do) so the workaround for MP3 is to physically change the volume accordingly with a program such as MP3Gain.

    5). Yes. My OCD wouldn't allow it but if you don't have OCD tendencies.....
    I keep all my standard definition Xvid AVIs as AVIs so if I've got an AVI then I know what it'll be. For high definition and other video formats (ie h264) I use MKV, so if I have an MKV I know it's not SD Xvid. I can't help it. My brain won't let me do anything else. I don't know what I'll do when I've got Ultra HD video in MKVs. I might need to cope via some kind of medication.
    Last edited by hello_hello; 22nd Jul 2014 at 11:10.
    Quote Quote  
  10. Originally Posted by pandy View Post
    Bit confused now - or we talking about audio (level) normalization or about audio (loudness) normalization? Unless this is really necessary (0dBFS) level normalization shall bee at around -3.0103dBFS (this prevent digital clipping), loudness is different story.
    We're pretty much discussing which method to use. NDMMackay was looking at level normalisation, and I'm advocating loudness normalisation using Replaygain (assuming we have the same definition of each).

    Mind you despite offering my opinion on the topic I tend to avoid any kind of normalising if possible. If the audio is the original AC3/DTS etc I just re-encode it "as-is". If I'm downmixing AC3/DTS to stereo while converting, I apply a 6dB gain reduction after downmixing to prevent clipping (99% of the time) and the volume relative to the original should always be the same. I know a lot of people find the volume of (original) AC3 audio to be too low at times. I've not found that to be the case myself, but maybe I've never owned players which apply dialogue normalisation.

    About the only time I go out of my way to "normalise" as such, is if I've got a bunch of related files with unrelated volumes.... some normalised the traditional way, some not normalised at all etc.
    Quote Quote  
  11. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    The reason I am doing some "normalising" now is that I have ripped a bunch of my sitcoms too an HDD plugged into my BluRay player. I alternate between the sitcoms. For some reason, there is a marked difference in volume between them, and I get tired of constantly adjusting the volume.

    I'll have a look at Video to Video Converter. (There is sooooo... much software out there!)
    Quote Quote  
  12. Originally Posted by NDMMackay View Post
    The reason I am doing some "normalising" now is that I have ripped a bunch of my sitcoms too an HDD plugged into my BluRay player. I alternate between the sitcoms. For some reason, there is a marked difference in volume between them, and I get tired of constantly adjusting the volume.
    Ok, now it is clear to me - i would go for loudness normalization first and set level normalization as -3.0103dBFS - check EBU.R128 filter - it shows perceived audio level (loudness) http://www.ffmpeg.org/ffmpeg-filters.html#ebur128 - and IMHO ffmpeg is not best at this area thus i would follow recomendation for othermethods (but still ffmpeg can be used to measure and do analysis).
    Quote Quote  
  13. please remove
    Last edited by pandy; 22nd Jul 2014 at 15:01. Reason: crosspost
    Quote Quote  
  14. Co-incidentally, I was playing around with TAudioConverter just now (I haven't use it in quite a while) and as it turns out..... you know that all-in-one tool you were hoping for? Well..... if it worked.....

    In theory it'll open video files directly and convert the audio within, and it has an option to downmix if need be and apply ReplayGain. I assume it adjusts the volume while re-encoding rather than only write tags. You can even choose the target ReplayGain volume. It appears not to do any remuxing for you but at least most of the process would be automated, except.....

    I gave it a spin as I had problems getting it to work properly a while ago, so I downloaded the current version, and unless I'm going somewhat mad, the ReplayGain option is broken. I'd imagine it wouldn't be hard to fix (it's probably just not implemented correctly in TAudioConverter's commandlines) but you may need to wait for a new version of the program. Anyway.... I reported the problem I was having with ReplayGain here and asked a few questions. You might want to keep your eye on the thread for a reply and/or a new version. https://forum.videohelp.com/threads/351319-TAudioConverter-0-9-5-Multithreaded-Audio-Co...=1#post2335531
    Quote Quote  
  15. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    I have bookmarked the thread. It looks promising, when fixed.
    Quote Quote  
  16. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    I have been "exploring" my files a bit with MP3Gain. My series which is the softest by far is at 86dB. Some are as much as 9dB louder.

    Which means that the ones that I consider to be the "problem" are the ones that are "good."

    Which means either live with the problem or process a LOT of files.
    Quote Quote  
  17. Originally Posted by NDMMackay View Post
    I have been "exploring" my files a bit with MP3Gain. My series which is the softest by far is at 86dB. Some are as much as 9dB louder.

    Which means that the ones that I consider to be the "problem" are the ones that are "good."

    Which means either live with the problem or process a LOT of files.
    Are the quiet ones AC3 and the louder ones.... not.
    If so, it'd make sense that much of the non-AC3 audio was normalised when it was encoded, especially if it was multichannel audio downmixed to stereo. I'm fairly sure I'm correct about AC3 audio "normally" being around 86dB, but to be honest it's been quite a while since I've regularly run ReplayGain scans on soundtrack audio or had to think about it, so I was hoping I was remembering the numbers correctly.

    The 9dB louder audio..... does MP3Gain show any clipping for any of them? I'd be surprised if it didn't, but maybe it's not overly dynamic, or it's been compressed.

    The only other issue you might have with AC3 audio is the dialogue normalisation thing. AC3 can contain info which tells the player to adjust the volume by "x" amount, and generally that means it'll reduce it. The idea being, all AC3 dialogue should be the same volume. If there's no dialogue normalisation info... I think players are supposed to reduce the volume by a fixed amount.... but to be honest, I haven't thought about any of this for a long time so I might have some of it a little wrong. However....

    I assume when the AC3 audio is exacted from the original video, the dialogue normalisation info can be removed. I don't know if that's always the case.... probably not. Maybe mostly when re-encoding. Eac3to removes it by default when extracting.... I think.... but I don't know about other programs.

    Anyway.... what are you generally using for playback? If it's a PC the chances are any dialogue normalisation will be ignored but I've no idea what hardware players/receivers might do. If memory serves me correctly.... ffdshow has two AC3 decoders, libavcodec and liba52. Last time I tried it (a few years ago), liba52 obeyed the dialogue normalisation while libavcodec didn't, so you could have different volumes for the same AC3 audio depending on which codec you selected in ffdshow's configuration. Once I worked out it wasn't in my head and sometimes AC3 audio was really damn quiet, then discovered the reason, I asked the ffdshow developers about it and they switched the default AC3 decoder to libavcodec. Other decoders/codec/media players..... I don't really know what they do.

    Anyway.... I just thought you might want to check some of the quieter audio to make sure it's as quiet as you think it is.
    Quote Quote  
  18. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    Are the quiet ones AC3 and the louder ones.... not.
    Some yes, some no. A lot depends on the source.

    I'm fairly sure I'm correct about AC3 audio "normally" being around 86dB,
    MP3GainGUI says 89dB

    The 9dB louder audio..... does MP3Gain show any clipping for any of them? I'd be surprised if it didn't, but maybe it's not overly dynamic, or it's been compressed.
    No clipping, but then sitcoms, in general, tend not to be very dynamic. And most of the "louder" content was probably normalised in the other sense of the term.

    The only other issue you might have with AC3 audio is the dialogue normalisation thing.
    Been having a look at AftenGUI (with the idea of staying in AC3/WAV so as to keep 5.1 audio) and the Dialog Normalising is there. Have no idea what happens when you export the audio, that would take a bit of experimenting/listening to test that. I transfer the MKV files to an external HDD and plug that into my BluRay Player. I have no idea if it respects tags.

    Anyway.... I just thought you might want to check some of the quieter audio to make sure it's as quiet as you think it is.
    It is, that is why I started this whole exercise. That particular material seems to have been processed in some way. Viewing it in Audacity it looks as though it has been multiband processed (as they do on radio), almost a flat line from start to end, with only a few peaks sticking out. And even those are a good 10dB below clip level.

    Maintaining 5.1 audio is also a process: MKVCleaver to get the AC3 audio. foobar2000 to apply ReplayGain and convert to WAV. Then AftenGUI to convert back to AC3. Then MKVMergeGUI to finalise.
    Quote Quote  
  19. I generally encode with an AAC encoder if I re-encode. AAC supports multi-channel and it's a bit more efficient than AC3 (smaller file sizes). I tend to use the NeroAAC encoder and it's default quality setting (q.50). The only possible disadvantage is receivers don't tend to decode it.... so you can't send it out over S/PDIF or HDMI without decoding it first (HDMI passthrough or whatever it's called). I don't care at all, then I try to care a little less, so I'm happy with AAC. Most media players will decode it unless they're fairly ancient. It's not a official audio type for Bluray discs but I'm yet to meet a Bluray player which can't decode it.

    You do realise foobar2000 can convert directly to AC3? No need for the WAV step. Just create a new conversion preset, select "custom" as the encoder, and show foobar2000 where to find aften.exe. Here's the encoder parameters I use.

    -readtoeof 1 -v 0 -b 192 - %d

    -b 192 specifices a 192kb/s bitrate. You can create more than one AC3 preset with different bitrates, or you can leave out the "-b 192" part entirely. If you don't specify a bitrate in the commandline, Aften picks one for you according to the number audio channels. Apparently it's 192 for stereo and 448 for 5.1ch.

    For the rest of the encoder setup:

    Extension: AC3
    Format is lossy.
    Highest supported bitdepth is 32.
    Under the display section you can put whatever you like in order to distinguish the encoder preset from the rest.

    I had a look through the AFTEN commandline options looking for dialogue normalisation and found this:

    [-dnorm #]
    Dialog normalization [0 - 31] (default: 31) The dialog normalization value sets the average dialog level. The value is typically constant for a particular audio program. The decoder has a target output dialog level of -31dB, so if the dialog level is specified as being -31dB already (default), the output volume is not altered. Otherwise, the overall output volume is decreased so that the dialog level is adjusted down to -31dB.


    The way I read that, is if you don't add -dnorm along with a value to the commandline, dialogue normalisation of 31 is specified. I'd assume, if you're re-encoding AC3 which includes dialog normalisation, the appropriate value would be passed along to AFTEN without the user having to think about it... well that seems logical to me, but I'm guessing. Which would also mean there's no way to stop AFTEN from adding dialogue normalisation info, unless I've missed it.

    That's pretty much the extent of my knowledge on the topic as I don't encode to AC3 very often. Maybe someone with more dialogue normalisation info will come along, but you could try converting a few files to AC3 and also to something else such as AAC, mux the audio and video into individual MKVs and check them for volume. If the AC3 audio is quieter than the "other codec", I'd assume it's a dialogue normalisation problem.
    Last edited by hello_hello; 24th Jul 2014 at 07:28.
    Quote Quote  
  20. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    You do realise foobar2000 can convert directly to AC3? No need for the WAV step. Just create a new conversion preset, select "custom" as the encoder, and show foobar2000 where to find aften.exe.
    That was a question I was going to ask - how to point it at a command-line codec.

    I'd assume, if you're re-encoding AC3 which includes dialog normalisation, the appropriate value would be passed along to AFTEN without the user having to think about it
    Unless something very funny has been going on I would assume that the value of -31 is specified wherever it is possible to specify it. Not going to worry about it unless I have some surprising results somewhere along the line.
    Quote Quote  
  21. What target volume are you aiming for? In case you don't know, you can change the default in foobar2000's preferences under Advanced. I leave it at 89dB myself. To convert to a target volume of 83dB I tell the converter to adjust the volume according to ReplayGain, then reduce it a further 6dB.
    Quote Quote  
  22. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    Wouldn't it be easier to just do it in one step via Preferences?
    Quote Quote  
  23. It's easy to configure a converter preset to apply both ReplayGain and a further volume reduction. You can specify one in the converter's configuration, in the ReplayGain section.
    I often forget to change the target volume back to 89dB when running MP3Gain on music files, and it's displayed in the main program window. Hidden away in preferences I'd definitely keep forgetting.

    Thinking about it..... chances are foobar2000 writes the usual ReplayGain tags regardless of the target volume in preferences, which would assume 89dB, but it'd adjust the volume taking any change to the target volume into account. That'd make more sense I think, because if different programs stored the ReplayGain info in different ways the system wouldn't work too well.

    Edit: I seem to have assumed incorrectly when it comes to foobar2000. Adjusting the target volume in preferences appears to have no effect when applying ReplayGain on playback or converting. In both cases you can manually specify a further gain change and save it as a preset so I guess it's better that way. Changing the target volume in preferences only seems to make a difference when foobar2000 is adjusting the volume of files as MP3Gain does.
    Last edited by hello_hello; 24th Jul 2014 at 09:52.
    Quote Quote  
  24. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    This makes sense. ReplayGain is supposed to be a standard. It should override any other level/gain settings.
    Although there are pre-amp settings where you switch ReplayGain on and off.
    Quote Quote  
  25. This should be possible using Hybrid.
    Simply choose 'passthrough' for the video and 'custom' for the audio.
    Adjust the audio parameters on the audio tab.
    Choose an mkv or mp4 container as you please.
    Add task, repeat to queue your batch.
    Quote Quote  
  26. Member
    Join Date
    Oct 2008
    Location
    South Africa
    Search Comp PM
    Will take a look.
    Quote Quote  
  27. Someone may have to show me where Hybid's ReplayGain option is as I don't seem to be able to find it.
    It does have some auto normalising options but I'm not sure what they do. They're labelled as -n or -e etc (to find them, you need to select the re-encode option and then check filtering).
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!