Copy metadata from an MXF to an XMP

Started by javiavid, March 25, 2021, 06:03:37 AM

Previous topic - Next topic

javiavid

Hello,
I am trying to extract a label that is called Video Coding Scheme ID and copy it to an XMP, if I execute the command:
Exiftool -u -Videocodingschemeid atom.mxf

I get:
Video Coding Scheme ID: 060E2B34-0401-010A-0401-020271080000


To create the XMP I use:
Exiftool -a -u -g1 -tagSfromfile atom.mxf -Videocodingschemeid atom.xmp

I get the following errors:

Warning: Tag 'videocodingschemeid' is not defined - atom.mxf
Warning: No Writable Tags Set from Atom.mxf
    0 image Files Updated
    1 image files unhanged

Any ideas?

StarGeek

An XMP sidecar file can only hold XMP data.  That tag appears to be an MXF tag that doesn't have an equivalent tag in XMP.
"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

StarGeek

You can copy it into any existing XMP tag you would like.  Either appending it to something like the Description, for example, "-Description<$Description Video Coding Scheme ID=$VideoCodingSchemeID" would add a note about the ID to the end of the Description, or you could repurpose a less common tag, for example, the CellTowerID used by some Sony Ericsson phones.

The former has the advantage that it would be visible in any program that reads metadata.  The latter is too specialized to do so.
"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

javiavid

Thank you very much, I got it to work

javiavid

I have another doubt, is it possible in any way "format" this information before copying it?

For example, if it detects that the text on the source tag is"0004" that copy the text "ProRes" on the destination tag.

Phil Harvey

Quote from: javiavid on March 25, 2021, 11:54:05 AM
For example, if it detects that the text on the source tag is"0004" that copy the text "ProRes" on the destination tag.

Like this?:  "-DSTTAG<${SRCTAG;$_ = 'ProRes' if /0004/}"

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

javiavid


javiavid

#7
Hi,
I'm trying to follow this post https://exiftool.org/forum/index.php/topic,4682.msg22369.html#msg22369 because the example is very similar, but I do not get it.
The value at atom.mxf is VideoCodingSchemeID:
060E2B34-0401-010A-0401-020271080000.

The command that I use is as follows:
Exiftool -Config Example.config -a -u -g1 -tagsfromfile atom.mxf "-Headline <VideoCodingSchemeID" atom.xmp

And the example.config file contains this:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        Headline => {
            Require => 'VideoCodingSchemeID',
            ValueConv => q{
                return test1 if $val eq '060e2b34-0401-010a-0401-020271080000';
                return test2 if $val eq '060e2b34-0401-010a-0401-020271080001';
                # ...
                return undef;
            },
        },
    },
);
1; # end


The result I get is that I always copy the original value (060e2b34-0401-010a-0401-020271080000) but not test1.

I would really like to do this process to a folder with subfolders and many MXF. I tell you so as not to bother you again in another post ..   ;D

Thanks

StarGeek

If you are returning a string, you need to put quotes around it.
return 'test1' if $val eq '060e2b34-0401-010a-0401-020271080000';
"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

javiavid

I get the same message as before
1 image files updated
And the same thing happens.

I've tried with double quotes (I'm not sure if windows uses double quotes...) but the same thing happens.

This is the content of the XMP.


<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 12.22'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about=''
  xmlns:photoshop='http://ns.adobe.com/photoshop/1.0/'>
  <photoshop:Headline>060e2b34-0401-010a-0401-020271080000</photoshop:Headline>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>

StarGeek

Ah, I see the problem.  In your command you're copying from the original VideoCodingSchemeID tag, so it's always going to pass the value of that tag.  In order to copy from the user defined tag, you have to use the name of that new tag.  Unfortunately, you given it the same name as Headline, so that will probably cause some unexpected results.

Rename the new tag and copy from that tag
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
MyCodingScheme=> {
Require => 'VideoCodingSchemeID',
ValueConv => q{
return 'test1' if $val eq '060e2b34-0401-010a-0401-020271080000';
return 'test2 if $val eq '060e2b34-0401-010a-0401-020271080001';
# ...
return undef;
},
},
},
);
1; # end


Exiftool -Config Example.config -a -u -g1 -tagsfromfile atom.mxf "-Headline<MyCodingScheme" atom.xmp
"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

javiavid

Thank you, although the problem continues ..

Warning: No writable tags set from atom.mxf
    0 image files updated
    1 image files unchanged


If you need it, I can send you the MXF file.