Saturday, December 22, 2018

Noise removal (sox) and fixing video/audio merge (ffmpeg)

When you have some audio and it's noisy, remove the noise with this:

# Create background noise profile from mp3
/usr/bin/sox noise.mp3 -n noiseprof noise.prof

# Remove noise from mp3 using profile
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21
Referral:
https://unix.stackexchange.com/questions/425853/how-to-clear-background-noises-with-sox

_____________________________________________________________________________
When you're merging audio and video with ffmpeg, and your video ends up silent, remember to map the video and audio streams from the two files explicitly:
ffmpeg -y -i merged.mp4 -i combined.mp3 -c:a aac -map 0:v -map 1:a output.mp4
Referral:
https://unix.stackexchange.com/questions/425853/how-to-clear-background-noises-with-sox