#!/bin/bash
# Script to extract .wav audios from .avi files # 04 Sept. 2007 d.e.l.
USAGE="$0 [-h]"
shopt -q nocasematch # - this seems to be inoperative
# if [[ '-h' = ${1:0:2} ]] # then # echo ${USAGE} # exit # fi
case ${1:0:2} in -h | -H | -? | /h | /H | /? ) echo ${USAGE} exit ;; -- ) case ${1:2:1} in h | H | ? ) echo ${USAGE} exit ;; * ) esac ;; * ) esac
set -o braceexpand ;
aviconvert () {
PATIENT=${1} ; CURED="${1%.avi}.wav" ; echo "Converting: ${PATIENT}" ; #\mplayer -ao pcm:waveheader:fast:file=charley1.wav -vc null -vo null \ # charly.01.avi
nice -20 \ /usr/bin/mplayer \ -ao pcm:waveheader:fast:file=${CURED} \ -vc null -vo null \ ${PATIENT}
return ;
}
for i in *.avi do
aviconvert ${i} ;
done ; # for
Monday, December 24, 2007
'WAVing' Your Videos
A friend asked tonight if I knew how to strip out the audio
from videos, for conversion to things like .ogg and .mp3 formats.
This is one of those things I remember doing, but not the details,
so below is a script for creating a .wav file for each video
.avi file in a directory. Just look up the parameters in man mplayer
for a detailed explination.
--
Subscribe to:
Post Comments (Atom)
1 comment:
Awesome!
Thanks for putting it online. That will let it get more exposure etc. :)
Post a Comment