VideoHelp Forum
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 73
Thread
  1. It would be lot easier for softwares those uses ffmpeg libraries.
    Following is the code originally posted by bat999 somewhere in this forum.

    Originally Posted by bat999

    ffmpeg -i foo.flac -f wav - | neroAacEnc -ignorelength -q 0.5 -if - -of foo2.m4a
    An Idea that might work for lots of your favourite video converters,

    ffmpeg -i foo.vid (no video) (only audio) -f wav - | sox normalize wav - | neroAacEnc -ignorelength -q 0.5 -if - -of foo2.m4a

    If you are not familiar with sox, you can simply use qaac encoder instead of sox and neeroAAc.
    ffmpeg -i foo.vid (no video) (only audio) -f wav - | qaac -c 160 -q 100 --normalize -o "normalized.aac" -.
    Baldrick might help you with ffmpeg batch commands or he may put up a small guide in guide section with a working and tested command-lines,on
    ffmpeg -i foo.vid (no video) (only audio) -f wav - | qaac -c 160 -q 100 --normalize -o "normalized.aac" -

    Originally Posted by Selure

    here's an example for ffmpeg->sox->neroAacEnc
    fmpeg -y -threads 8 -v -10 -i "path to input" -f sox - | sox --multi-threaded --ignore-length --buffer 524288 -S -t sox - -t wav - gain -n | neroAacEnc -q 0.7 -ignorelength -if - -of "path to output file"
    here's an example for ffmeg->sox->qaac
    ffmpeg -y -threads 8 -v -10 -i "path to input" -f sox - | sox --multi-threaded --ignore-length --buffer 524288 -S -t sox - -b 16 -t raw - gain -n | qaac --no-delay --threading --raw-channels 2 --raw-rate 48000 --tvbr 75 --raw - -o "path to output file"
    for qaac I use raw as piping format since it's best supported by qaac

    also https://forum.videohelp.com/threads/352067-normalizing-audio-volume-using-new-ffmpeg-options might be interesting to read.

    and if your playback device supports gain flags, you could simply use MP3Gain (which also supports aac audio).
    Alternatively one can write a shell script or a bactch file which can take care of De-Muxing, Audio encoding and Re-Muxing. If you do so, please post a working guide here, otherwise we will leave that part to Baldrick.

    At this moment of writing, I have very fainted memories that ffmpeg has volume option but not normalize.

    Remember that noisy audio is not worth to normalize. Normalize Audio should be a separate option by default it should be off.
    Last edited by enim; 16th Oct 2013 at 17:45.
    Quote Quote  
  2. Norm-2-AAC (AAC 320kbps CBR @ 48000KHz - 2ch Stereo Normalizer)
    ---------------------------------------------------------------------------------------
    (For Newbies who are facing difficulties with command-line tools)

    Norm-2-AAC.exe CHECKSUMS

    CRC32 : 607e7b4a
    MD5 : b31ddc41cefe7b41534d8470eab22ca1
    SHA-1 : 8846fdc2612b21c1536ed460ab41c2faba8f5102

    Norm-2-AAC is a blind and simple win32 tool, a dumb tool for a dummy, yet a powerful batcher that normalize audio stream from any valid video and audio files which can be handled successfully by ffmpeg.

    You need to place ffmpeg static w32bit and qaac w32bit builds in to same folder as Norm-2-AAC.

    Usage :
    (1) Unzip Norm-2-AAC anywhere you like it. (./any directory /any path/Norm-2-AAC)
    Click On norm-2-AAC.exe, press enter anywhere inside windows once directories are created.
    On very first run it will generate three directories - INPUT, OUTPUT And TEMP ins a same folder.
    INPUT is th folder you will pace all video & audio files to be normalize to AAC.
    OUTPUT is the folder where normalized original-filename.vid.aac will be created.
    TEMP is temporary folder, without hogging memories and no more messing any registry.
    (2) Place all valid video and audio files into INPUT folder to normalize to AAC.
    (3) Click On norm-2-AAC.exe and wait.

    You can delete TEMP folder after completion of batch.

    This 1click tool I created less than 10 minutes for one my best (dumb) friend who always have headphones plugged for 24/7, who invited me for beers & dinner. He already tested and confirmed it is working as he needs/wants. I have posted here a sample here normalized on my friend's PC. Cheers!

    Hope, you will also like it.
    You can use it as much as you can -OR- you can distribute as freeware coz it's all yours.
    To be Sure, Just scan it with your favorite Anti-Virus Scanner before you use.

    NO WARRANTY
    -----------
    BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

    HENCE NO CLAIM CAN BE MADE.

    -enim
    LUV U as always!
    Image Attached Files
    Last edited by enim; 24th Oct 2013 at 20:08.
    Quote Quote  
  3. Norm-2-AAC.exe (Final Release) CHECKSUMS
    ----------------------------------------------------------
    CRC32 : 0a2eb9e1
    MD5 : fb0e27ee022f11a1873c02e59f802da0
    SHA-1 : 158b7ac6861471f182a08e91e3007e5822d26c11

    If you have downloaded and used first release,
    (1) Download this latest release.
    (2) Rename Norm-2-AAC.exe to Norm-2-AAC.exe.OLD (So that you can have both. You have flexibility.)
    (3) Unzip Norm-2-AAC.exe (CRC32 : 0a2eb9e1) in same folder "./Norm-2-AAC"

    You need to place ffmpeg.1.x static w32bit x86 and qaac.2.2x w32bit x86 builds in to same folder as Norm-2-AAC.

    The size of code gets multiplied in x1000s when implementing without ffmpeg and qaac. So I will Keep It Simple and Sweet for you, with ffmpeg and qaac.

    Norm-2-AAC.exe._OLD (First Release) was a blind and simple win32 tool, a dumb tool for a dummy, yet a powerful batcher that normalize audio stream from any valid video and audio files which can be handled successfully by ffmpeg.

    Where as Norm-2-AAC.exe (Final Release) is neither dumb nor blind, but, little bit smart version with ErrorLog.txt creation. Where as ErrorLog.txt is a plain list of files which are failed to normalize.

    It is more complete, optimized, robust and user friendly.
    It will definitely serve you as described.

    CHANGE LOG from Norm-2-AAC.exe._OLD to Norm-2-AAC.exe
    ================================================== ===
    Nothing is removed, Just added an extra feature of ErrorLog.
    No extra strings are attached.
    (+) Added Error Log creation.
    (+) High Optimization and Code Cleaned Up.

    The Norm-2-AAC.exe performs exactly as stated.
    It does not perform anything which is not stated. Not even silently in background.
    Scan it with Anti-Virus Scanner before using.

    I do not have to tell you, what to do with normalized aac file(s).
    Where as you can take them further to any audio converters, editors, or muxers directly, if your source is HiQ.

    We have tested it in all regards, it works perfectly as stated.
    On x64 Windows, qaac depends on many other DLLs, please search missing DLLs on internet.

    I have tried to give you the BEST whatever I can!
    I dedicate this tool to those who really need it, who really deserve it, with lot of LuV.

    -enim

    PS : the first release was after couple of beers within 10 minutes, and this final release is after a nice cup of coffee.


    ==================================================
    It would be completely over the head to know the beast, if you can not catch a bee!
    Image Attached Files
    Last edited by enim; 9th Apr 2014 at 01:53.
    Quote Quote  
  4. Hi @enim

    I have many VCD videos with MP2 stereo audio. The volume is too loud to deafen a normal person.

    Is it possible to convert the audio of all videos to MP3, Volume = 89dB (as does MP3 Gain)?

    Thanks.
    Quote Quote  
  5. You can use ffmpeg with Dynamic Audio Normalizer - safe and fast, side to this you may use agate to deal with noise in silent parts of audio.
    Quote Quote  
  6. foobar2000 can scan mp2s with ReplayGain. It's also much faster than MP3Gain. Once the ReplayGain info is saved to the files, it can adjust the volume while re-encoding. Foobar2000 comes with presets for converting to MP3 using the LAME encoder, but you need to download it yourself.

    It can also adjust the volume of MP3s and AAC (in MP4/M4A files) without re-encoding, the same way MP3Gain does. There's an option to change the target volume for that, but it's buried away in foobar2000's preferences under Advanced/Tools/ReplayGain Scanner. If you want to compress as well as adjust the volume, there's a DSP called "EBU 128 Compressor" that can be added to the conversion chain. It'll compress and the output volume will be 89dB (in ReplayGain terms). There's no need to also run a ReplayGain scan when compressing with that plugin, but keep in mind, it does compress.

    By the way, 89dB is often too loud a target volume for applying ReplayGain to "soundtrack" audio as it tends to be too dynamic. You can use the "prevent clipping according to the peak" option, but then you're not adjusting each one to the same volume each time. I tend to use 83dB for soundtrack audio instead.
    Quote Quote  
  7. Thanks @hello_hello for the reply.

    I've downloaded the Foobar2000 and installed it.

    Hope I am able to use it.

    The VCDs are worn out and they cost a lot. I hope I get to create the backup.
    Quote Quote  
  8. No problem, ConverterCrazy. If you're new to foobar2000, the attached files may help.

    Create a folder called "encoders" inside the foobar2000 folder if there's not one there already, wherever it's installed.
    ie C:\Program Files\foobar2000\encoders

    Unzip the attached "encoders.zip" file and copy the contents to the encoders folder.

    foobar2000 keeps it's third party DSPs in the user's application data folder, along with all it's configuration files. I can only tell you where that is for XP.
    C:\Documents and Settings\User name\Application Data\foobar2000

    If you want to use the R128 compressor DSP, unzip "foo_r128norm.zip" and put the unzipped "foo_r128norm" folder in:
    Application Data\foobar2000\user-components
    (restart foobar2000 if need be)

    Add files to a play-list, highlight them all, right click, select Replaygain, and hopefully those menu options will be self explanatory. You need to run a ReplayGain scan if you want to adjust the files or save the ReplayGain info to tags for use when re-encoding. You don't need to if you're using the R128 compressor DSP when converting.

    If you right click and select "convert", then select "..." at the bottom of the list (if there is one) that'll take you to the encoder configuration. That's where you create conversion presets and DSPs are added under the "Processing" link. Up top of the "Processing" page is a button for configuring how any ReplayGain info saved to files will be used when converting.

    Configuring an encoder setup shouldn't be too hard (there's encoder set-ups in a dropdown list), although there's no pre-configured set-up for ffmpeg (and no AC3 or MP2), so as I use ffmpeg for both, here's an example for you.
    A custom encoder preset for converting to MP2:

    Click image for larger version

Name:	foobar2000 ffmpeg.gif
Views:	1267
Size:	14.6 KB
ID:	35859

    There's only variable bitrate Lame MP3 presets. If you need constant bitrate MP3, select "MP3 Lame" from the list at the top, then change it to "Custom". Foobar2000 will fill in what's required for a VBR MP3 encode, and from there you can change it to this (of course you can choose your own bitrate):

    Click image for larger version

Name:	Lame.gif
Views:	1081
Size:	14.6 KB
ID:	35869

    Hopefully that'll get you started. It can take a little time to find your way around foobar2000 because it's very versatile.
    Image Attached Files
    Last edited by hello_hello; 25th Feb 2016 at 03:03.
    Quote Quote  
  9. All this plus more can be done in single line of ffmpeg but author ignored my question about used formats (video, audio, container) and as such can't provide ready to use script that may perform all this automatically on multiple files.

    Bellow example fo mp3 with audio normalized and dynamic compressed (listening for broad audience in public space).

    Code:
    @ffmpeg -i %1 -vn -c:a libmp3lame -q:a 2 -af "aformat=sample_fmts=fltp,highpass=f=80,pan=stereo|FL < FL + 1.414FC + .5BL + .5SL|FR < FR + 1.414FC + .5BR + .5SR,dynaudnorm=m=50.0:b=1:s=25.0,compand=0.02|0.1:0.60|0.60:-80/-999|-70/-35|-35/-25|-25/-20|-9.309/-6.0206|0/-3.103:6:-9.309:-90:0.6,aresample=resampler=soxr:osr=48000:dither_method=0" "%~n1_dnrc.mp3"
    Quote Quote  
  10. Originally Posted by pandy View Post
    All this plus more can be done in single line of ffmpeg but author ignored my question about used formats (video, audio, container) and as such can't provide ready to use script that may perform all this automatically on multiple files.

    Bellow example fo mp3 with audio normalized and dynamic compressed (listening for broad audience in public space).

    Code:
    @ffmpeg -i %1 -vn -c:a libmp3lame -q:a 2 -af "aformat=sample_fmts=fltp,highpass=f=80,pan=stereo|FL < FL + 1.414FC + .5BL + .5SL|FR < FR + 1.414FC + .5BR + .5SR,dynaudnorm=m=50.0:b=1:s=25.0,compand=0.02|0.1:0.60|0.60:-80/-999|-70/-35|-35/-25|-25/-20|-9.309/-6.0206|0/-3.103:6:-9.309:-90:0.6,aresample=resampler=soxr:osr=48000:dither_method=0" "%~n1_dnrc.mp3"
    Hi @pandy

    Thanks for the reply.

    The preferred format is AVI container, h.263 codec. Audio MP3/192KBConstant/VolumeNormalization to 83dB (as suggested by hello_hello).

    The number of MPG files on HDDisk is 94 in 47 folders, total size 46GB.


    Thanks @hello_hello, for excellent and detailed guide. Will get back to your after I try it out.


    Just thinking Man, what would I do without this forum!
    Quote Quote  
  11. Originally Posted by ConverterCrazy View Post

    The preferred format is AVI container, h.263 codec. Audio MP3/192KBConstant/VolumeNormalization to 83dB (as suggested by hello_hello).
    AVI container OK, MP3 192kbps OK, h.263? are sure - perhaps by h.263 you think about DivX/XVid?
    Volume normalization to 83dB is marketing bs in digital audio world - audio level in digital world can't be higher than 0dBFS and usual RMS level (loudness) should be around -20 - 23dBFS and peaks should be normalized to -6.0206dBFS (and not higher than -3.0103dBFS for sure).

    Please confirm this h.263 video coding - not sure on this. Without knowing material it is somehow difficult to establish noise gate level - i assume than anything bellow -75dBFS is not useful anyway.
    Quote Quote  
  12. Originally Posted by pandy View Post
    Volume normalization to 83dB is marketing bs in digital audio world - audio level in digital world can't be higher than 0dBFS and usual RMS level (loudness) should be around -20 - 23dBFS and peaks should be normalized to -6.0206dBFS (and not higher than -3.0103dBFS for sure).
    I'm not sure about marketing BS, but it's what I use for soundtrack audio. If memory serves me correctly a ReplayGain target volume of 83dB is the same as an EBU R128 target loudness of -23 LUFS (it might be 82dB or 84dB equals -23 LUFS, I'd have to check), and ReplayGain's standard 89dB target volume is EBU R128's -18 LUFS.
    Most audio players probably use EBU R128 for ReplayGain scanning these days. Foobar2000 does, but they continue to write tags in ReplayGain-speak. The gain is still always relative to a ReplayGain target volume of 89dB, peaks are a percentage, and in the case of foobar2000 it'll also display the peaks as dBTP if you ask it to.

    My method for "soundtrack" audio is to scan the source files, save the ReplayGain info, then I tell foobar2000 to use the ReplayGain info when converting and to reduce the volume by a further 6dB. Once it's done, if I'm motivated, I'll load the encoded files into foobar2000, run another scan and check for clipping.

    Some tracks ripped from CD to Flac and scanned (true peak):

    Click image for larger version

Name:	before.gif
Views:	264
Size:	15.3 KB
ID:	35873

    Converted to Flac again using the ReplayGain info, minus 6dB for a target volume of 83dB, and scanned again:

    Click image for larger version

Name:	after.gif
Views:	267
Size:	15.2 KB
ID:	35874

    Of course if you want to compress and not just normalise with ReplayGain, that's a whole different thing. Being a GUI kind of guy I use a Winamp compressor DSP (it works the same way as the Dynamic Audio Normaliser) which I add to the foobar2000 conversion chain, but I'm not sure if compression is the goal here. That'd be a three step process for me.
    Re-encode to wave files while compressing, which usually results in output files with peaks at maximum.
    Scan the wave files with ReplayGain.
    Use the ReplayGain info to convert them to the final format and the same target volume.

    The foobar2000 R128 compressor DSP can do all that in a single step, but I prefer the Winamp compressor DSP so I do it in multiple steps.
    Last edited by hello_hello; 25th Feb 2016 at 17:22.
    Quote Quote  
  13. Originally Posted by hello_hello View Post
    I'm not sure about marketing BS, but it's what I use for soundtrack audio. If memory serves me correctly a ReplayGain target volume of 83dB is the same as an EBU R128 target loudness of -23 LUFS (it might be 82dB or 84dB equals -23 LUFS, I'd have to check), and ReplayGain's standard 89dB target volume is EBU R128's -18 LUFS.
    Most audio players probably use EBU R128 for ReplayGain scanning these days.
    So once again, completely out of topic but it must be said to avoid confusion especially when we trying to solve other people problems i.e. help.

    ReplayGain author introduced own, non standard and weird in technical approach definition for RMS signal level - fine but please use this only for ReplayGain. In real life there is no ReplayGain but practical units that describe signal in non confusing way - such unit in digital domain is dBFS.
    From maths perspective is quite clear that any sine signal normalized to -3.0103dBFS is safe as sine at 45 deg has value equal to -3.0103 dBFS i.e. 20*log(0.70710678118654752440084436210485).

    So normalizing to -3.0103dBFS is always safe for correctly preprocessed signal (i.e. not pathological signals that violate Nyquist sampling criterion) however it is recommend to normalize it to 50% of range i.e. to -6.0206dBFS - this mean that we loosing 1 bit (so 16 bit audio is 15 bit) but with correct dithering (and maybe with noise-shaping) loss is transparent from human ear perspective (and it doesn't occurs in lossy codecs if proper sample format is used to feed encoder). If you are interested in details then i would recommend you to read very good paper from SØREN H. NIELSEN AND THOMAS LUND - "0dBFS+ Levels in Digital Mastering" - there is explanation why all that fuzz.

    Once again ReplayGain use way to express reference level in very odd and non standard way and this is confusing and should be avoided.
    Quote Quote  
  14. I completely agree with your view on the ReplayGain target volume. Specifying 89dB doesn't seem to mean anything and even if you know where 89dB comes from it's still very non-intuitive.
    I agree technically you should normalise to -3dB and in a perfect world it'd be -6dB, but I use true peak R128 scanning so it's not too necessary to have a 3dB safety margin, and to be honest, as long as peaks are at 0dB or less, I don't fuss about it too much. The reality of it is, 90% of encoder GUIs doing peak normalisation have normalised to 0dB and the world's still turning.
    What I don't understand is why ReplayGain or R128 isn't the standard normalising method for every current encoder encoder GUI, but they're still pretty much the exception.

    In defence of the author of ReplayGain, he didn't introduce a non standard and weird in technical approach definition for RMS signal level, he used an existing SMPTE specification. https://en.wikipedia.org/wiki/ReplayGain#Target_loudness
    The only change made was a result of numerous complaints regarding 83dB being too low, so early on the ReplayGain target volume was increased by 6dB.

    In my defence, I referred to ReplayGain because a question was asked specifically about normalising MP2 files in the same way MP3Gain normalises MP3s. I also tried to avoid confusion by suggesting a target volume of 83dB, as per the original SMPTE standard, for soundtrack audio. ConverterCrazy is familiar with Replaygain and I was fairly sure he'd know what I was referring to. He uses MP3Gain and it lets you adjust the target volume. You can change it to 83dB. You can't change it to -23dBFS or -23LUFS or anything relative to 0dBFS.

    Speaking of expressing things in practical units:

    Click image for larger version

Name:	1.gif
Views:	979
Size:	24.2 KB
ID:	35893

    LoudnessValue = -1776. Not having needed to use those tags I've never tried to work out how to convert them into something meaningful. It might as well say LoudnessValue = Pink Elephant. If I load that file into foobar2000 it'll display those values in ReplayGain-speak. It turns out LoudnessValue -1776 equals TrackGain -0.41dB. That means something to me.

    As does this. I've even converted percent to dB enough times to know the peak is around 4.5dB below clipping without reaching for a calculator.

    Click image for larger version

Name:	4.gif
Views:	1211
Size:	20.9 KB
ID:	35894

    Edit.... Ahhhh I think the penny dropped. I know -1776 is pretty close to ReplayGain's 89dB. Using that as a reference, because I know ReplayGain 89dB = -18LUFS, I assume -1776 refers to -17.76 LUFS and the peak is -4.27dBFS.
    I guess I need to backpeddle a little on that one, but seriously, wtf aren't the tags written that way in the first place?


    I've been using ReplayGain since the day I bought my first MP3 player. Long before the loudness debate really heated up, and long before EBU R128.

    Because I think in ReplayGain terms I don't tend to look at ReplayGain as confusing the issue, but more like this. No reason why everybody can't get along.

    Click image for larger version

Name:	zz.gif
Views:	1228
Size:	10.1 KB
ID:	35931
    Last edited by hello_hello; 28th Feb 2016 at 06:10.
    Quote Quote  
  15. Originally Posted by hello_hello View Post
    I completely agree with your view on the ReplayGain target volume. Specifying 89dB doesn't seem to mean anything and even if you know where 89dB comes from it's still very non-intuitive.
    I agree technically you should normalise to 3dB and in a perfect world it'd be -6dB, but I use true peak R128 scanning so it's not too necessary to have a 3dB safety margin, and to be honest, as long as peaks are at 0dB or less, I don't fuss about it too much. The reality of it is, 90% of encoder GUIs doing peak normalisation have normalised to 0dB and the world's still turning.
    What I don't understand is why ReplayGain or R128 isn't the standard normalising method for every current encoder encoder GUI, but they're still pretty much the exception.

    In defence of the author of ReplayGain, he didn't introduce a non standard and weird in technical approach definition for RMS signal level, he used an existing SMPTE specification. https://en.wikipedia.org/wiki/ReplayGain#Target_loudness
    The only change made was a result of numerous complaints regarding 83dB being too low, so early on the ReplayGain target volume was increased by 6dB.
    In real life you can't ignore fact that at final stage of conversion (before turning digital to analog) there is almost always mandatory to add dither and dither level in case of the simplest one used (and minimum acceptable) TPDF should be at least 2LSB i.e. at worst case scenario you may overload DAC - usually this not happen as in real life energy from dither with noise shaper may have have more than few LSB but it is located in this spectrum part where overall amount of signal energy is quite low.
    RMS is different aspect as you measure RMS signal level across some time window and this window is selected on some assumptions.
    Side to this based on OP informations i assume that he do not expect very high signal dynamic as from practical perspective typical wide audience areas not offer good listening conditions - so i assume signal need to have significantly compressed dynamics and as such overall RMS signal level will be quite high (somewhere around -20...-15dBFS) and as such i see no point to blindly follow EBU on this which is tailored for signal level alignment across various signal providers but it must be more universal.
    FYI if you go to EBU R.128 there are some tricky areas where LUFS may be equal to dBFS (and this is frequently misunderstood or over-interpreted).
    But this is way off from topic and really don't want to "steal" topic for such discussion.

    If OP provide information i will try to prepare working script that should automate conversion.
    Quote Quote  
  16. Originally Posted by pandy View Post
    so i assume signal need to have significantly compressed dynamics and as such overall RMS signal level will be quite high (somewhere around -20...-15dBFS) and as such i see no point to blindly follow EBU on this which is tailored for signal level alignment across various signal providers but it must be more universal.
    In the interest of full disclosure I usually don't stick to EBU or ReplayGain levels for soundtrack audio. In the case of MP3Gain it's easy.... scan the files and each file that'll result in clipping at the currently selected target volume is displayed in red, or has a red mark in the clipping column. As the target volume is lowered, red changes to black, and when I get to a target volume that won't result in any files being clipped, that's the target volume I use. As long as I just need to make a group of files the same volume as each other, but not necessarily the same volume as unrelated files, that's fine. It's invariably going to be between 83db and 89dB, depending how dynamic the audio is. For the purpose of this discussion though.... not defining a target volume seemed likely to cause confusion.

    You can scan with ReplayGain using foobar2000 and effectively do the same thing, but you need to scan, check whether the ReplayGain adjustment will be to increase or decrease the volume, then see how that'll effect the current peak levels and work out the optimum target volume yourself, which means it sometimes takes me a few attempts to get it right.....
    Quote Quote  
  17. Originally Posted by pandy View Post
    Originally Posted by ConverterCrazy View Post

    The preferred format is AVI container, h.263 codec. Audio MP3/192KBConstant/VolumeNormalization to 83dB (as suggested by hello_hello).
    AVI container OK, MP3 192kbps OK, h.263? are sure - perhaps by h.263 you think about DivX/XVid?
    Volume normalization to 83dB is marketing bs in digital audio world - audio level in digital world can't be higher than 0dBFS and usual RMS level (loudness) should be around -20 - 23dBFS and peaks should be normalized to -6.0206dBFS (and not higher than -3.0103dBFS for sure).

    Please confirm this h.263 video coding - not sure on this. Without knowing material it is somehow difficult to establish noise gate level - i assume than anything bellow -75dBFS is not useful anyway.
    Thanks for the reply.

    Yes, XVID. It can play on all my TV computer and car video player (which doesn't play any other format).

    If I can cut a clip from original MPG file, I'll upload it here.
    Quote Quote  
  18. @hello_hello

    The volume/ReplayGain between 83-89 is acceptable.
    Quote Quote  
  19. A couple of foobar2000 tips for you:
    If you drill down into foobar2000's options:
    Advanced/Tools/ReplayGain Scanner/File Content Alteration

    You'll find the option for setting the target volume. The default is 89dB (apologies to pandy on behalf of the foobar2000 author). It works the same way as changing the target volume for Mp3Gain, and like MP3Gain, it only effects the lossless adjustment of MP3 or AAC files. If you use any ReplayGain info while converting to another format and you want a target volume of something other than 89dB, you have to specify it in the ReplayGain section under "Processing" when configuring the converter.

    While you're in options, under "ReplayGain Scanner" there's a "peak sample over-scan value" option and the default of "1" gives you the sample peak, not true peak. When I compared it to another R128 scanner which only has an option to enable or disable true peak scanning, setting the "peak sample over-scan value" to "4" for foobar2000 produced the same results. It'll slow the scanning down, but given foobar2000 can scan multiple files at a time and it'll still be faster than Mp3Gain when scanning a single file, it's no big deal. If you want True Peak scanning, that's how to do it.

    The main reason I suggested 83dB (in ReplayGain-speak) as the target volume for soundtrack audio is because when blindly picking a target volume and normalising to that, 83dB should be pretty safe, just as it's pretty safe to use 89dB for normalising CD audio. If I was just normalising soundtrack audio to something without checking it later, it'd be 83dB.

    For normal soundtrack audio (by "normal" I mean movies or TV shows, because I'm not sure exactly what audio you have) I'm not sure I've used MP3Gain to normalise and been able to increase it above 86dB very often. Individual files maybe, but for a group.... such as a season's worth of a TV show.... 86dB would be it.
    Thinking about it, there's probably been a few occasions where I've needed to go as low as 82dB, but in defence of my original 83dB claim....
    Mp3Gain can only adjust the volume up or down in increments of 1.5dB, so depending on the volume of the MP3, it might be necessary to go down to 82dB to compensate, but I don't think I've had to go any lower.

    As a side note....
    The other day when I posted a screenshot of the R128Gain GUI it showed -18.8 LUFS as the ReplayGain target volume and I wrote that ReplayGain's 89dB must equal R128's -18.8 LUFS, but when I ran the GUI today and reset it, it showed -18 LUFS, so I guess I must have inadvertently changed the ReplayGain setting and therefore that was incorrect. ReplayGain's 89dB target volume = -18 LUFS.
    I'll edit my previous post to fix that and replaced the screenshot with a new one so as not to confuse any future readers of this thread.
    Last edited by hello_hello; 29th Feb 2016 at 03:12.
    Quote Quote  
  20. @pandy and @hello_hello

    To say the least, the discussion between you two is quite educative and thank you very much.

    I must correct myself, the 89dB reference IS for normalization of CD audio and not for audio in video files. I regret I forgot to mention this.

    Attaching a clip of original video file. If it might help.

    Thanks.
    Image Attached Files
    Quote Quote  
  21. Originally Posted by ConverterCrazy View Post
    Attaching a clip of original video file. If it might help.
    I can only wish you luck.

    The problem isn't that it's loud, although it is.
    The problem isn't that the peaks are too loud, because even using true peak scanning they're still a couple of dB below maximum.
    The problem isn't that it needs to be compressed. I think it sounds loud because it's already heavily compressed.

    The main problem with that sample is it's already been clipped somewhere along the way, and that's why it sounds distorted.

    I made a quick attempt to do something to improve it without success, but to be honest that audio would be in the "not worth it" category for me so trying to fix something like that would be a fair way out of my comfort zone.

    Audacity has a clip detection function that didn't seem to be able to detect the clipping, and it's clipping repair DSP had no effect. Maybe that's just an indication I don't know what I'm doing though.
    The old version of Nero Wave Editor I have also has a clipping repair function, but it wasn't doing much.

    I think part of the problem.... and admittedly I'm doing some guessing here..... is the waveform seems kind of "off centre" and I don't seem to be able to do anything about it, and that's possibly why any clipping detection and repair isn't working. Someone more clever than me might know.

    If you look at the wave form, visually the "0" line looks off-centre.

    Click image for larger version

Name:	nero1.gif
Views:	924
Size:	55.2 KB
ID:	35942

    And if you drill down there's plenty of flattened peaks to be found.

    Click image for larger version

Name:	nero2.gif
Views:	994
Size:	36.2 KB
ID:	35943

    As I said, someone more clever than myself might be able to restore it to some extent, but the attached sample is the original audio simply normalised to ReplayGain's 89dB. It's so compressed the peaks are about 13dB below maximum but it still sounds like crap.... just at a lower volume than before.
    Image Attached Files
    Quote Quote  
  22. @hello_hello

    Thanks for the inputs. You have taught me a good many things. Appreciate very much for the time you spend on my problem.
    I know the company that produced those CDs produced cheap DVDs as well. The audio is pure trash in all of them.
    I can see the flat peaks and 0 offset too in the screenshots. But can't make out the software/tool you used to see them.
    The FLAC file you uploaded sounds a bit better than any version of mine.


    @pandy

    Now, I'm banking on you to give me the FFMPEG command to convert all 92 files to AVI container, MP3 192kbps, volume 83dB, XVID.
    I wonder if FFMPEG can take care of DC offset and those flattened peaks as hello-hello has posted above.

    All videos that I converted to AVI XVID using Video to Video Converter work fine in commercial DVD player, car Video player and TV (analog) — you may laugh all you want.

    Thanks.

    P.S. I have no idea how Video to Video Converter can deal with clipping, volume and Zero offset.
    Last edited by ConverterCrazy; 29th Feb 2016 at 05:23. Reason: Additional info
    Quote Quote  
  23. Originally Posted by ConverterCrazy View Post
    @pandy

    Now, I'm banking on you to give me the FFMPEG command to convert all 92 files to AVI container, MP3 192kbps, volume 83dB, XVID.
    I wonder if FFMPEG can take care of DC offset and those flattened peaks as hello-hello has posted above.

    All videos that I converted to AVI XVID using Video to Video Converter work fine in commercial DVD player, car Video player and TV (analog) — you may laugh all you want.

    Thanks.

    P.S. I have no idea how Video to Video Converter can deal with clipping, volume and Zero offset.
    Same as hello_hello feedback - from my perspective this clip is already overcompressed and heavily clipped, i have no clue how easily and efficiently at least restore some quality...
    Bellow my script - you may try to improve video encoding quality, i used native mpeg4 encoder as it is faster than libxvid (4+ times).
    Also i applied some filtering to audio (relatively gentle slope highpass 100Hz to remove DC and rumble at bottom of spectrum and also sharp lowpass filter on 10kHz as there is no useful signal above 8k anyway - seem that source was poor VHS with even poorer capture).
    Audio is normalized to -6.0206dBFS (it may have lover volume but it is safe). Please verify with 1 file if it works for you or not.
    I set fixed quantizer on video and audio - this mean it is pure vbr with OK quality.
    Script will create automatically folder out where converted files will be placed.
    Just copy script where your source files are located (no subfolders) also provide in same directory ffmpeg (i would advise latest Zeranoe build as i verified script with provided sample with latest build).
    Sample clip was with some corrupted data and as such not sure if this is due its nature or other factors.
    Code:
    @setlocal
    @set /a cput=(%NUMBER_OF_PROCESSORS%*3)/2
    @if not exist %cd%\out (mkdir %cd%\out)
    @for %%1 in (*.avi *.mpg) do (@ffmpeg.exe -stats -y -threads %cput% -i "%%1" -c:v mpeg4 -profile:v mpeg4_asp -slices %cput% -q:v 4 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -vtag DIVX -c:a libmp3lame -q:a 5 -af "aformat=sample_fmts=fltp,highpass=f=120,pan=stereo|FL < FL + 1.414FC + .5BL + .5SL|FR < FR + 1.414FC + .5BR + .5SR,aresample=resampler=soxr:osr=48000:dither_method=0,dynaudnorm=m=50.0:b=1:s=25.0:p=0.5,firequalizer=gain='if(lte(f,10000),0,-INF)'" -f avi "%cd%\out\%%~n1_dn.avi")
    @Echo Done!
    @pause
    Quote Quote  
  24. Originally Posted by ConverterCrazy View Post
    I can see the flat peaks and 0 offset too in the screenshots. But can't make out the software/tool you used to see them.
    The FLAC file you uploaded sounds a bit better than any version of mine.
    That's Nero Wave Editor. I'm using a pretty old version that came with the Nero 7 software suite but I think the latest version is available as a standalone program and it's free. It won't open MP2 files so I had to convert to wave file with foobar2000 first.

    Audacity will do the same thing and the old version of Nero Wave Editor I have doesn't seem to handle multi-channel audio very well (I don't even bother trying any more) but for stereo I files I like using Nero as it lets you easy zoom in and out using the mouse wheel.
    Audacity will import just about anything as it imports with ffmpeg. It's very particular about the ffmpeg version though, as it is for the Lame MP3 version. I don't know why, but these ones work.
    http://lame.buanzo.org/#lamewindl
    Last edited by hello_hello; 29th Feb 2016 at 18:41.
    Quote Quote  
  25. Common trick to remove DC aka DC bias aka DC offset is pre apply high pass filter with sufficiently low frequency (common are 5 - 10 Hz), Bessel IIR will have no (marginal) impact on phase but in many cases Butterworth is more than good (and there are IIR linear phase also).
    Quote Quote  
  26. Thanks @pandy and @hello_hello

    I ran the script and it produced 0 size .AVI files in \Out folder.

    The following msg appeared

    [AVFilterGraph @ 036582e0] No such filter: 'firequalizer'
    Error opening filters!


    Downlaoding latest FFMPEG and trying as at the time of this post.

    Current status: latest ffmpeg.exe gives this error:

    "the procedure entry point _wfopen_s could not be located in the dynamic link library msvcrt.dll"

    Don't know what it means but searching internet for solution.
    Last edited by ConverterCrazy; 2nd Mar 2016 at 09:59. Reason: Additional txt in response to the post.
    Quote Quote  
  27. Originally Posted by ConverterCrazy View Post
    Thanks @pandy and @hello_hello

    I ran the script and it produced 0 size .AVI files in \Out folder.

    The following msg appeared

    [AVFilterGraph @ 036582e0] No such filter: 'firequalizer'
    Error opening filters!


    Downlaoding latest FFMPEG and trying as at the time of this post.

    Current status: latest ffmpeg.exe gives this error:

    "the procedure entry point _wfopen_s could not be located in the dynamic link library msvcrt.dll"

    Don't know what it means but searching internet for solution.
    32 bit
    ffmpeg version N-78843-g1c7e2cf Copyright (c) 2000-2016 the FFmpeg developers
    ..C firequalizer A->A Finite Impulse Response Equalizer
    64 bit
    ffmpeg version N-78843-g1c7e2cf Copyright (c) 2000-2016 the FFmpeg developers
    ..C firequalizer A->A Finite Impulse Response Equalizer

    As you see both builds support "Finite Impulse Response Equalizer" - static from http://ffmpeg.zeranoe.com/builds/
    Not sure which Windows version you are using... perhaps XP or older, this may explain some issues with dll but perhaps newer version of dll will solve issue? Check https://support.microsoft.com/en-us/kb/2977003
    Quote Quote  
  28. I'm getting the same error.

    msvcrt.dll is in the system32 folder.

    Looks like it's XP's fault.
    https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=2477

    I tried a few older versions but that resulted either in:
    No such filter: 'firequalizer'
    Or
    No such filter: 'dynaudionorm'
    So I gave up.

    I've been using the latest ffmpeg for AC3 encoding via foobar2000 without issue though.
    Quote Quote  
  29. @pandy and @hello_hello

    Thanks.

    Installed last version compatible with XP, namely, ffmpeg-20150525-git-8ce564e-win32-static.7z

    @pandy
    Running your script gave the error with 'dynaudnorm'.

    Removed the following text:

    ,dynaudnorm=m=50.0:b=1: s=25.0: p=0.5,firequalizer=gain='if(lte(f,10000),0,-INF)'

    from the script.

    After watching the first video as above, I find audio is out of sync.
    Quote Quote  
  30. Originally Posted by ConverterCrazy View Post
    @pandy and @hello_hello

    Thanks.

    Installed last version compatible with XP, namely, ffmpeg-20150525-git-8ce564e-win32-static.7z

    @pandy
    Running your script gave the error with 'dynaudnorm'.

    Removed the following text:

    ,dynaudnorm=m=50.0:b=1: s=25.0: p=0.5,firequalizer=gain='if(lte(f,10000),0,-INF)'

    from the script.

    After watching the first video as above, I find audio is out of sync.
    At first both removed filters are most important part of this script (ok firequalizer is just sharp lowpass filter - can be skipped when you don't care if audio codec allocate bits on this part of spectrum), dynaudnorm perform audio normalization in dynamic way.

    Audio delay can be addressed at multiple levels but perhaps it is related with stream errors reported by ffmpeg? In other words seem that file provided as a sample have errors.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!