#!/usr/bin/env bash set -e usage(){ echo "usage: check_movies.sh " exit 1 } start_dir=$(pwd) source_dir="$1" video_length_temp="$(mktemp)" cd "$source_dir" printf "File:\tLength:\n" > "$video_length_temp" find . -type f -name "*.webm" | xargs -I{} ffprobe -v quiet -print_format json -show_format {} | jq -r '.format | "\(.filename)\t\(.duration)"' | cut -c 3- >> "$video_length_temp" column -t < "$video_length_temp" rm "$video_length_temp" cd "$start_dir" exit 0