Skip to content

GregCornis/cr3_exif_extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CR3 EXIF extractor

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.

Benchmark

To extract exifs from 3200 files :

  • exiftool -progress -csv -DateTimeOriginal -SubSecTime /Volumes/EOS_DIGITAL/E2/**/0L6*.CR3 : ~2 hours
  • cr3_parser /Volumes/EOS_DIGITAL/E2/**/0L6*.CR3 : 4 seconds 🔥

How it works

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors