Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate metadata for a folder using ffprobe.
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