get_codec
- 291 bytes
- View raw
1#!/usr/bin/env zsh
2# get_codec uses `mediainfo` to print the codec of a video file.
4set -o errexit
5set -o nounset
7if (( $# == 0 ))
8then
9 echo "Usage: $0 VIDEO_FILE" >&2
10 exit 1
11fi
13ffprobe -v error -select_streams v:0 \
14 -show_entries stream=codec_name \
15 -of csv=print_section=0 "$1"