Change volume level to -12db

Questions and answers on how to get the most out of FFAStrans
movalex
Posts: 36
Joined: Thu Feb 06, 2020 2:23 pm

Change volume level to -12db

Post by movalex »

Hi!
I'd like to export DV Avi file with the audio level just dialed down to -12db. I tried to use A/V Media --> Normalize, but DV encoder returns error that no audio or video was found. I don't need to do any loudness control and conform, just to dial down the audio level. What is the best way to do that?
UPD: added the workflow that fails to work.
Attachments
NAEFIR_copy.json
(8.54 KiB) Downloaded 382 times
momocampo
Posts: 595
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Change volume level to -12db

Post by momocampo »

Hello Movalex,

So, I tried your workflow and in I just have an issue with the variable %s_peaks% because it doesn't populate elsewhere into your workflow. Even I untick it, the issue was still here so maybe a bug in FFAStrans( need to confirm that with the team).
Anyway, you can try the next workflow (just with a new DV encoder, the -12 db still remains and it works for me).

Let us know it it works well.
Cheers.

B.
Attachments
NAEFIR_copy2.json
(8.55 KiB) Downloaded 365 times
movalex
Posts: 36
Joined: Thu Feb 06, 2020 2:23 pm

Re: Change volume level to -12db

Post by movalex »

Unfortunately it didn't work. The error is the same, "No video or audio found in media."
Other workflows work fine.
Here's the log.
The version is 1.0.0.43
Attachments
logffa.txt
(64.53 KiB) Downloaded 352 times
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Change volume level to -12db

Post by admin »

Hi movalex (and Ben :-))

I can confirm the bug about the variable "blocking" even if you untick conform volume, so this will be fixed. Other than that you should update to 1.2.1 as it works in that version, but you will have to remove the DV node and insert it again without ticking the volume conforming.

Hope this helps and thanks for reporting! :-)

-steinar
movalex
Posts: 36
Joined: Thu Feb 06, 2020 2:23 pm

Re: Change volume level to -12db

Post by movalex »

cool, thanks, time to upgrade!
movalex
Posts: 36
Joined: Thu Feb 06, 2020 2:23 pm

Re: Change volume level to -12db

Post by movalex »

Normalize confirmed working in 1.2.1! Thanks!
May I ask a related question in this topic?
I'd like to set the volume to -12Db based on clip peaks.
So basically if I have sample peaks 0 Db, the normalize would be -12.
If the peak is -8, normalize would be -12-(-8) = -4Db.
If the peaks is -18, Normalize would be -12-(-18)=+6db.
Is it possible?
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Change volume level to -12db

Post by emcodem »

hey @movalex

doesnt that mean that after all you always end up with -12db?
If so, a simple workflow with not more than analyze loudness and encode node should do... in the analyze node you choose some variable to store the peaks and you use the same variable in the "conform volume to - from table" dropdown of the encode node...
Or did i get what you want totally wrong?
emcodem, wrapping since 2009 you got the rhyme?
movalex
Posts: 36
Joined: Thu Feb 06, 2020 2:23 pm

Re: Change volume level to -12db

Post by movalex »

Oh, I guess I totally got wrong the conform volume thing then. Yes, the end file should always be -12db.
When I use Normalize node and set it to -12db, the result is predictably dialed down to -12.
But when I use Loudness-Conform workflow and set Conform to -12 and use the table value of Sample peaks, the files conformed to approximately -12
Sample peaks values for both files were correct, for 0Db file it was [0,0], and for-12Db [-12,-12].
But the values sometimes go up to -11.6, and this file will not be accepted (we have strict -12db requirement).
I actually tested three clips now, 0db, -6db and -12db, and all three of them produce files with peaks up to -11.6. Is it how it supposed to work? Maybe I somehow should add a -12 limiter to a produced file?
Last edited by movalex on Thu Sep 30, 2021 11:18 am, edited 2 times in total.
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Change volume level to -12db

Post by emcodem »

ok as this topic is really complex and there can be lots of mistakes made, i tested and created a sample workflow for you.
Up in front, i believe it is not possible to get a more accurate loudness correction in a Single step, the values you name, e.g. 11.6 seem to be ok for me. @admin might know more hints on that. I think that +-1db is fine because thats at least in EBU R128 the case. How much tolerance Do you have?
Anyway i guess to get closer, one way would be 2-pass.. First create a normalized Audio only Variant, Analyse it, compare the value and use the difference for the final encoding. Sure the compression of the step 1 normalized Audio only track should be the same as the final product.
emcodem_sample_2step_loudness.json
(11.83 KiB) Downloaded 389 times
In theory above workflow would work and it should get you a lot closer to the exact -12db but on my way i found another central bug in ffastrans which prevents us from using variables for the target loudness db value in encoder nodes.
So above workflow actually will work in the upcoming 1.3 release but not below.

Note that i dont have lots of experience with different normalisations, i only need R128 and this is very easy to do. So there might be a lot smarter ways how to do it as you suggested...

What the workflow does:
1) analyze original file loudness
2) encode the final product (only with a very small video resolution) using the final audio encoder (AAC in this example) and settings - apply normalisation using previously analyzed loudness to -12
3) analyze the encoded file and calculate the difference between -12 and the actual current value
4) encode the final product again but this time set all settings to final, e.g. video resolution and all others. This time we use the difference between -12 and the value from the first normalisation, e.g. i had one test file that was encoded with 10.7 in the first pass, so i needed to normalize to 13.3 in the second step to get it exactly to -12db

OK but after all, as you say, we can also use the avisynth normalize filter, we just need to calculate the DB difference between the original and the -12db.
So, using above workflow as a starting point, i created this, which might be exactly what you want.
I am not 100% sure if it is exactly the same especially because we measure the audio in it's uncompressed form and then compress it, which might change the loudness (i guess), but you will see anyway :D
emcodem_use_loudness_analyze_and_filter.json
(9.3 KiB) Downloaded 368 times
But, beware... at least using the freely available EBU loudness sample files, above workflow also produced some strange values:
ebuloudnessfiles.png
ebuloudnessfiles.png (522.42 KiB) Viewed 6973 times
emcodem, wrapping since 2009 you got the rhyme?
movalex
Posts: 36
Joined: Thu Feb 06, 2020 2:23 pm

Re: Change volume level to -12db

Post by movalex »

Omg, huge thanks for this work! I will need some time to test this out and will be back asap.
BTW I guess the values below -12, such as -12.3 are fine. They just should not go higher than that. But anyway this is just amazing what you can achieve with FFastrans.
Last edited by movalex on Sat Sep 21, 2024 9:28 pm, edited 1 time in total.
Post Reply