Coder Social home page Coder Social logo

denoise's Introduction

denoise

Denoise the background audio in a video file using ffmpeg, sox and libvo_aacenc to re-encode as single-channel 128k AAC.

This took me an annoyingly long time to work out how to do; hence githubbing it.

This was intended to scratch a personal itch (a very noisy itch) so open it up and edit the values before using.

Producing MP4/H.264 video with 1-channel 128k AAC headset mic-recorded screencast (I recommend SimpleScreenRecorder on linux) yielded background audio noise that this script sorts out.

To run in batch on mp4 files:

$ find . -name \*.mp4 -exec ./denoise.sh {} \;

denoise's People

Contributors

nnog avatar

Stargazers

Rustem B. avatar Florent Forest avatar Reza Hashemi avatar fcpi avatar Denis Kovalskii avatar Pantelis Koukousoulas avatar

Watchers

 avatar

denoise's Issues

sameq deprecated

Option 'sameq' was removed. If you are looking for an option to preserve the quality (which is not what -sameq was for), use -qscale 0 or an equivalent quality factor option.
Failed to set value '1' for option 'sameq': Invalid argument
Error parsing global options: Invalid argument

And that's when it exits.

You probably need "-q:a 0", not sure though.

libvo-aac encoder no longer required

In newer ffmpeg versions, the external libvo-aac encoder is no longer required. The internal AAC can be used.
Source: https://ffmpeg.org/#removing_external_aac_encoders

Hence the lines:

ffmpeg -i tmpaud-clean.wav -acodec libvo_aacenc -ab 128 -ac 1 tmpaud-clean.aac
ffmpeg -i tmpaud-clean.aac -acodec copy -i tmpvid.mp4 -vcodec copy ./clean/$1

can be replaced with

ffmpeg -i tmpaud-clean.wav -i tmpvid.mp4 -vcodec copy -strict -2 ./clean/$1

(I had to add -strict -2 to the command to enable experimental codecs, using version 2.8.17, it might not be necessary with newer versions)

Btw, I just used this method to remove awful background noise (mostly laptop fan noise) from a video presentation, and it works really great, thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.