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. |
![]() |
#141 | Link | |
Registered User
Join Date: Jun 2017
Posts: 47
|
Quote:
Is there a limit for the loss factor as there is for the gain factor? Last edited by kolamorx; 29th July 2017 at 22:38. |
|
![]() |
![]() |
![]() |
#142 | Link | |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,258
|
Quote:
However, if you use a tool like DynamicAudioNormalizer, it usually means that "traditional" normalization doesn't work on your file, because the "loud" sections are at maximum signal level already and yet the "quiet" sections are still too silent. After all, the DynamicAudioNormalizer is not about "increasing" the volume (you could achieve that by simply turning up your speakers). It is all about "equalizing" the volume of "quiet" and "loud" sections ![]()
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 29th July 2017 at 23:20. |
|
![]() |
![]() |
![]() |
#143 | Link |
Registered User
Join Date: Jun 2017
Posts: 47
|
So, I guess I don't really understand how this tool works.
I tought that if, for example, the loud parts are 90dB, the quiet parts are 65dB, and you set the target value to 80dB- it decreases the loud parts by 10dB and increases the quiet parts by 15dB. |
![]() |
![]() |
![]() |
#144 | Link | |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,258
|
Quote:
The more simple "volume" filter will just apply the same fixed amplification factor to all samples. So, if the "loud" sections of your file already are at maximum signal level, then the "volume" filter can not further increase the volume of your file, as this would unavoidably result in clipping (in the "loud" sections). In other words, with the "volume" filter, the "loud" sections may prevent further amplification of the "quiet" sections. The DynamicAudioNormalizer can help in this situation. If, on the other hand, the "loud" sections of your file are not at maximum signal level yet, i.e. there is some "headroom" in your file, then the "volume" filter can increase the volume of your file – to the extent that brings the "loud" sections to the maximum signal level. But even in that case, the "volume" filter does not "equalize" the volume of "quiet" and "loud" sections! It's just like turning up the volume of your speakers a little more. There is no "dynamic" adjustment. Still, if you actually do have some "headroom" in your file, I would suggest to apply the "volume" filter first, to get "traditional" normalization. And then, if still required, use DynamicAudioNormalizer to bring up the "quiet" section some more...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 30th July 2017 at 00:50. |
|
![]() |
![]() |
![]() |
#146 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,258
|
For example, with the "volumedetect" filter:
https://ffmpeg.org/ffmpeg-filters.html#volumedetect (it is max_volume that you are interested in)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
![]() |
![]() |
![]() |
#148 | Link | |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,258
|
Quote:
If the "quiet" sections really are that much quieter than the "loud" sections that even an amplification by 100× (+40 dB) doesn't suffice, it probably means that the "quiet" sections are already lost in the noise. Again: Don't use DynAudNorm to eliminate the "headroom" in your file. Use a "traditional" normalizer for that purpose. Use the DynAudNorm to "equalize" the volume of "quiet" and "loud" sections...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 30th July 2017 at 18:46. |
|
![]() |
![]() |
![]() |
#149 | Link | ||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,113
|
Quote:
I downloaded a short random clip with "sane" audio levels and did a few tests: The source had these levels: Integrated Loudness: -19.83 LUFS Sample Peak: -6.07 SPFS After conversion using DynAudNorm with default settings: Integrated Loudness: -12.72 LUFS Sample Peak: -0.45 SPFS This time using peak normalizing first followed by DynAudNorm with default settings: Integrated Loudness: -12.64 LUFS Sample Peak: -0.36 SPFS The loudness values are almost identical for both conversions. At least for "sane" source audio levels it is not necessary to apply regular peak normalization before DynAudNorm. Just for fun I converted the same clip using the LoudNorm filter which is part of current FFmpeg versions. Since I do not like the defaults all that much I used the following parameters: Quote:
Integrated Loudness: -16.27 LUFS Sample Peak: -0.96 SPFS To my ears this conversion did sound a little better than DynAudNorm, and it has the advantage that a target LUFS level can be specified. Cheers manolito |
||
![]() |
![]() |
![]() |
#151 | Link |
brontosaurusrex
Join Date: Oct 2001
Posts: 2,392
|
Anyone using loudnorm and if so with what settings? Defaults are kinda ok, if a little sissy (lacks a bit of dynamics).
Have this in mpv input.conf Code:
F1 cycle-values af "lavfi=[dynaudnorm=s=30]" "lavfi=[loudnorm]" ""
__________________
certain other member |
![]() |
![]() |
![]() |
#152 | Link | ||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,113
|
The effect of LoudNorm depends a lot on the parameters, it goes from subtle to very strong dynamic compression.
These are the FFmpeg defaults: Quote:
The target Integrated loudness is quite low, it complies to the ATSC standard. For EBU R128 it would be -23, for ReplayGain it is -18. The target loudnesss range is small, it results in a strong dynamic compression. True peak is OK, maybe it could be increased a little to -1.5 or even -1. There is a GUI for LoudNorm called WinLoud (by Muxson). His defaults are optimized for podcasts, see them here: http://www.muxson.com/winloud The author of Loudnorm prefers different values again: http://k.ylo.ph/2016/04/04/loudnorm.html And myself I do not want too strong dynamic compression, and my target level is Replaygain. So I use Quote:
Cheers manolito |
||
![]() |
![]() |
![]() |
#154 | Link | |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,258
|
Quote:
In that situation a "traditional" (non-dynamic) normalizer will do exactly nothing, because the "loudest" peaks prevent further amplification without clipping. But a tool like DynAudNorm (or maybe LoudNorm) might be used to bring up the "quiet" sections a little more – provided that there are some long enough "quiet" sections that are significant quieter than the "loudest" sections. Still, after such processing, a "traditional" (non-dynamic) normalizer will again do exactly nothing, because the "loudest" peaks still are at maximum signal level (or just below) and therefore further amplification is still prevented. Summary: With a properly produced/leveled recoding, a "traditional" normalizer is pretty pointless. My point was: If you have a poorly leveled recording, where even the "loudest" peaks are way below the maximum signal level, i.e. the recording does not utilize the complete signal range, then the first step should be using a "traditional" (non-dynamic) normalizer in order to get rid of the unused "headroom". A tool like DynAudNorm is not needed (and probably not the best choice) for that purpose. If and only if, after the "traditional" (non-dynamic) normalization you still think that the volume of the "quiet" sections should be brought up more closely to the "loud" sections, then a tool like DynAudNorm is the right tool. Used in the right way, a max. amplification factor of 100× should be more than you'll ever need.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 31st July 2017 at 22:07. |
|
![]() |
![]() |
![]() |
#155 | Link | |
Registered User
Join Date: Oct 2009
Location: crow-land
Posts: 543
|
Quote:
Code:
REM snip set audiofreq=48000 set audiobitrate=384k SET audiodelayadjms=010 set AudioDelayms=000 REM audiodelayadjms delays audio just a tad extra .01s so that it comes out after the lips move REM AudioDelayms is the final calculated delay for audio with audiodelayadjms added to it SET lI=-16 SET lTP=0.0 SET lLRA=11 REM snip REM to adjust Audio volume. find the loudness parameters in a first pass ECHO !DATE! !TIME! ***************************** start Find Audio Loudness ***************************** >> "%vrdlog%" 2>&1 ECHO file "%~f1" ... ECHO "%ffmpegexex64%" -threads 0 -nostats -nostdin -y -hide_banner -threads 0 -i "%~1" -vn -threads 0 -af loudnorm=I=%lI%:TP=%lTP%:LRA=%lLRA%:print_format=json -threads 0 -f null - >> "%vrdlog%" 2>&1 "%ffmpegexex64%" -threads 0 -nostats -nostdin -y -hide_banner -threads 0 -i "%~1" -vn -threads 0 -af loudnorm=I=%lI%:TP=%lTP%:LRA=%lLRA%:print_format=json -threads 0 -f null - 2> "%jsonFile%" SET EL=!ERRORLEVEL! IF /I "!EL!" NEQ "0" ( Echo ********* Error !EL! was found >> "%vrdlog%" 2>&1 Echo ********* Error !EL! was found >> "%vrdlog%" 2>&1 Echo ********* Error !EL! was found Echo ********* ABORTING ... >> "%vrdlog%" 2>&1 %xpause% EXIT !EL! ) REM all the trickery below is simply to remove quotes and tabs and spaces from the json single-level response set input_i= set input_tp= set input_lra= set input_thresh= set target_offset= for /f "tokens=1,2 delims=:, " %%a in (' find ":" ^< "%jsonFile%" ') do ( set "var=" for %%c in (%%~a) do set "var=!var!,%%~c" set var=!var:~1! set "val=" for %%d in (%%~b) do set "val=!val!,%%~d" set val=!val:~1! REM echo .!var!.=.!val!. IF "!var!" == "input_i" set !var!=!val! IF "!var!" == "input_tp" set !var!=!val! IF "!var!" == "input_lra" set !var!=!val! IF "!var!" == "input_thresh" set !var!=!val! IF "!var!" == "target_offset" set !var!=!val! ) echo input_i=%input_i% >> "%vrdlog%" 2>&1 echo input_tp=%input_tp% >> "%vrdlog%" 2>&1 echo input_lra=%input_lra% >> "%vrdlog%" 2>&1 echo input_thresh=%input_thresh% >> "%vrdlog%" 2>&1 echo target_offset=%target_offset% >> "%vrdlog%" 2>&1 REM check for bad loudnorm values ... if baddies found, use dynaudnorm instead set AUDprocess=loudnorm IF /I "%input_i%" == "inf" (set AUDprocess=dynaudnorm) IF /I "%input_i%" == "-inf" (set AUDprocess=dynaudnorm) IF /I "%input_tp%" == "inf" (set AUDprocess=dynaudnorm) IF /I "%input_tp%" == "-inf" (set AUDprocess=dynaudnorm) IF /I "%input_lra%" == "inf" (set AUDprocess=dynaudnorm) IF /I "%input_lra%" == "-inf" (set AUDprocess=dynaudnorm) IF /I "%input_thresh%" == "inf" (set AUDprocess=dynaudnorm) IF /I "%input_thresh%" == "-inf" (set AUDprocess=dynaudnorm) IF /I "%target_offset%" == "inf" (set AUDprocess=dynaudnorm) IF /I "%target_offset%" == "-inf" (set AUDprocess=dynaudnorm) REM REM later, in a second encoding pass we MUST down-convert from 192k (loadnorm upsamples it to 192k whis is way way too high ... use -ar 48k or -ar 48000 REM IF /I "%AUDprocess%" == "loudnorm" ( ECHO "Proceeding with normal LOUDNORM audio normalisation ..." >> "%vrdlog%" 2>&1 ECHO "Proceeding with normal LOUDNORM audio normalisation ..." set loudnormfilter=loudnorm=I=%lI%:TP=%lTP%:LRA=%lLRA%:measured_I=%input_i%:measured_LRA=%input_lra%:measured_TP=%input_tp%:measured_thresh=%input_thresh%:offset=%target_offset%:linear=true:print_format=summary echo "loudnormfilter=%loudnormfilter%" >> "%vrdlog%" 2>&1 ) ELSE ( ECHO "********* ERROR VALUES DETECTED FROM LOUDNORM - Doing UNUSUAL dynaudnorm audio normalisation instead ..." >> "%vrdlog%" 2>&1 ECHO "********* ERROR VALUES DETECTED FROM LOUDNORM - Doing UNUSUAL dynaudnorm audio normalisation instead ..." >> "%vrdlog%" 2>&1 ECHO "********* ERROR VALUES DETECTED FROM LOUDNORM - Doing UNUSUAL dynaudnorm audio normalisation instead ..." ECHO "********* ERROR VALUES DETECTED FROM LOUDNORM - Doing UNUSUAL dynaudnorm audio normalisation instead ..." set loudnormfilter=dynaudnorm echo "loudnormfilter=%loudnormfilter% (Should be dynaudnorm)" >> "%vrdlog%" 2>&1 ) ECHO !DATE! !TIME! ***************************** end Find Audio Loudness ***************************** >> "%vrdlog%" 2>&1 REM ------------------------------ audio conversion ------------------------------ echo !DATE! !TIME! ***************************** start ffmpeg %makeaudiotype% AUDIO conversion ***************************** >> "%vrdlog%" 2>&1 REM mp3 audio conversion "%~f1" ... IF /I "%makeaudiotype%" == "mp3" ( ECHO mp3 audio conversion "%~f1" ... >> "%vrdlog%" 2>&1 ECHO mp3 audio conversion "%~f1" ... ECHO "%ffmpegexex64%" -threads 0 -nostats -threads 0 -i "%~1" -threads 0 -vn -threads 0 -map_metadata -1 -af %loudnormfilter% -c:a libmp3lame -ab %audiobitrate% -ar %audiofreq% -threads 0 -y "%parmp3%" >> "%vrdlog%" 2>&1 "%ffmpegexex64%" -threads 0 -nostats -threads 0 -i "%~1" -threads 0 -vn -threads 0 -map_metadata -1 -af %loudnormfilter% -c:a libmp3lame -ab %audiobitrate% -ar %audiofreq% -threads 0 -y "%parmp3%" >> "%vrdlog%" 2>&1 SET EL=!ERRORLEVEL! IF /I "!EL!" NEQ "0" ( Echo ********* Error !EL! was found >> "%vrdlog%" 2>&1 Echo ********* Error !EL! was found >> "%vrdlog%" 2>&1 Echo ********* Error !EL! was found Echo ********* ABORTING ... >> "%vrdlog%" 2>&1 %xpause% EXIT !EL! ) ) REM aac audio conversion "%~f1" ... IF /I "%makeaudiotype%" == "aac" ( ECHO aac audio conversion "%~f1" ... >> "%vrdlog%" 2>&1 ECHO aac audio conversion "%~f1" ... ECHO "%ffmpegexex64%" -threads 0 -nostats -threads 0 -i "%~1" -threads 0 -vn -threads 0 -map_metadata -1 -af %loudnormfilter% -c:a libfdk_aac -cutoff 18000 -ab %audiobitrate% -ar %audiofreq% -threads 0 -y "%paraac%" >> "%vrdlog%" 2>&1 "%ffmpegexex64%" -threads 0 -nostats -threads 0 -i "%~1" -threads 0 -vn -threads 0 -map_metadata -1 -af %loudnormfilter% -c:a libfdk_aac -cutoff 18000 -ab %audiobitrate% -ar %audiofreq% -threads 0 -y "%paraac%" >> "%vrdlog%" 2>&1 SET EL=!ERRORLEVEL! IF /I "!EL!" NEQ "0" ( Echo ********* Error !EL! was found >> "%vrdlog%" 2>&1 Echo ********* Error !EL! was found >> "%vrdlog%" 2>&1 Echo ********* Error !EL! was found Echo ********* ABORTING ... >> "%vrdlog%" 2>&1 %xpause% EXIT !EL! ) ) echo !DATE! !TIME! ***************************** end ffmpeg %makeaudiotype% AUDIO conversion ***************************** >> "%vrdlog%" 2>&1 REM snip Last edited by hydra3333; 2nd September 2017 at 11:57. Reason: spelling |
|
![]() |
![]() |
![]() |
#156 | Link |
brontosaurusrex
Join Date: Oct 2001
Posts: 2,392
|
^ That any different than ˇ ?
Code:
mpv --af=lavfi=[loudnorm] file.mp4 To test: Code:
af=lavfi=[loudnorm=LRA=10]
__________________
certain other member Last edited by smok3; 4th September 2017 at 18:26. |
![]() |
![]() |
![]() |
#157 | Link |
Registered User
Join Date: Feb 2009
Location: USA
Posts: 676
|
Just a quick question, and an observation if you will... (this is a big thread)
Q: How concurrent is the ffmpeg filter with your source builds? In terms of any major improvements. I'm probably going to be writing myself a huge script of some sort, or maybe even a program, to automate batch processing of audio tracks from movies (I'm trying to automate the whole encoding chain really, video, subs, etc), so the less tools I have keep track of the better. Keeping it all inside ffmpeg would be preferable. The observation: I think someone may have posted something similar to this a few pages back, but I've pretty much been up and down the race track trying out different methods of downmixing multichannel (5.1, 7.1) audio tracks to Stereo and avoiding the dynamic range problems associated with it. At first when I was playing with dynaud in ffmpeg, I wasn't noticing much difference, then I downloaded the CLI off Mulder's repo, and noticed a big improvement in reaching what I was trying to achieve. The one major difference was when I used Mulder's CLI I was operating on a Stereo track generated from ffmpeg with -ac 2. while trying the filter in ffmpeg though I was feeding it the AC-3 source directly though (I did throw -ac 2 before the filter also). There is a distinct difference in my opinion. So I re-ran the Stereo track through ffmpeg and got pretty much the same result as using the separate CLI . I'm not an audio expert by any means, but I would say there is around a 1dB difference or more in loudness. Is there a reason for that? It seems like for my workflow I need to generate a Stereo track as an intermediate file, and then re-filter that file to get my final output. It goes pretty fast so I don't really care, just found it odd. if needed I can probably find some time to trim a sample clip and provide an example package if that suits you. |
![]() |
![]() |
![]() |
#159 | Link |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,258
|
There haven't been any significant improvements to the "core" algorithm, only a few fixes here and there.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
![]() |
![]() |
![]() |
#160 | Link |
Registered User
Join Date: Jun 2017
Posts: 47
|
Hello.
I've read your documentation about the maximum gain factor, that ususally it's not recommended to increase the value above the default but sometimes it may be necessary to allow higher gain factors. So if I understood correctly (and from my experience), when you have to allow higher gain factors, it's better to set it as less value as possible. What free tool for Windows do you recommend for volume measurement, so I can get data about the dialogue volume levels in some scenes per movie (which sometimes are very low), in order to set the maximum gain factor as less value as possible? Last edited by kolamorx; 7th May 2018 at 15:09. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|