This is a simple tool to extract some targetted EXIF from CR3 files. It's meant to replace Exiftool for a more specific task, by being a lot faster.
To extract exifs from 3200 files :
exiftool -progress -csv -DateTimeOriginal -SubSecTime /Volumes/EOS_DIGITAL/E2/**/0L6*.CR3: ~2 hourscr3_parser /Volumes/EOS_DIGITAL/E2/**/0L6*.CR3: 4 seconds 🔥
The CR3 file format is well described in this document : canon_cr3.
CR3 comply with the ISO base media file format.
Here is an overview of the file layout:
CR3 File
┌──────────┐
│ Box ftyp │
├──────────┤
│ Box moov │
├──────────┤
│ Box uuid │
├──────────┤
│ Box uuid │
├──────────┤
│ Box uuid │
├──────────┤
│ Box mdat │
└──────────┘
Each box is in the given format:
Box
┌──────┬───────────┐
│ 0..4 │ size: u32 │
│ 4..8 │ type: u32 │
│ 8.. │ content │
└──────┴───────────┘
Here is the overall structure: we are looking for Exif Tags contained in the ExifFD part of the file.
Box uuid
┌──────────┐
CR3 File │ Box CNCV │
┌──────────┐ Box uuid ├──────────┤
│ Box ftyp │ ┌──────┬───────────┐ │ Box CCTP │
├──────────┤ │0..16 │ 85c0b...48│ ├──────────┤
│ Box moov ┼──── │16.. │ content ─┼── │ Box CTBO │
├──────────┤ └──────┴───────────┘ ├──────────┤
│ Box uuid │ │ Box CMT1 │
├──────────┤ ├──────────┤
│ Box uuid │ │ Box CMT2 ┼─── Exif ExifFD
├──────────┤ └──────────┘
│ Box uuid │
├──────────┤
│ Box mdat │
└──────────┘
The ExifFD part is in the TIFF format. We just need to go through all tags and find the ones we are interested in. See Exiftool : Exif Tags for a list of all known tags.