X-Git-Url: https://code.delx.au/transcoding/blobdiff_plain/eb950444d2ef1aa4552413325a15d9f8c88d771e..b0c2d4418346c184c767022c5d7eb3573c83f621:/rip-audio diff --git a/rip-audio b/rip-audio index 1ed4d18..556c87f 100755 --- a/rip-audio +++ b/rip-audio @@ -4,18 +4,22 @@ MPLAYER="mplayer" FFMPEG="ffmpeg" if [ -z "$1" ]; then - echo "Usage: $0 filename" - exit 1 + echo "Usage: $0 filename" + exit 1 fi INPUT="$1" -acodec="$("$MPLAYER" -identify -frames 0 "$INPUT" | grep ID_AUDIO_CODEC | cut -d= -f2)" +acodec="$( + "$MPLAYER" -noconfig all -identify -vo null -ao null -frames 0 "$INPUT" | + grep ID_AUDIO_CODEC | + cut -d= -f2 +)" if [ "$acodec" = "ffaac" ]; then - ext=".m4a" + ext=".m4a" else - echo "Unknown audio codec! $acodec" - exit 1 + echo "Unknown audio codec! $acodec" + exit 1 fi OUTPUT="$(basename "$INPUT" | sed 's/\.[a-zA-Z1-9]*$//')${ext}"