Open alex-phillips opened 3 years ago
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:
XMP:MotionPhoto
is set, determines and returns the offset of the videoXMP-GCamera:MicroVideoOffset
of the arrayHOw to play the Video With help of the below tags
"XMP:MotionPhoto": 1, "XMP:MotionPhotoVersion": 1, "XMP:MotionPhotoPresentationTimestampUs": 466480,
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).
This is no longer the case. The following metadata exists instead:
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