remove audio noise of lots of videos

Started by spotlight2001, May 24, 2012, 04:02:23 PM

Previous topic - Next topic

spotlight2001

I want to convert/modify all my AVI files from camera.

AVI large -> compressed with minium quality loss.

I convert to
video: MPEG-4 AVC
audio: AAC (Faac)
format: MP4
with this script:


#!/bin/bash

##################################################################
# Purpose: Converts a string to lower case
# Arguments:
#   $@ -> String to convert to lower case
##################################################################
function to_lower()
{
    local str="$@"
    local output
    output=$(tr '[A-Z]' '[a-z]'<<<"${str}")
    echo $output
}

VAR="files.txt"
BASEDIR=$1
find $BASEDIR -name '*.avi' | sort > $VAR # Collect the files in the current directory
find $BASEDIR -name '*.AVI' | sort >> $VAR # Collect the files in the current directory
cat $VAR | while read line; do  # Loop read the filenames from the file
  INPUT=$(echo ${line}) # Grab the nxt new filename
  OUTPUT=${INPUT%.*} # Remove shortest match of characters between the '. ' and the '4' at end of string
  OUTPUT+=".mp4" # Append new extension
  OUTPUT=$(to_lower ${OUTPUT})
  echo ${INPUT} to ${OUTPUT}
  avidemux2_cli --run avidemux_youtube_v4.js --load "$INPUT" --save "$OUTPUT" --quit
  touch "$OUTPUT" --reference="$INPUT"
  rm -f $OUTPUT.stat
  rm -f $OUTPUT.mbtree
done
rm $VAR # Remove the text file with the file names


This works.


I also want to remove audio noise from all videos. How can I do this?

I have these filters:


//** Filters **
app.video.addFilter("deinterlace","motion_trigger=15","blend_trigger=9");
app.video.addFilter("mphqdenoise3d","param1=4,000000","param2=3,000000","param3=6,000000");
app.video.addFilter("mpdenoise3d","param1=4,000000","param2=3,000000","param3=6,000000");


I thought the mp... filter apply for audio noise. But audio sounds the same to me from original and converted video.

In some forum I read that this is only possible by demux audio, use ext. prog like audacity and mux again. Can I do this without such a painful procedure? How? Or has someone a script available for that?

Jan Gruuthuse

as the label says: app.video.addFilter , only video filter not audio
Currently I'm not aware of audio noise filter present in Avidemux.
Looks like external processing is the only way. Perhaps someone has some scripting done with audacity? Or someone here has the skill and time to build an audio noise filter for use in avidemux?
This seems to be video orientated only and is beyond me: writing your own filter

nibbles

Reducing the noise in an audio file that you demux is your only option, and it is problematic unless you have an excellent sample of the noise only.  You can take your camera and record a series of 5 to 10 sec samples of silence at the same gain you used for your videos.  Even though you start with silence, there will still be noise from the analog microphone that gets converted into digital.  You can use a program like Adobe Audition to apply a noise filter to your audio track.  The procedure is to convert both noise samples and original audio into 32bit 96 kHz files, then use a denoise filter that will ask you for a sample of the noise.  Give it one of your samples and preview the result.  Adjust the intensity of the denoise filter so that you remove some noise, but don't mistakenly think the result will be very high quality.  It is still very hard for programs to remove noise, and you will likely get gurgle sounding artifacts.  Use headphones when you preview so you can hear the result better.  Always keep your original sound files, because in five years, things will be much more capable.  In 10 years, you will probably have a super-computer.  Once you are happy with your preview, apply it and convert the audio back from 32bit to 16bit or 24bit/48 kHz.  It depends on the final format what you chose.  If the noise isn't background hiss and is more like a whine at some frequency, then you would instead learn how to apply a bandpass filter or notch filter.  It's very complex, any denoise task.  Don't rush into it.  Try to get the best software you can and give yourself time to learn and ask questions on a good web forum dedicated to audio.  It's been 10 years since I've done this, but Hydrogen Audio forums used to be very good.