News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Video - Copy XMP File to File

Started by canjmp, November 28, 2022, 02:32:11 PM

Previous topic - Next topic

canjmp

I had success copying XMP metadata from JPG to JPG but the command string fails to copy from MP4 to MP4 file.

The command string used was:

exiftool -tagsFromFile 360_00hd_meta.mp4 -xmp Eqr_360_00HD.mp4


Refer to attached Metadata_Source.txt file showing XMP injected by Spatial Media Metadata Injector application.

Refer to attached Metadata_Fail.txt file showing no XMP added by the Exiftool command execution.

Phil Harvey

What messages did the command give when you tried to copy the xmp?

- Phil

Edit:  Just a guess, but if this is embedded metadata you will need to add -ee to the command when copying.

You need to be able to see the XMP with a command like this for it to be available for copying:

exiftool -xmp FILE    # (maybe need to add -ee?)
...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 ($).

canjmp

From the file Meta_Source.txt it has the XMP in the Track 1 block as:

---- XMP-GSpherical ----
Spherical                       : true
Stitched                        : true
Stitching Software              : Spherical Metadata Tool
Projection Type                 : equirectangular


I then assumed this means it is visible.
(For background interest this metadata identifies this MP4 as 360 video. Facebook and others can then render it in 360 degree viewing.)

As for your suggestion -ee, it had no effect.

For out of the box thinking, would I need to copy the complete metadata set to a separate file which could be manipulated within the CMD Line instruction set, where I would add the XMP-GSpherical data, then overwrite the new metadata onto the MP4 file?

canjmp

As per your inquiry what CMD window is displaying about the executed string.

CMD window was written:
 Warning: No writable tags set from 360_00hd_meta.mp4

From > out.txt the file read the following:

    0 image files updated
    1 image files unchanged

Phil Harvey

OK.  I have an Insta360 test file here and I can see what is happening.  The problem is that the tags aren't actually stored as XMP in the source video.  The tags are extracted from the XML of the SphericalVideoXML tag.

You should be able to copy these tags individually with this command:

exiftool -tagsFromFile 360_00hd_meta.mp4 "-all:all<xmp:all" Eqr_360_00HD.mp4

The redirection to "all:all" is necessary to keep the tags in the GSpherical namespace.  Otherwise some of them would be preferred in GPano.

Also, it seems that ExifTool will write the GSpherical tags correctly to the SphericalVideoXML tag in the video track.  Who knew?  I had forgotten that I had added this ability.  I should have read the GSpherical tags documentation.

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

canjmp

Success. Much thanks.

This will be a excellent addition to my program for converting dual fisheye video to equirectangular video.

Thanks again.

canjmp

Hi Phil, I spoke too soon.

The copy of XMP Spherical metatdata which we know is not XMP is being copied in a different order than the original.

For my LG TV it is not displaying in 360 degree viewing. After testing the LG TV is sensitive to the order.

It appears to me that your program Exiftool is writing the data in tag name Alphabetical order. It should be as-found order.

An update to your program would be much appreciated.

Original data is:
---- XMP-GSpherical ----
Spherical                       : true
Stitched                        : true
Stitching Software              : Spherical Metadata Tool
Projection Type                 : equirectangular


The copy is:
---- XMP-GSpherical ----
Projection Type                 : equirectangular
Spherical                       : True
Stitched                        : True
Stitching Software              : Spherical Metadata Tool

Phil Harvey

It doesn't make sense to patch the way ExifTool writes RDF/XML to allow the tag order to be specified, but what I can do is allow the XML to be copied as a block via the SphericalVideoXML tag.  I'll add this ability in ExifTool 12.52:

exiftool -tagsFromFile 360_00hd_meta.mp4 -sphericalvideoxml Eqr_360_00HD.mp4

...but I wouldn't be surprised if this doesn't fix the issue, because the order shouldn't matter.

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

canjmp

Understood, I was surprised that the LG TV was so particular.
Facebook plays the HD and 4K videos which had metadata copied by Exiftool.

The media player on my laptop plays the video with metadata copied by Exiftool but with particularity. The Samsung Gear 360 ActionDirector produced by Cyberlink plays 4K videos in 360 but not HD. It is a problem with the media player, not the metadata. The point is not all software applications are the same and we only notice when they don't work.


In the meantime, is there a way for Exiftool to write the TEXT into the metadata a line at a time with targeting to the location between Track 1 and Track 2 data? This would enable me to write the TEXT in its original sequence.

Phil Harvey

There is no way to do this currently.

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