Read Capture One COS files and populate appropriate XMP files

Started by cdubea, August 16, 2020, 11:41:31 AM

Previous topic - Next topic

cdubea

All,

Fingers crossed here.

After beating my head against the broken Cataloging system in the Windows version of Capture One, I exported all my images using the File->Export Images->Originals function and abandoned catalogs.

This worked reasonably well, as I have a well defined folder structure and metadata practices which allowed me to merge the resulting exported files (XMP files) to the original folders. Unfortunately, C1 stores very little info in the XMP files that other applications could make use of. 

I have created an omnibus Session to work under, but I don't import any images, I simply browse to the appropriate folder and begin my editing.
The first time a folder is opened in C1, image previews are created in a subfolder and also a folder full of files with a COS appendix, where all all the post processing info is stored.

The COS are text files, and looking through them, everything is well labelled.  The info is XMP-ish without being XML if that makes any sense.

I was thinking of crafting a tool to read the COS files and then add whatever information which isn't into the XMP file to it. Before doing any of that I came here and "VOILA" the marvelous EXIFTool already reads COS files!

Phil you are 'da man.

What would be the proper syntax for reading the COS files and then filling in the gaps into an existing XMP file?

Thanks, thanks and thanks!

chris
Chris

StarGeek

This is probably something you'll have to do a lot of manual experimentation to figure out the best route.  There's only about half a dozen previous posts in these forums on COS files and none seem to cover this situation.

First, you'll probably have to figure out what the COS tag names are.  Run
exiftool -g1 -a -s file.cos
on one of the COS files to get the names of the tags in there. Then you'll have to figure out where you want those COS tags to be copied to in an XMP file.  Basically it would be along the lines of Example #13 on the Metadata Sidecar Files page, except you would have to use "-XMPTAG<COSTAG" for each tag you want copied.  That is if the COS tags don't have the same names as the XMP tag names.  The EXT would be replaced by COS and %d%f.xmp would have to reflect the path to the XMP files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

cdubea

Thanks, that's good info.

Just a shotgun copy from the cos file to the xmp file turned out to be trivial.  The examples in the docs (which I should have read before posting :|) provide clear guidance. Just get the filenames right. Exiftool creates a backup of the original xmp file, so that provides a parachute if things go horribly wrong.

cheers

chris
Chris

cdubea

StarGeek,

This is the result of your suggestion:

---- ExifTool ----
ExifToolVersion                 : 11.52
---- System ----
FileName                        : 20170411-File.001.jpg.cos
Directory                       : .
FileSize                        : 4.9 kB
FileModifyDate                  : 2020:08:15 10:36:26-04:00
FileAccessDate                  : 2020:08:16 11:57:56-04:00
FileCreateDate                  : 2020:08:16 11:57:56-04:00
FilePermissions                 : rw-rw-rw-
---- File ----
FileType                        : COS
FileTypeExtension               : cos
MIMEType                        : application/unknown
---- XML ----
Author                          : 12.1.5.9 Pro Win
Camera_Lens                     : -- mm f/--
Camera_Make                     : motorola
Camera_Model                    : Nexus 6
Camera_Owner                    : Me
Camera_Software                 : HDR+ 1.0.126161355r
CameraDisplayName               : Jpeg File
Exp_Aperture                    : 2
Exp_ColorSpace                  : sRGB IEC61966-2-1 black scaled
Exp_Date                        : 1491937255.016892
Exp_ExposureCompensation        : 0/6
Exp_ExposureMode                : 0
Exp_ExposureProg                : 2
Exp_FlashMode                   : 24
Exp_FocalLength                 : 3.8199999332428
Exp_Format                      : JPEG
Exp_MeteringMode                : 2
Exp_ShutterSpeed                : 0.0344827584922314
Exp_WhiteBalance                : 0
File_Size                       : 1733762
Height                          : 3088
ImageClassification             : 19
ISO                             : 608
MultiShotCount                  : 0
MultiShotSequenceID             : --
MultiShotTotal                  : 0
MultiShotType                   : 4294967295
PixelHeight                     : 0
PixelWidth                      : 0
UUID                            : A7F4BE4A-3163-4FC4-A585-D0C8B82E8C41
Version                         : 1100
Width                           : 4160
Engine                          : 1200
HighResProcessCounter           : 0
LowResProcessCounter            : 0
ProductID                       : FileSystemJpeg
SyncProcessCounter              : 0
UUID                            : 7E971389-057A-4CA6-8677-F7BFA1BA2126
Brightness                      : 0
BwBlue                          : 0
BwCyan                          : 0
BwDarkHue                       : 0
BwDarkSaturation                : 0
BwEnabled                       : 0
BwGreen                         : 0
BwLightHue                      : 0
BwLightSaturation               : 0
BwMagenta                       : 0
BwRed                           : 0
BwYellow                        : 0
Clarity                         : 0
ClarityMethod                   : 3
ClarityStructure                : 0
CleanLongExposureAmount         : 0
CnrAmount                       : 0
ColorBalance                    : 1;1;1
ColorBalanceHighlight           : 1;1;1
ColorBalanceMidtone             : 1;1;1
ColorBalanceShadow              : 1;1;1
ColorCorrections                : (Binary data 576 bytes, use -b option to extract)
Contact_Creator                 : Me
Content_Description             : File
Content_Subjectcode             :
Content_SupplementalCategories  :
Contrast                        : 0
CropOutsideImage                : 0
Exposure                        : 0
FilmCurve                       : FileSystemJpeg-Auto.fcrv
FilmGrainAmount                 : 0
FilmGrainDensity                : 0
FilmGrainGranularity            : 50
FilmGrainType                   : 0
GeometryCanvasClipping          : 2
GeometryKeystoneAmount          : 100
GeometryKeystoneAspect          : 0
GeometryKeystoneFocalLength     : 1
GeometryKeystoneTiltX           : 0
GeometryKeystoneTiltY           : 0
GradationCurve                  : 0,0;1,1
GradationCurveBlue              : 0,0;1,1
GradationCurveGreen             : 0,0;1,1
GradationCurveRed               : 0,0;1,1
GradationCurveY                 : 0,0;1,1
Highlight                       : 1;1;1;1
HighlightRecovery               : 0
ICCProfile                      : EMBEDDED
Image_City                      : City
Image_Country                   : United States
Image_DateCreated               : 20170411
Image_ISOCountryCode            : US
Image_Scene                     :
Image_State                     : State
LensAperture                    : 2
LensFocalLength                 : 3.8199999332428
LensGeoAbr                      : |0.000000|1|0|0
LensLccLightFalloffAmount       : 0
LensShift                       : 0
LensShiftDirection              : 0
LensTilt                        : 0
LensTiltDirection               : 0
Midtone                         : 0;0;0;0
Moire                           : 0;8
NoiseDetailsAmount              : 50
NrAmount                        : 0
Rotation                        : 0
Saturation                      : 0
Shadow                          : 0;0;0;0
ShadowRecovery                  : 0
Status_CopyrightNotice          : © 2017 Me
SurfaceSmoothnessAmount         : 0
TargetHighlight                 : 1;1;1;1
TargetShadow                    : 0;0;0;0
UsmAmount                       : 0
UsmHaloControl                  : 0
UsmRadius                       : 0.800000011920929
UsmThreshold                    : 1
WhiteBalance                    : 1;1;1
AL                              :


I'm going to play with this a bit, do some exporting and then read the files into xviewmp and lightroom to see that the outcome is.

This is encouraging thusfar. Appreciate your feedback.
Chris

StarGeek

From the look of it, most of that data should already exist in the EXIF group of the original image and shouldn't need to be copied over.  Your management program should take care of that.  The only ones that stand out would be location data (city, state, country) and copyright notice.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

cdubea

Quote from: StarGeek on August 16, 2020, 02:57:50 PM
From the look of it, most of that data should already exist in the EXIF group of the original image and shouldn't need to be copied over.  Your management program should take care of that.  The only ones that stand out would be location data (city, state, country) and copyright notice.

Agreed, but, Capture One does a VERY poor job of managing metadata. So bad, that it's virtually unusable for said purpose. To the point that I've given up and will be using either LightRoom of xnViewmp for those duties.

Appreciate the help.
Chris

cdubea

Arg. Well this is decidedly "sub-optimal"....

Preface this with I've got an old version of LR v6.1.5. Also, I shoot RAW and jpg and rename/number them in LR so that they have the same name with different extensions. Major causality issue here.

Doing some testing, I created a folder and brought in 1 jpg file. Set the color and stars. C1 creates an XMP file. Ding! Alert!

LR sees none of this as it expects metadata to be written in the jpg file. 

I copy the corresponding RAW file into the test folder.  Do a refresh in LR and boom, without making any data updates in C1, LR reads the xmp file and assigns the metadata accordingly.

Using exiftool, I read the XMP and write into the jpg.  Ding, LR sees the data.

Well, that gives me a path to resolution.

Thanks Phil, again, for a great tool!
Chris

cdubea

Just a final entry.

John Beardsworth's Syncomatic tool makes writing the XMP data into the jpg's effortless.
Chris

blue-j

Quote from: StarGeek on August 16, 2020, 02:57:50 PM
From the look of it, most of that data should already exist in the EXIF group of the original image and shouldn't need to be copied over.  Your management program should take care of that.  The only ones that stand out would be location data (city, state, country) and copyright notice.

COS files are XML entirely and copy data from EXIF, XMP-Getty and other namespaces from the source image without crediting/connecting them whatsoever.  It is a joy.  I am working on reverse engineering as we speak.  - J


blue-j

Quote from: cdubea on August 16, 2020, 12:27:29 PM
AL                              :

Any idea what this field refers to?  "AL"?

- J

blue-j

OK, I have reverse-engineered the COS schema for Capture One 20 (v13.x):

https://docs.google.com/spreadsheets/d/1PZRs7gqkHVb4KgmTZfNetAtACDEN_xYoWsmLbjE_hFE/edit?usp=sharing

I am attaching a couple of samples that guided my work (including some posted in this forum!).  I welcome collaborators to edit the document above.  Really, in order to read, ExifTool doesn't care about the original fields being used as sources for the XML, but I map them in case my organization decides to be able to create COS files for some reason or another or copy them to XMP, as suggested by the OP.

I'm also attaching screenshots of the metadata panel in C1, where I filled in the data using the field name for mapping purposes.  Note: I did NOT include the Maker Notes shown in the screenshot or map them in the document yet, as my samples didn't show this data.  But they are not very hard to discern.

It may be, that the ExifTool developers decide not to decode this, as it already recognizes the file type and parses the XML.  But just in case... I hope I have made it much easier!

- J

blue-j

Ok, I was able to export a JPEG matching the COS settings, so we can compare the COS XML with what C1 writes to its output.  I will continue mapping here.  It looks like they are using some pretty old IPTC fields.

- J

blue-j

I'll answer myself "AL" isn't actually a tag, it's an XML grouping.

Quote from: blue-j on October 27, 2020, 08:28:56 PM
Quote from: cdubea on August 16, 2020, 12:27:29 PM
AL                              :

Any idea what this field refers to?  "AL"?

- J

Phil Harvey

Quote from: blue-j on October 28, 2020, 03:12:41 PM
I'll answer myself "AL" isn't actually a tag, it's an XML grouping.

I don't understand.  Can you show an example XML?

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

blue-j

Here ya go!  (I filled in the values to match the field names for mapping purposes).  I am a perpetual student and just visiting your hometown, so I reserve the right to be wrong.  : )

- J