How to add GSpherical tag to MP4 video

Started by dzeek, May 13, 2017, 10:17:09 AM

Previous topic - Next topic

dzeek

How can I add the InitialViewPitchDegrees tag to an MP4 Spherical video file? I displayed the existing tags in the file which are:

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

I tried using -GSpherical:InitialViewPitchDegrees=45 and -XMP-GSpherical:InitialViewPitchDegrees=45 but the tag is not recognized. It is only recognized when used without any Group name but then it is added to the GPano group and deletes the GSpherical group. Here is the meta data after doing that:

---- XMP-GPano ----
Initial View Pitch Degrees      : 45
Initial View Pitch Degrees      : 45

How can I add the tag to the XMP-GSpherical section?

Thank you

Phil Harvey

The XMP-GSpherical tags aren't yet writable.  The reason for this is because I didn't think they were really XMP tags.  As far as I could tell, there were just RDF/XML.  But I case people want to write them into the XMP, I will make them writable in ExifTool 10.53, but due to some name conflicts with XMP-GPano tags you will have to specify the family 1 group name (XMP-GSpherical) when writing.

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

dzeek

Thank you. Do you have any idea when the 10.53 release might be available?

Phil Harvey

Probably about a week, but if you can't wait you can create user-defined tags to do this yourself.  See the sample config file for an example of how to do this.

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

eberhab

I just tried this with exiftool 11.53. I can set the tags, but they are not recognized by VLC. Has anyone successfully set these XMP-GSpherical tags with exiftool and had them be recognized by a player?

GSpherical tags which are set with google's spherical media injector are placed under a specific track in the file, whereas exiftool places them in the main directory. Oddly though, the sperical media defined tags can be read with exiftool. But when I use exiftool to try to copy them from one file to another (direct or via json export) they end up in the wrong place.

Happy to provide more info/ output if needed. Thanks!

- Benjamin

Phil Harvey

#5
Hi Benjamin,

This is unfortunate.  Currently ExifTool writes only top-level metadata.  In all my MOV/MP4 samples, the GSpherical tags are the only ones that don't go at the top level.  :(  I'll see about patching this so they get written in the video track, but this will require some major hacking to split off these tags from the rest of the XMP, and to special-case these tags in the QuickTime writer.

- Phil

Edit:  Also, do you have a .MOV sample with GSpherical tags?  I only have .MP4 samples.  If you do, could you show me the output of this command for one of these files?:

exiftool -xmp:all -a -G5 FILE
...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 ($).

Phil Harvey

Sometimes I impress myself.  It turned out to be easier than I thought to make this patch.  I haven't tested it very thoroughly yet, but if you can run the pure Perl version, you can download the 11.54 pre-release here and try it out.

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

Phil Harvey

Darn.  I just noticed a complication.  The GSpherical stuff in the video track isn't actually XMP.  It is just some arbitrary XML.  This is a problem since ExifTool doesn't write arbitrary XML.  With some luck it will work anyway (but unlikely).  I'll have to think about how to deal with this.

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