Skip to main content

Volume normalization of MP3 audio track in AVI video files

For AVI video files with MP3 audio tracks, the best way to normalize its volume without recompression involves using FFMpeg and MP3Gain:

> ffmpeg -i input.avi -vn -acodec copy -y audio.mp3
> ffmpeg -i input.avi" -an -vcodec copy -y video.avi

> mp3gain /r audio.mp3
> ffmpeg -i audio.mp3 -i video.avi -acodec copy -vcodec copy -y output.avi


In fact, AACGain in the previous post could substitute for MP3Gain as well.

So the process basically involves extracting the audio and video tracks separately from the original video file, normalizing the audio track using MP3Gain, then muxing the audio (normalized) and video tracks back again.

Since everything is command-line driven, it will be quite straightforward to create a batch/script file that performs all 4 steps in sequence.

Comments

Popular posts from this blog

Update: Line adapter for Ozito Blade Trimmer

Update (Dec 2021): If you access to a 3D printer, I would now recommend this solution , which makes it super easy to replace the trimmer line. I have been using it for a few months now with zero issue.

Cooling mod for the X96 Air

I realized after my Ugoos box died that overheating is a big problem with cheap Android TV boxes. A teardown of the Ugoos box shows that it does not have any heatsink or fan at all!  The X96 Air does have a heatsink, but the heatsink is located at the bottom of the casing with no ventilation. In this default configuration, with the ambient room temperature at 25c and playing a 1080p video, I was seeing the CPU temperature at 67c. I drilled a couple of holes at the bottom of the casing. The CPU temperature fell to 59c with the box raised about 2cm with plastic blocks. I retrieved an old 5V laptop fan: Then cut and strip away a spare USB cable: Solder the red and black wires on the fan and the cable: Secure the fan to the bottom of the casing with double-sided tape, then plug the fan into the box's USB connector. Here's a view of the box with some 3D-printed risers installed at the bottom to give the mounted fan sufficient clearance: The CPU now runs at 43c, a huge drop from the ...

Installing and customizing CoreELEC in X96 Air

I previously installed CoreELEC on another TV Box ( Ugoos X3 Pro ), which unfortunately died after only 9 months during the summer (due to the unit overheating, which I learned is a common problem for cheap Android TV boxes). So this time I purchased a X96 Air  (4GB/32Gb) and had to do the whole thing again. So this is a note-to-self in case I ever have to install CoreELEC again on some other device. Installation of CoreELEC is simple enough by following this guide . Basically, it involves downloading and writing the firmware to a microSD card using usbimager . Then insert the microSD card, reset the unit and hold the reset until the logo appears. The unit will then proceed to boot into CoreELEC. First thing is to connect to WiFi, then enable SSH. This allows me to login via ssh and execute: ceemmc -x from the terminal. This writes CoreELEC to the built-in eMMC storage, after which I am able to remove the microSD card and reboot the unit into CoreELEC via the built-in sto...