Created
January 14, 2021 03:48
-
-
Save kylemcdonald/fd0f1dbcf5457a648801ab92d90a0af7 to your computer and use it in GitHub Desktop.
Generate metadata for a folder using ffprobe.
This file contains 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
INPUT_DIR=$1 | |
OUTPUT_DIR=$2 | |
mkdir -p $OUTPUT_DIR | |
for INPUT_FN in `find "$1" -type f` | |
do | |
BASENAME=`basename $INPUT_FN` | |
OUTPUT_FN=$OUTPUT_DIR/$BASENAME.json | |
if test -f "$OUTPUT_FN"; then | |
echo "skipping $INPUT_FN" | |
continue | |
fi | |
echo $INPUT_FN ">" $OUTPUT_FN | |
ffprobe -v quiet \ | |
-print_format json \ | |
-show_format \ | |
-show_streams \ | |
-i "$INPUT_FN" > "$OUTPUT_FN" | |
done | |
echo "zipping..." | |
zip -r metadata.zip $OUTPUT_DIR | |
echo "done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment