[Enhancement] Support new Google motion photos Android 11
With Android 11, motion photos are captured and saved differently. Previously, Google motion photos would have metadata specifying there was a 'micro video' embedded as well as the offset (which I believe was the bit offset to split the file on).
"XMP:MicroVideo": 1,
"XMP:MicroVideoOffset": 3711617,
"XMP:MicroVideoPresentationTimestampUs": 1087885,
"XMP:MicroVideoVersion": 1,
This is no longer the case. The following metadata exists instead:
"XMP:MotionPhoto": 1,
"XMP:MotionPhotoVersion": 1,
"XMP:MotionPhotoPresentationTimestampUs": 466480,
I'm not sure the best way to split out the file now as it no longer gives the offset. I found another script that actually reads the data of the file and splits it when it detects a video header in the file. It seems to work with the older style as well as the newer style, but again, not sure if this is the best solution: https://github.com/ViRb3/google-camera-motion-photo-splitter
A stackoverflow on the subject regarding the mp4 header detection: https://stackoverflow.com/questions/53104989/how-to-extract-the-photo-video-component-of-a-mvimg
All we would need is the offset.
Here are my ideas how one could implement it:
- Write a php function to which checks if
XMP:MotionPhotois set, determines and returns the offset of the video - Add the call here (https://github.com/LycheeOrg/php-exif/blob/c8c88a385be0de9af051d6cbbe6dc74ba4b2619b/lib/PHPExif/Adapter/Exiftool.php#L159) and write the offset to
XMP-GCamera:MicroVideoOffsetof the array
HOw to play the Video With help of the below tags
"XMP:MotionPhoto": 1, "XMP:MotionPhotoVersion": 1, "XMP:MotionPhotoPresentationTimestampUs": 466480,