Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
How to normalize audio when downloading video (not extract mp3) #11025
Comments
|
Are there programs with audio normalization algorithms? From Wikipedia, seems it requires some sort of signal processing. That's far beyond the scope of youtube-dl. If such a program requires only a filename, |
|
Yes, ffmpeg does it. The youtube-dl documentation explains how to do it, but only when you stip the mp3 from a video file. I don't want to strip the audio, I just want to normalize it and keep it in the video container or reinsert it in the video container. "normalization" is nothing more than audio compression. |
Could you share your command? |
|
I'm having trouble finding the information I read earlier. I will keep looking. I do know of another way to do it if the audio is piped to mp3gain and the following is ran:
|
|
Here is a normalization script that uses ffmpeg: |
|
I'm wondering if youtube-dl could somehow pipe the video to the ffmpeg-normalize script (which can handle mkv, mp4, and avi files). I wish I could find the information I found earlier. This should be enough to get us moving in that direction. |
|
OK, I'm finding some of the information I found earlier. Although ffmpeg-normalize probably does a better job, here is what's built into ffmpeg as is: Built-in Normalization FiltersCurrent ffmpeg has two filters that can be directly used for normalization – although they are already quite advanced, so they do not simply apply gain. Here they are:
If we want a “simple” RMS-based normalization to 0 dBFS, that is what ffmpeg-normalize does. |
That's possible in general. Like this: |
|
I will have to test this. I will post anything and everything I find here. Do you have any more specifics to offer on the ffmpeg side of the pipe? Thank you. |
|
Pipe protocol may be useful. |
|
in ffmpeg it's So it would be cool to have something like |
|
It seems like youtube returns perceptualLoudnessDb, which can be passed to a ffmpeg audio filter like alimiter to achieve the same effect |
|
I just wanted to contribute some information; documentation I came across while researching how to do this manually. There is a script you can use to automate this called
|
|
I noticed there's an option to supply extra parameters to the postprocessor so you can do the normalization easily with |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2016.10.25. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
Description of your issue, suggested solution and other information
I would like to use youtube-dl to download video's, normalizing the audio in the process. I understand how to extract an MP3 from the video stream and normalize that, but I would like to have the Video and normalized audio in the container. It seams plausible this could be accomplished during the download, I just don't know how. If not, it seems like it would be easy to incorporate. The reason this is needed is for downloading recordings of conference sessions, such as Blackhat 2016 briefings, and Defcon sessions. They tend to have microphone volumes all over the place, and when the mic is handed off to someone else you get the hell scared out of your because it's so loud. Help would be greatly appreciated. I'm posting this on behalf of myself, and 3 others in need of the same process. Thank you for your time.