This guide aims at getting a media directory of a large movie collection on a Debian linux server. We want to get the movie title, audio language, subtitle language, duration, and video resolution.
ffmpeg -i <file>.mkv 2>&1 | grep Audio ffmpeg -i <file>.mkv 2>&1 | grep Subtitle ffmpeg -i <file>.mkv 2>&1 | grep Duration ffmpeg -i <file>.mkv 2>&1 | grep Video
echo $(basename "$1") | tr -d '\n' echo -n ";" ffmpeg -i "$1" 2>&1 | grep -P '(?<=\()(.*?)(?=\): Audio)' -o | tr '\n' ' ' | xargs | tr -d '\n' echo -n ";" ffmpeg -i "$1" 2>&1 | grep -P '(?<=\()(.*?)(?=\): Subtitle)' -o | tr '\n' ' ' | xargs | tr -d '\n' echo -n ";" ffmpeg -i "$1" 2>&1 | grep -e Video | grep -P '\b\d*x\d*\b' -o | tr '\n' ' ' | xargs | tr -d '\n' echo -n ";" ffmpeg -i "$1" 2>&1 | grep -P '(?<=Duration: )(.*?)(?=[\.,])' -o | tr '\n' ' ' | xargs | tr -d '\n' echo exit 0
find . -name *.mkv -exec /path/to/batch/mkvextract {} \;