Batch copying Canon makernotes from .CR3 to .DNG?

Started by Beholder3, September 28, 2020, 11:09:36 AM

Previous topic - Next topic

Beholder3

Hi,I just found out that Adobe DNG Converter - when converting a Canon .CR3 file to DNG - does stip it off all makernotes metadata.That did not happen with .CR2 files in the past.
Since I see that exiftool is able to read CR3 makernotes, I wonder if a batch transfer of all makernotes from .CR3 files to .DNG files of the same name in the same directory would be achievable.
Is there a way to transfer the makernotes?

StarGeek

See the second example under FAQ #8.  I would assume that the Make and Model would already exist in the DNG file.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Good point.  This is a good reason not to use the DNG Converter for CR3 files. :(

ExifTool can't currently copy MakerNotes from a CR3 file -- this would require some dedicated logic since the MakerNotes are arranged very differently in a CR3 file compared to those that would go into a DNG.  In a CR3 file the maker notes are split into (at least) 4 different sections which would need to be re-assembled to be stored in a DNG.  I could possibly look into adding this feature, but it would be some work (which may be why Adobe punted on this one, but they have a whole team of programmers so I don't see this as a valid excuse for them).

- Phil

P.S. I am currently using the DNG Converter for my NEF files because LightRoom doesn't support my camera model, but I wouldn't be doing this if it didn't store the maker notes for these files.
...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 ($).

Beholder3

Quote from: Phil Harvey on September 29, 2020, 06:12:58 AM
Good point.  This is a good reason not to use the DNG Converter for CR3 files. :(
But it is the only way to broaden the number of raw converters usable. And I hate sidecar files. DNG is great at storing all the metadata in one place just as JPG works.
I hate the makers creating new proprietary formats so poorly documented where I see no benefit.


Quote from: Phil Harvey on September 29, 2020, 06:12:58 AM
ExifTool can't currently copy MakerNotes from a CR3 file -- this would require some dedicated logic since the MakerNotes are arranged very differently in a CR3 file compared to those that would go into a DNG.  In a CR3 file the maker notes are split into (at least) 4 different sections which would need to be re-assembled to be stored in a DNG.
I am suprised thatthere is such a difference between reading and writing - but you are the guru.  :) I thought that if I can read a book of exotic poetry verses I can copy it down somewhere else easily, even if I don't understand them.
Quote from: Phil Harvey on September 29, 2020, 06:12:58 AMI could possibly look into adding this feature, but it would be some work (which may be why Adobe punted on this one, but they have a whole team of programmers so I don't see this as a valid excuse for them).
I would absolutely support that feature request.  :) As it seems there is a common gap in functionality everywhere around this, probably a lot of people would benefit from it.  ;)

Quote from: Phil Harvey on September 29, 2020, 06:12:58 AMP.S. I am currently using the DNG Converter for my NEF files because LightRoom doesn't support my camera model, but I wouldn't be doing this if it didn't store the maker notes for these files.
That is why I stumbled upon it. I was used to DNGs being complete replacements of the .CR2s.

Phil Harvey

ExifTool 12.09 (just released) will copy (most of) the makernotes from CR3 to DNG.

This turned out to be easier than I thought, and could be done in 4 lines of code. :)

When I say "most of", I mean the static section of the maker notes.  It would be much more work to combine the sections from the timed metadata.  But luckily, most important stuff is in the static section.  The only notable exception is the ColorData information.

- 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 ($).

Beholder3

Great! Thank you very much.
Now to the how-to.
Now assume I had a directory C:/photos in which I had all my .cr3 files plus their freshly converted .DNG counterparts organized in a dozen subdirectories.
Would
exiftool -tagsfromfile -makernotes:all %d%f.CR3 -r -ext DNG C:/photosbe the correct way to copy the makernotes over for all images under the main directory?

Phil Harvey

That won't work because it will try to copy the makernotes tags individually (-makernotes:all).  Instead, copy them as a block (-makernotes).

Also, the -tagsfromfile file name must come right after this option, like this:

exiftool -tagsfromfile %d%f.CR3 -makernotes -r -ext DNG C:/photos

Note that this will only work if the DNG files already have their Make set to "Canon".  (ExifTool will only copy the correct type of makernotes that corresponds with the camera make for the destination file.)

- 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 ($).

Beholder3


Beholder3

Thanks. Works like a charm.

Even in the old exiftoolgui as "-tagsfromfile %d%f.CR3 -makernotes -r -ext DNG" with all CR3s and DNGs selected it does work.
Is there a place where I can read what "timed metadata" is?

Phil Harvey

Timed metadata is metadata stored in the same way that video data is stored, in a separate track.  Canon uses the CTMD (Canon Timed MetaData) track for this information.  In the following command, the timed metadata is the stuff that shows up in MakerNotes:Track# group:

exiftool -G0:1 -a FILE

- 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 ($).

Beholder3

Ok, thanks.
Why would one do this for a stills photo, which is taken at one specific point in time?
For a video file that is understandable since parameters might change over the duration.

Phil Harvey

Canon may be intending to use this format for storing multiple images (like bracketing or high-speed capture or something along those lines).

- 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 ($).