Understanding Video Metadata

Started by Keith, December 03, 2019, 07:50:32 AM

Previous topic - Next topic

Keith

While writing some scripts to parse and catalog my photo metadata, I found parsing associated video files to be a much more challenging problem.  I'm sure this will come as no surprise to the experts here, but using some of my own cameras for example:
- Canon: videos contain almost no metadata (RIFF).  Instead, relevant metadata is stored in a .thm sidecar file named similarly to the video file (most of which have unfortunately been discarded, presumed unnecessary).
- Sony: videos contain limited and inconsistent metadata (XML, depending on the model), but more data is stored in a sidecar .xml file named similarly to the video file.
- Panasonic: video files contain little metadata (QuickTime), but more data is contained in similarly-named .jpg sidecar file.

Under these circumstances, I see dim prospects for developing a 'general solution' to catalog my video files.  My photos by contrast have been sufficiently consistent.  Are there any techniques for somewhat-consistently parsing video metadata using ExifTool?

Phil Harvey

ExifTool can only extract the information that is available.  Many Canon cameras store a THM inside the video, and if so ExifTool should extract its metadata.  Some Panasonic cameras write maker notes to MP4 files that should also be extracted by ExifTool.  I don't see much in Sony videos though.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Keith

Thank you for the confirmation.  I expected that ExifTool was extracting all the available embedded data from the video files.  But I was hoping that perhaps:
- There was some setting I was missing to extract it, or
- There is a method to match the video file with the sidecar when present and report a consolidated output.

Otherwise (as appears to be the case), the only way to identify these videos back with their camera and sequence is with the filename and timestamp - both of which are exceedingly maliable - with almost no EXIF data to confirm.  That's going to make automating the task quite difficult.

Phil Harvey

If you kept the sidecar files, you can use them but it would be a pain having them in different formats (THM, XMP, JPG).

For example, to use the THM sidecar for MP4 files:

exiftool -srcfile %d%f.THM -ext mp4 ... DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Keith

That's clever.  I may use that - at for those I can pre-match with the correct camera (to know the extensions involved).  Thankfully most of my archive for the past 10 years retained the entire card file structure (including sidecars).  Prior to that, it's mixed.

I know this may be stretching the tool too far and may require more parsing and python on my part.  But is there any way to match a file by only its numeric digits (not the entire filename) and/or the timestamp within a range (some thumbnails share the exact timestamp or ~1sec later).

Phil Harvey

The ExifTool %f token allows you to take a substring if that helps.  This is explained in detail in the -w option section of the ExifTool application documentation.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).