Giter Site home page Giter Site logo

New Samsung GCamera XMP tags about exiftool HOT 13 OPEN

doodspav avatar doodspav commented on June 11, 2024
New Samsung GCamera XMP tags

from exiftool.

Comments (13)

doodspav avatar doodspav commented on June 11, 2024
%Image::ExifTool::UserDefined = (

    # XMP tags for Samsung's Motion Photo
    'Image::ExifTool::XMP::GCamera' => {
        MotionPhoto =>                        { Writable => 'integer' },
        MotionPhotoVersion =>                 { Writable => 'integer' },
        MotionPhotoPresentationTimestampUs => { Writable => 'integer' },
    },

);

1;  # end

This is what I have right now in my config file, and it works.

from exiftool.

StarGeekSpaceNerd avatar StarGeekSpaceNerd commented on June 11, 2024

Any idea how it comes up with the MotionPhotoPresentationTimestampUs? The value of 2590122 isn't a date or time, nor is it a Unix time stamp.

The three you list should be easy enough to make a config file (and… you've gone and done it while I'm typing :D )

The XMP-Container:Directory is a bit more complex as it is a structured tag and a list type tag.

from exiftool.

doodspav avatar doodspav commented on June 11, 2024

The MotionPhotoPresentationTimestampUs seems to be the time offset of the key frame image from the start of the video.

from exiftool.

doodspav avatar doodspav commented on June 11, 2024

If XMP-Container::Directory is a structured tag and a list type tag, what type are the other tags I've mentioned so far? Also I read somewhere that if you write a list type tag twice, it writes the value twice rather than replacing the old one. So how would I replace the old value?

Also let me know if you manage to write the config definition for the XMP-Container::Directory because I could really use it for completeness in my project. All I can find so far is a commented out thing with a note about it conflicting with Google's depth-map Device tags.

from exiftool.

boardhead avatar boardhead commented on June 11, 2024

Thanks. I'll add these to the next release. The "Us" in the timestamp tag name is likely microseconds.

If you want to replace the old value of a list tag, just write it once. If you write it twice, you replace the old value with two new values.

I had already generated the necessary code for the Container tags, but I won't impement it due to a conflict with other Google tags. See here:

https://github.com/exiftool/exiftool/blob/master/lib/Image/ExifTool/XMP2.pl#L2108

  • Phil

from exiftool.

doodspav avatar doodspav commented on June 11, 2024

So if I put this into my config file:

    'Image::ExifTool::XMP::Container' => {
        %xmpTableDefaults,
        GROUPS => { 1 => 'XMP-Container', 2 => 'Image' },
        NAMESPACE => 'Container',
        NOTES => 'Google Container namespace.',
        Directory => {
            Name => 'ContainerDirectory',
            FlatName => 'Directory',
            List => 'Seq',
            Struct => {
                STRUCT_NAME => 'Directory',
                Item => {
                    Namespace => 'Container',
                    Struct => {
                        STRUCT_NAME => 'Item',
                        NAMESPACE => { Item => 'http://ns.google.com/photos/1.0/container/item/'},
                        Mime     => { Writable => 'string'  },
                        Semantic => { Writable => 'string'  },
                        Length   => { Writable => 'integer' },
                        Label    => { },
                        Padding  => { Writable => 'integer' },
                        URI      => { },
                    },
                },
            },
        },
    },

How do I set values for this via the command line?

Also, I'm just assuming that it's correct. Idk if I can do %xmpTableDefaults in a config file, but nothing complained about that so far.

from exiftool.

boardhead avatar boardhead commented on June 11, 2024

This won't work for a few reasons, but the biggest problem is a conflict with a different Google Container schema.

I don't have time right now to figure out how this could be done. Maybe sometime in the next week or so I can try this.

  • Phil

from exiftool.

StarGeekSpaceNerd avatar StarGeekSpaceNerd commented on June 11, 2024

See the Structured Information page for dealing with structured data.

Structured data is very complex to deal with. Exiftool can flatten the individual tags within the structure and treat them like a list type tag, but this has problems when one of the structures is missing data that the others don't have. With a correct config file, the flattened output from your App1 xmp data above would look something like this

[XMP-Container] DirectoryItemMime               : image/jpeg,video/mp4
[XMP-Container] DirectoryItemSemantic           : Primary,MotionPhoto
[XMP-Container] DirectoryItemLength             : 0,4370106
[XMP-Container] DirectoryItemPadding            : 138,4370106

Adding the -struct option shows you the actual format of the Directory tag.

C:\>exiftool -G1 -a -s -e --file:all -struct -Directory Y:\!temp\x\y\app1.xmp
[XMP-Container] Directory                       : [{Item={Length=0,Mime=image/jpeg,Padding=138,Semantic=Primary}},{Item={Length=4370106,Mime=video/mp4,Padding=0,Semantic=MotionPhoto}}]

or in a more human readable form

[{
        Item = {
            Length = 0,
            Mime = image / jpeg,
            Padding = 138,
            Semantic = Primary
        }
    }, {
        Item = {
            Length = 4370106,
            Mime = video / mp4,
            Padding = 0,
            Semantic = MotionPhoto
        }
    }
]

So with a proper config file, you could either write the data as flattened tags (note that these may not be the actual names with a config file)

exiftool -XMP-Container:DirectoryItemMime="image/jpeg,video/mp4" -XMP-Container:DirectoryItemSemantic="Primary,MotionPhoto" -XMP-Container:DirectoryItemLength="0,4370106" -XMP-Container:DirectoryItemPadding="138,0" /path/to/files/

or when using the -struct option

exiftool -XMP-Container:Directory=[{Item={Length=0,Mime=image/jpeg,Padding=138,Semantic=Primary}},{Item={Length=4370106,Mime=video/mp4,Padding=0,Semantic=MotionPhoto}}] /path/to/files/

from exiftool.

doodspav avatar doodspav commented on June 11, 2024

Wow yeah that does look complicated. I tried the config file, and you're right that it doesn't work out of the gate, but I'm stumped as to what to do to fix it / how to resolve the conflict.

For now I'll just skip the container when making my motion photos, and if Phil manages to come up with a solution, I'll incorporate that.

from exiftool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.