Noise reduction in audio track of a video
In the spirit of doing as much as work via command line, I removed a noisy audio from a tech talk I wanted to view. This is just a note to my future self to the way I did it.
Steps:
-
Separate audio from video
strip_audio video_file.mp4
-
Generate noise profile of the video
sox audio_file.mp3 -n trim 0 2.5 np.noise_profile
-
Remove the noise
sox audio_file.mp3 cleaned.mp3 noisered np.noise_profile .2
-
Replace the video with the new audio
ffmpeg -i video_file.mp4 -i cleaned.mp3 -map 0:v -map 1:a -codec copy -shortest out.mp4
Note:
strip_audio
can be installed viagem install strip_audio
sox
can be installed viabrew install sox --with-mad --with-lame