Menu

#1325 Google Motion Photo support (via Save Preview Shots) - patch

1.0
open
nobody
2026-03-11
2026-03-11
No

When "Save Preview Shots" is enabled, instead of saving the preview video as a separate .mp4 file, the video is now muxed into the JPEG as a Google Motion Photo.

The output file is named ORIGINAL.MP.jpg and follows the Google Motion Photo format (GCamera XMP metadata declaring MicroVideo=1, MicroVideoVersion=1, MicroVideoOffset=<mp4 length="">, with the MP4 appended after the JPEG FFD9 end marker).</mp4>

Tested and working on:

  • Ente Photos (Android and Linux desktop)
  • Aves (F-Droid)

Implementation:

  • New file: MotionPhotoMuxer.java — self-contained class that handles XMP injection and MP4 appending, no external dependencies
  • Modified: ImageSaver.java — savePreshotBitmaps() stores the video file reference in the Request after successful encoding; saveSingleImageNow() muxes it into the JPEG after the MediaStore IS_PENDING flag is cleared, then deletes the standalone MP4

No new UI or preferences needed — the existing "Save Preview Shots" toggle controls the feature. If disabled, behaviour is identical to before.

Patch attached.

1 Attachments

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB