#!/bin/bash # # Date: 2009-12-16 # Author: Ole Kristian Lien # License: GNU General Public License # # Extract audio from video-file EXT=`echo "$1"|awk -F . '{print $NF}'` NAME=`basename $1 .$EXT` FORMAT=`./audio_format $1` if [ -z "$1" ]; then echo "Usage: $0 [ ]" exit 1 fi #if [ "$FORMAT" == "pcm_s16le" ]; then # FORMAT="wav" #fi echo "Extracting $NAME.$FORMAT..." if [ "$3" ]; then #DURATION="30" #`./duration$1` DURATION="$3" #echo "start: $2 - Dur: $DURATION" ffmpeg -i $1 -ss $2 -t $DURATION -vn -acodec copy $NAME.$FORMAT 2> /dev/null else ffmpeg -i $1 -vn -acodec copy $NAME.$FORMAT 2> /dev/null fi