Samsung Motion Photos

Started by francois, April 03, 2016, 12:21:36 PM

Previous topic - Next topic

francois

I'm trying to extract and understand how Samsung Motion Photos are stored. These are the equivalent of Apple Live Photos, with a short video around the photo.

$ exiftool -s -G -U 20160403_163434.jpg
(...)
[MakerNotes]    Unknown_0x0001                  : 0100
[MakerNotes]    Unknown_0x0002                  : 73728
[MakerNotes]    Unknown_0x000c                  : 0
[MakerNotes]    Unknown_0x0010                  : undef
[MakerNotes]    Unknown_0x0040                  : 0
[MakerNotes]    Unknown_0x0050                  : 1
[MakerNotes]    Unknown_0x0100                  : 0
[MakerNotes]    SamsungTrailer_0x0a30Name       : MotionPhoto_Data
[MakerNotes]    SamsungTrailer_0x0a30           : (Binary data 3843849 bytes, use -b option to extract)
[MakerNotes]    SamsungTrailer_0x0a01Name       : Image_UTC_Data
[MakerNotes]    SamsungTrailer_0x0a01           : (Binary data 13 bytes, use -b option to extract)

(...)

How do I extract, say the SamsungTrailer_0x0a01 tag? I've tried many ways to write the tag name in my command line, all return nothing:

exiftool -b -SamsungTrailer_0x0a01 20160403_163434.jpg | xxd

Sample image: https://dl.dropboxusercontent.com/u/15882509/Photos/20160403_163434.jpg

Edit:

Figured out how to extract the tag. The -u (or -U) argument needs to be added, since the tag is actually unknown to ExifTool. I'll turn this post into a feature request, with this new info:

1) Tag SamsungTrailer_0x0a30 is a .mp4 video, with the video part of Samsung "Motion Photo" feature.

2) Tag SamsungTrailer_0x0a01 is a timestamp with ms since epoch.

exiftool -DateTimeOriginal -SubSecTime -s -G 20160403_163434.jpg
[EXIF]          DateTimeOriginal                : 2016:04:03 16:34:34
[EXIF]          SubSecTime                      : 0744

exiftool -SamsungTrailer_0x0a01 -b -u 20160403_163434.jpg | xxd
Warning: [minor] Unknown APP4 segment - 20160403_163434.jpg
0000000: 3134 3539 3639 3430 3734 3830 37         1459694074807


Removing last 3 digits 807 gives 1459694074, i.e. UNIX timestamp in sec for Sunday, 03-Apr-16 14:34:34 UTC.

A nice consequence is that we can infer now the timezone (UTC offset), +0200 in this case. Is there already a composite tag for this?


Phil Harvey

Hi François,

Great, thanks!  These tags will be decoded in the next ExifTool release (version 10.14).

There is currently no Composite tag to derive the camera time zone.  Typically this would be done by comparing the GPS:TimeStamp to other EXIF tags.

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

dclobato

Quote from: Phil Harvey on April 04, 2016, 12:13:52 PMGreat, thanks!  These tags will be decoded in the next ExifTool release (version 10.14)

Hi Phil,

I believe that on images using HEIC format, the metadata are different...

exiftool -u -s -Quicktime:all 20230110_172533.heic
MajorBrand                      : High Efficiency Image Format HEVC still image (.HEIC)
MinorVersion                    : 0.0.0
CompatibleBrands                : mif1, heic
MediaDataSize                  : 1201144
MediaDataOffset                : 32
MediaData                      : (Binary data 1201144 bytes, use -b option to extract)
HandlerType                    : Picture
PrimaryItemReference            : 41
MetaImageSize                  : 4000x2252
HEVCConfigurationVersion        : 1
GeneralProfileSpace            : Conforming
GeneralTierFlag                : Main Tier
GeneralProfileIDC              : Main
GenProfileCompatibilityFlags    : Main 10, Main
ConstraintIndicatorFlags        : 176 0 0 0 0 0
GeneralLevelIDC                : 93 (level 3.1)
MinSpatialSegmentationIDC      : 0
ParallelismType                : 0
ChromaFormat                    : 4:2:0
BitDepthLuma                    : 8
BitDepthChroma                  : 8
AverageFrameRate                : 0
ConstantFrameRate              : Unknown
NumTemporalLayers              : 0
TemporalIDNested                : No
ImageSpatialExtent              : 4000x2252
Rotation                        : 270
Unknown_mpvd                    : (Binary data 1866521 bytes, use -b option to extract)

The video can be extracted using exiftool -b -u -s -Quicktime:Unknown_mpvd 20230110_172533.heic > 20230110_172533.video.mp4, but I can't extract the image or remove the video from the original HEIC file.

The MediaData value is not a heic nor a jpg image...

The sample image is at https://1drv.ms/u/s!AqpVTdxKsQD0isZgZYauVDtPgEj3TA?e=9XSzUQ

Thanks

Phil Harvey

ExifTool 12.55 will be able to read/write/delete this as the MotionPhotoVideo tag.  It is an MP4-format video.  Note that once deleted ExifTool will not have the ability to create it again.

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