From be43aa6254012ab40ddd266e19304cc8523c6054 Mon Sep 17 00:00:00 2001 From: Roy Shilkrot Date: Mon, 20 Nov 2017 15:03:03 -0500 Subject: [PATCH] adding some useful progress outputs to the process --- noiseclean.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/noiseclean.sh b/noiseclean.sh index 8ff789a..a1b3921 100755 --- a/noiseclean.sh +++ b/noiseclean.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + usage () { echo 'Usage : noiseclean.sh ' @@ -60,16 +62,21 @@ tmpAudCleanFile="/tmp/noiseclean_tmpaud-clean.wav" echo "Cleaning noise on '$1'..." if [ $isVideo -eq "1" ]; then + echo "Demux audio and video" ffmpeg -v warning -y -i "$1" -qscale:v 0 -vcodec copy -an "$tmpVidFile" ffmpeg -v warning -y -i "$1" -qscale:a 0 "$tmpAudFile" else cp "$1" "$tmpAudFile" fi +echo "Extract audio noise sample" ffmpeg -v warning -y -i "$1" -vn -ss "$sampleStart" -t "$sampleEnd" "$noiseAudFile" +echo "Create noise profile" sox "$noiseAudFile" -n noiseprof "$noiseProfFile" +echo "Reduce noise throughout audio recording" sox "$tmpAudFile" "$tmpAudCleanFile" noisered "$noiseProfFile" "$sensitivity" if [ $isVideo -eq "1" ]; then - ffmpeg -v warning -y -i "$tmpAudCleanFile" -i "$tmpVidFile" -vcodec copy -qscale:v 0 -qscale:a 0 "$2" + echo "Mux cleaned audio and video" + ffmpeg -v warning -y -i "$tmpAudCleanFile" -i "$tmpVidFile" -strict -2 -vcodec copy -qscale:v 0 -qscale:a 0 "$2" else cp "$tmpAudCleanFile" "$2" fi