Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Independent Channel Normalization #687

Open
Funtime60 opened this issue Jul 24, 2024 · 1 comment
Open

Independent Channel Normalization #687

Funtime60 opened this issue Jul 24, 2024 · 1 comment

Comments

@Funtime60
Copy link

The default audio normalization plugin is the easiest, possibly only, way of normalizing audio with 2 passes. It would be nice if it could be used on each channel independently to fix audio balance issues.

Currently it seems to use:
ffmpeg -i args.inputFileObj._id -af "loudnorm=I=".concat(loudNorm_i, ":LRA=").concat(lra, ":TP=").concat(tp, ":print_format=json") -f null NUL -map 0 -c copy
and:
ffmpeg -i args.inputFileObj._id -map 0 -c copy -c:a aac -b:a 192k -af "loudnorm=print_format=summary:linear=true:I=".concat(loudNorm_i, ":LRA=").concat(lra, ":TP=").concat(tp, ":") + "measured_i=".concat(loudNormValues.input_i, ":") + "measured_lra=".concat(loudNormValues.input_lra, ":") + "measured_tp=".concat(loudNormValues.input_tp, ":") + "measured_thresh=".concat(loudNormValues.input_thresh, ":offset=").concat(loudNormValues.target_offset, " ") outputFilePath

By replacing the first one with:
ffmpeg -filter_complex 'channelsplit=channel_layout=stereo[l][r];[l]loudnorm=print_format=json,aformat=sample_rates=48000:channel_layouts=mono[l2];[r]loudnorm=print_format=json,aformat=sample_rates=48000:channel_layouts=mono[r2];[l2][r2]join[out]' -map "[out]" -f null -
and adjusting the second one to use the extra info

It can independently normalize each channel in a stereo audio file and this could be expanded to accept any channel count.

I'm pretty sure I could get the JS and the FFmpeg to work myself, I just don't know how to give it to github. Do I fork and do it there...?

@Funtime60
Copy link
Author

Nevermind me doing this myself, I have no idea how to test any of the changes I'd need to make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant