scripts: Init tc-video-multiaudio

master
Pierre Neidhardt 2015-09-04 10:19:45 +02:00
parent da5f775011
commit a72b2d848a
1 changed files with 21 additions and 0 deletions

21
.scripts/tc-video-multiaudio Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
if [ "$1" = "" ]; then
cat<<EOF
Usage: ${0##*/} FOLDER
Print movies in FOLDER which have strictly more than 1 audio channel.
EOF
exit
fi
while IFS= read -r i; do
## Some formats (e.g. m2ts) will also return an "audio" channel in the
## "programs" section. We skip that.
stream_count=$(ffprobe -v quiet "$i" -print_format flat=s=_ -show_entries stream=codec_type | grep -v '^programs' | cut -f2 -d= | grep -c "audio")
if [ -n "$stream_count" ] && [ $stream_count -gt 1 ]; then
echo "$i"
fi
done <<EOF
$(find "$1" -type f)
EOF