Created
December 10, 2022 08:42
-
-
Save rdegges/3f516a787b6b90009216aaf7003189a9 to your computer and use it in GitHub Desktop.
Given a directory full of video files, strip all metadata from the videos using ffmpeg.
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
#!/usr/bin/bash | |
# | |
# This script will remove the metata from all video files in the given | |
# directory. | |
# | |
# @requires ffmpeg | |
# @usage ./strip-video-metadata.sh </path/to/folder> | |
# Loop through all files in the directory | |
for f in "$1"/* | |
do | |
# Use ffmpeg to remove all metadata from the file and save the output to a new file | |
ffmpeg -i "$f" -map_metadata -1 -c:v copy -c:a copy "${f%.*}-temp.${f##*.}" | |
# Move the new file to replace the original file | |
mv "${f%.*}-temp.${f##*.}" "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment