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.

23 lines
499 B

4 years ago
  1. #!/usr/bin/env bash
  2. set -e
  3. usage(){
  4. echo "usage: check_movies.sh <source directory>"
  5. exit 1
  6. }
  7. start_dir=$(pwd)
  8. source_dir="$1"
  9. video_length_temp="$(mktemp)"
  10. cd "$source_dir"
  11. printf "File:\tLength:\n" > "$video_length_temp"
  12. 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"
  13. column -t < "$video_length_temp"
  14. rm "$video_length_temp"
  15. cd "$start_dir"
  16. exit 0