Skip to content

Instantly share code, notes, and snippets.

@imrehg
Created January 11, 2013 09:29
Show Gist options
  • Save imrehg/4509280 to your computer and use it in GitHub Desktop.
Save imrehg/4509280 to your computer and use it in GitHub Desktop.
Normalize the audio for a video file and combine it back
#!/bin/bash
fullname=$1
filename=$(basename "$fullname")
extension="${filename##*.}"
filename="${filename%.*}"
if [ -f "audio.wav" ]
then
rm audio.wav
fi
ffmpeg -i "$fullname" -c:a pcm_s16le audio.wav
normalize audio.wav
ffmpeg -i "$fullname" -i audio.wav \
-map 0:0 -map 1:0 -c:v copy \
-c:a libmp3lame -b:a 192k \
"${filename}_normalized.${extension}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment