Finding metadata in video files

Originally posted on 2023-06-21

I’m trying to figure out how my cameras embed different kinds of data into their video streams and I’m constantly searching for ffmpeg and ffprobe commands to do it. I’m finally documenting it here so I don’t have to do it over and over again. Enjoy!

TL;DR - This first option (exiftool with embedded information) works the best for me

Extract with exiftool including embedded information:

# Single file
exiftool -ee in.mp4 > in.txt

# Whole directory
find . -iname "*.mp4" -exec sh -c 'exiftool -ee "{}" > "{}.txt"' \;

Save global metadata (from SO):

ffmpeg -i in.mp4 -f ffmetadata in.txt

Save metadata from audio and video streams (from SO):

ffmpeg -i in.mp4 -c copy -map_metadata 0 -map_metadata:s:v 0:s:v -map_metadata:s:a 0:s:a -f ffmetadata in.txt

Extract with exiftool:

# Single file
exiftool in.mp4 > in.txt

# Whole directory
find . -iname "*.mp4" -exec sh -c 'exiftool "{}" > "{}.txt"' \;