Skip to content

Instantly share code, notes, and snippets.

@skorotkiewicz
Last active January 26, 2026 10:50
Show Gist options
  • Select an option

  • Save skorotkiewicz/7a340b0f4adf9cc7c9904e332580d0c1 to your computer and use it in GitHub Desktop.

Select an option

Save skorotkiewicz/7a340b0f4adf9cc7c9904e332580d0c1 to your computer and use it in GitHub Desktop.
Removes all metadata from video files and sets Title to match filename.
#!/bin/bash
#
# update-video-titles.sh
#
# Description:
# Removes all metadata from video files and sets Title to match filename.
#
# Requirements:
# sudo pacman -S perl-image-exiftool mkvtoolnix-cli
#
# Usage:
# ./update-video-titles.sh [directory]
#
# Examples:
# ./update-video-titles.sh # Current directory
# ./update-video-titles.sh ~/Videos # Specific directory
#
# Supports: MP4, MKV, AVI, MOV
#
DIR="${1:-.}"
cd "$DIR" || exit 1
# Process MP4, AVI, MOV with exiftool
for f in *.mp4 *.avi *.mov; do
[ -f "$f" ] || continue
exiftool -all= -Title="${f%.*}" "$f" -overwrite_original
echo "Done: $f"
done
# Process MKV with mkvpropedit
for f in *.mkv; do
[ -f "$f" ] || continue
mkvpropedit "$f" --edit info --set "title=${f%.*}"
echo "Done: $f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment