diff options
author | Srikant Patnaik | 2015-02-20 11:52:00 +0530 |
---|---|---|
committer | Srikant Patnaik | 2015-02-20 11:52:00 +0530 |
commit | 9f48ccddab51ca849476ce3f5939a04857366e48 (patch) | |
tree | 44425c207a1dcfe3d214df4b5608d8685c108e9e /opt/noNoise-master/noNoise.sh | |
parent | 6a7ac64a90782eb300fa8a76e81b55c51e5a3cdb (diff) | |
download | FOSSEE-netbook-tools-NoNoise-1.tar.gz FOSSEE-netbook-tools-NoNoise-1.tar.bz2 FOSSEE-netbook-tools-NoNoise-1.zip |
New application under FOSSEE-tools to reduce noise from recorded videosNoNoise-1
Diffstat (limited to 'opt/noNoise-master/noNoise.sh')
-rwxr-xr-x | opt/noNoise-master/noNoise.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/opt/noNoise-master/noNoise.sh b/opt/noNoise-master/noNoise.sh new file mode 100755 index 0000000..f247568 --- /dev/null +++ b/opt/noNoise-master/noNoise.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Please install 'libav-tools' for Ubuntu 14.04 onwards +# As ffmpeg is obsolete, it has been replaced by 'avconv' +# Instead of python script, a simple bash one is sufficient + +# A beta release for noNoise-v2 + +# Usage example +# $ bash noNoise.sh noisyVideo.mp4 noise-reduction-factor + +# noise-reduction-factor: 0 means no reduction, 1 means +# maximum damping of noise (recommended is 0.2 to 0.4) + + + +# Making a backup of the original video +echo "Back up original video at /tmp/orig_$1" +cp -v $1 /tmp/orig_$1 + +# Extracting audio from noisyVideo +avconv -i $1 -f wav -ab 192000 -vn /tmp/noisy.wav + +# Creating a noise profile, basically looking for white noise +# in 0 to 0.5 sec of the clip (change if you like) +sox /tmp/noisy.wav -n trim 0 0.5 noiseprof myprofile + +# Removing noise using noise profile +sox /tmp/noisy.wav /tmp/noisefree.wav noisered myprofile $2 + +# Replacing noisyAudio with noisefree audio in original video +avconv -i $1 -i /tmp/noisefree.wav -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 noisefree_$1.mp4 |