Skip to content

Instantly share code, notes, and snippets.

@teffalump
Last active September 2, 2016 17:21
Show Gist options
  • Save teffalump/218c63fa1c6d955e9541 to your computer and use it in GitHub Desktop.
Save teffalump/218c63fa1c6d955e9541 to your computer and use it in GitHub Desktop.
Extract audio from file
#!/usr/bin/zsh
#Simple script to extract audio from a file.
FILE="$1"
FILENAME="${FILE%.*}"
EXTENSION=`ffmpeg -i "$1" 2>&1 | gawk '/Audio/ {print $4}' | tr -d '[:punct:]'`
ffmpeg -vn -i "$1" -acodec copy "$FILENAME"."$EXTENSION"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment