ambevar-dotfiles/.local/bin/probe

23 lines
453 B
Plaintext
Raw Normal View History

2014-02-08 13:51:19 +01:00
#!/bin/sh
usage () {
cat <<EOF>&2
Usage: ${0##*/} FILE
${0##*/} ENTRIES FILE
2014-02-08 13:51:19 +01:00
Run ffprobe on FILE using shell print format. If no entry is specified, print
format and streams.
EOF
}
2014-02-08 13:51:19 +01:00
[ $# -eq 0 ] && usage && exit 1
[ "$1" = "-h" ] && usage && exit
[ "$1" = "--" ] && shift
2014-02-08 13:51:19 +01:00
if [ $# -gt 1 ]; then
ffprobe -v quiet -print_format flat=s=_ -show_entries -- "$@"
2014-02-08 13:51:19 +01:00
else
ffprobe -v quiet -print_format flat=s=_ -show_format -show_streams -- "$1"
2014-02-08 13:51:19 +01:00
fi