MaartenBaert / ssr

SimpleScreenRecorder, a screen recorder for Linux
http://www.maartenbaert.be/simplescreenrecorder/
GNU General Public License v3.0
2.54k stars 289 forks source link

[Feature request] Noise reduction and other audio filters #120

Open bucaneer opened 10 years ago

bucaneer commented 10 years ago

This may not be feasible, but just in case:

A lot of games and voice chat programs (for example, Steam voice chat) appear to have some sort of realtime audio noise reduction, which is handy if you have cheap, noisy microphone and sound card. Unfortunately, I don't think ffmpeg has a decent way to deal with noise using its internal audio filters. SoX has a "noisered" filter that works about as well as noise reduction in Audacity, and it can be made to work in realtime. For example, this command:

sox -q -t alsa hw:0,0 -t wav - noisered ~/noiseprof 0.2 | \
ffmpeg -f wav -ss 2 -i -  -f x11grab -s 1920x1080 -i :0.0 out.mkv

will record desktop video and noise-cleaned microphone audio in sync (until ffmpeg desyncs them, of course). The two second seek (-ss 2) is there to account for the time it takes for ffmpeg to start recording (no harm seeking further). ~/noiseprof is the noise profile prepared in advance as explained in the manual.

I wonder if something like this could be implemented on the library level in ssr. It's not very important for local recording because audio can be cleaned up in post-production before publishing the video, but it would be useful for live streaming. And if SoX filters could be implemented in a more generalized way, it would allow the use of other handy tools like equalizer, volume normalization, dynamic range compression, etc.

MaartenBaert commented 10 years ago

This is probably out of scope for SSR. The next version of SSR has JACK support, so you can combine SSR with any other JACK application to apply various audio effects (e.g. any LADSPA effect). I'm pretty sure that there are some noise reduction effects out there. If not, I could write one based on the noise reduction API in libspeex.

ubuntuaddicted commented 10 years ago

i'd love this since i do my livestreams from my basement where the furnace is and when it kicks on, people in the stream can hear it. when i do normal recordings, i use audacity and use the "noise removal" effect and it works great. if i could somehow apply a noise removal effect to my mic input for my livestreams that would be awesome

ceefour commented 9 years ago

Thank you @MaartenBaert for developing SimpleScreenRecorder, very useful! I use it for recording e.g. my [https://www.youtube.com/playlist?list=PLKF12aQHzSaOohIwGdrVZvkTXQT5ZEPQW](MATLAB/GNU Octave Tutorial videos on YouTube].

I hope you can use the excellent Noise Removal code from audacity: https://code.google.com/p/audacity/source/browse/audacity-src/trunk/src/effects/NoiseRemoval.cpp

A noise removal profile is required, this can be gathered before actual recording.

StripedMonkey commented 9 years ago

I second this, Its a feature that would be welcomed by almost everybody and would reduce the amount of programs I have in the background while recording.

On Fri, Mar 27, 2015 at 6:29 AM, Hendy Irawan notifications@github.com wrote:

Thank you @MaartenBaert https://github.com/MaartenBaert for developing SimpleScreenRecorder, very useful! I use it for recording e.g. my [ https://www.youtube.com/playlist?list=PLKF12aQHzSaOohIwGdrVZvkTXQT5ZEPQW](MATLAB/GNU Octave Tutorial videos on YouTube].

I hope you can use the excellent Noise Removal code from audacity: https://code.google.com/p/audacity/source/browse/audacity-src/trunk/src/effects/NoiseRemoval.cpp

A noise removal profile is required, this can be gathered before actual recording.

— Reply to this email directly or view it on GitHub https://github.com/MaartenBaert/ssr/issues/120#issuecomment-86894695.

MaartenBaert commented 9 years ago

Coincidentally I already have a proof-of-concept real-time noise removal filter written in Octave :). I wrote it long ago, but I haven't had time yet to convert it to efficient C++ code for SSR. The filter is at least as good as the one in Audacity, and in some cases better (but I guess 'better' is very subjective when it comes to noise filters). I am still planning to implement it, but I have other priorities now.

StripedMonkey commented 9 years ago

We are all eagerly awaiting your completion of the new GLinject stuff so that these more minor features can be added

On Fri, Mar 27, 2015 at 8:28 PM, MaartenBaert notifications@github.com wrote:

Coincidentally I already have a proof-of-concept real-time noise removal filter written in Octave :). I wrote it long ago, but I haven't had time yet to convert it to efficient C++ code for SSR. The filter is at least as good as the one in Audacity, and in some cases better (but I guess 'better' is very subjective when it comes to noise filters). I am still planning to implement it, but I have other priorities now.

— Reply to this email directly or view it on GitHub https://github.com/MaartenBaert/ssr/issues/120#issuecomment-87130587.