You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
499 B

#!/usr/bin/env bash
set -e
usage(){
echo "usage: check_movies.sh <source directory>"
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