erich_schlaikjer's profile

80 Messages

 • 

1.3K Points

Fri, May 7, 2021 5:53 PM

Closed

.MP.JPG from Pixel phones

Google Pixel phones sometimes produce files with an .MP.JPG extension. These have an embedded mp4 in them:

https://medium.com/android-news/working-with-motion-photos-da0aa49b50c

At first I thought I could just split these files apart in Python using piexif. But this "Micro Video Offset" tag is not in the EXIF data, but in the XMP data (I think).

So I used PIL to look at the XMP data

https://stackoverflow.com/questions/6822693/read-image-xmp-data-in-python

But even then it is not clear where this tag is hiding.

I can keep looking, or I can use the cheesy technique of searching for an mp4 header in the file.

But it suddenly occurred to me that maybe Adobe can accommodate this file format in a nice way? Like showing the linked video in LR?

Because clearly Google is trying to force me into their ecosystem. If I can only pick my favorite frame from the mp4 by using Google's app on my phone, then I am that much further from using an Adobe product.

(I filed this under LR, but really it's applicable to all the Adobe photo suite).

Thanks

Champion

 • 

6K Messages

 • 

103.7K Points

9 m ago

I don't believe LR can display the video in these files. However, if you upload a sample to Dropbox or similar, I'll take a detailed look at the internal metadata.

Champion

 • 

6K Messages

 • 

103.7K Points

9 m ago

Looks like the metadata fields have changed since that post was written. To see all the metadata fields, I did:

exiftool -a -G PXL_20210326_130406364.MP.jpg

I saw these XMP fields:

[XMP]           Directory Item Mime             : image/jpeg
[XMP]           Directory Item Semantic         : Primary
[XMP]           Directory Item Length           : 0
[XMP]           Directory Item Padding          : 0
[XMP]           Directory Item Mime             : video/mp4
[XMP]           Directory Item Semantic         : MotionPhoto
[XMP]           Directory Item Length           : 18430411
[XMP]           Directory Item Padding          : 0

That seems to indicate the MP4 at the end of the file is 18430411 bytes long, and the length of the JPEG at the beginning is 21890703 - 18430411 = 3460292 bytes.

Extracting the MP4 bytes using "dd" successfully extracts an MP4:

dd bs=3460292 skip=1 if=PXL_20210326_130406364.MP.jpg of=out.mp4

80 Messages

 • 

1.3K Points

Yeah, I can do something like that, except I am on Windows, and I have not downloaded exiftool because I am paranoid about executables from the Internet. But I could probably compile it if it is open source. I was just sort of hoping that Adobe could do all the work for me! Maybe I should have posed this as an idea rather than a question.

Thanks.

Champion

 • 

6K Messages

 • 

103.7K Points

Exiftool is perhaps the most widely used photo utility available and is embedded in many commercial products and online services.  It is actively maintained (better than most commercial products, including LR).  So there isn't any danger to installing it. 

(It isn't compiled -- it's implemented in Perl, using the Mac OS Perl interpreter on Mac and the commercial ActivePerl interpreter on Windows.)