unix4artists/ffmpeg/basic/info.sh

23 lines
598 B
Bash
Raw Normal View History

2021-05-08 16:53:26 +00:00
#!/bin/bash -e
#####################################################
#
# "ffprobe" is an application that comes bundled with
# the ffmpeg installation. It will print file
# information about the streams within video and audio
# files.
#
# Usage: bash ffmpeg/basic/info.sh <file>
#
#####################################################
if [ "${1}" == "" ]; then
echo "Please include a path to a file as the first argument"
exit 1
fi
if [ "${2}" != "json" ]; then
ffprobe -v quiet -show_format -show_streams "${1}"
else
ffprobe -v quiet -print_format json -show_format -show_streams "${1}"
fi