Need a quick, easy and free way of cleaning up a video’s audio from background noise? Follow the steps below.

First get and install the tools:

Then clean your noise!

  1. Split the audio and video streams into 2 seperate files:
    The VIDEO stream: ffmpeg -i input.mp4 -sameq -an tmpvid.mp4
    The AUDIO stream: ffmpeg -i input.mp4 -sameq tmpaud.wav 
  2. Generate a sample of noise from the audio of the file:
    ffmpeg -i input.mp4 -vn -ss 00:00:00 -t 00:00:01 noiseaud.wav
    -ss: the time offset from beginning. (h:m:s.ms).
    -t duration: record or transcode duration seconds of audio/video.
    Choose a segment of the audio where there’s no speech, only noise (e.g. speaker was silent for a sec).
  3.  Generate a noise profile in sox:
    sox noiseaud.wav -n noiseprof noise.prof
  4. Clean the noise samples from the audio stream:
    sox tmpaud.wav tmpaud-clean.wav noisered noise.prof 0.21
    Change 0.21 to adjust the level of sensitivity in the sampling rates (I found 0.2-0.3 often provides best result).
  5. Merge the audio and video streams back together:
    ffmpeg -i tmpaud-clean.wav -i tmpvid.mp4 -sameq vid.mp4
I’m thinking of automating this via a web interface that allows uploading a video file, selection of the noise sample and playing with the noisered levels producing a cleaned version… think it’s a useful tool?
  • Usp71084

    Thanks..I was looking exactly for this. 

  • Karthik

    THanks! this was very useful!! :)

  • Dan LaMotte

    This was very useful. Thanks!

  • http://www.zoharbabin.com Zohar Babin

    thanks for the great feedback :)

  • gondoSVK

    is it possible to generate the profile and clean the noise in 1 command?

  • http://www.zoharbabin.com Zohar Babin

    Wish there was, however I don’t think so… I’d also like to find an automatic way to find the time in the video where the noise happens on its own, so that we could generate the profile automatically.

  • gondoSVK

    actually there is:
    sox input.wav -n noiseprof | sox input.wav output.wav noisered – 0.2

    im having consistent noise so i can just take first 0,5s of the sound to profile it

  • http://www.zoharbabin.com Zohar Babin

    you cheated ;) using pipe is still two separate commands, only called on the same line…

  • gondoSVK

    hah but its not saving/reading anything from the hdd what was the main point of “1 command” anyways :)
    edit: by anything i mean profile file :p

  • Pingback: Videolardan Gürültü Kaldırma | Emre Aladağ'ın Kişisel Sitesi