Last active
October 28, 2022 09:33
-
-
Save dnavarrojr/545f03ac732052cb8c617c3268b13684 to your computer and use it in GitHub Desktop.
Using FFPROBE to Create JSON files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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