Skip to content

Instantly share code, notes, and snippets.

@spvkgn
Created June 25, 2017 05:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spvkgn/76af48a6c3064876956c2705a03ea564 to your computer and use it in GitHub Desktop.
Save spvkgn/76af48a6c3064876956c2705a03ea564 to your computer and use it in GitHub Desktop.
Show bitrate of audio files in current dir with mediainfo
#!/bin/sh
FILETYPES="*.mp3 *.m4a *.mpc *.ogg *.flac *.ape *.wav"
MEDIAINFO_PARAMS=--inform="Audio;%BitRate/String% %BitRate_Mode% %Format%\n"
if [ ! -z "$1" ]
then mediainfo "$MEDIAINFO_PARAMS" "$@" | sed '${/^$/d}'
else mediainfo "$MEDIAINFO_PARAMS" $FILETYPES | sed '${/^$/d}'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment