Skip to content

Instantly share code, notes, and snippets.

@Overload119
Last active January 25, 2021 01:04
Show Gist options
  • Save Overload119/5817fa7963202405420c2804195dd133 to your computer and use it in GitHub Desktop.
Save Overload119/5817fa7963202405420c2804195dd133 to your computer and use it in GitHub Desktop.
Using ffmpeg to reduce background nois.md

Scenario:

I have a file I recorded. It has background noise I want to remove (fans, clicking, etc.) Works good for fans but a little less well for clicking.

  1. Extract the audio file from the video
ffmpeg -i <path> -vn -acodec copy output-audio.aac
  1. Pipe it through a rnn model.
ffmpeg -i <audiopath> -af arnndn=m=<path to model>

For path to model I just downloaded the std model from https://github.com/GregorR/rnnoise-models

  1. Recombine the new audio with the video
ffmpeg -i v.mp4 -i a.wav -c:v copy -map 0:v:0 -map 1:a:0 new.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment