Skip to content

Instantly share code, notes, and snippets.

@dnavarrojr
Last active October 28, 2022 09:33
Show Gist options
  • Save dnavarrojr/545f03ac732052cb8c617c3268b13684 to your computer and use it in GitHub Desktop.
Save dnavarrojr/545f03ac732052cb8c617c3268b13684 to your computer and use it in GitHub Desktop.
Using FFPROBE to Create JSON files
#!/bin/bash
folder="/var/www/{website}/wp-content/uploads/video"
for filename in $folder/*.mov; do
if [ -f $filename ]; then
ffprobe -hide_banner -v quiet -print_format json -show_format -show_streams $filename > $folder/$(basename -s .mov $filename).json
fi
done
for filename in $folder/*.mp4; do
if [ -f $filename ]; then
ffprobe -hide_banner -v quiet -print_format json -show_format -show_streams $filename > $folder/$(basename -s .mp4 $filename).json
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment