androidx / androidx/media

Encode ``EditedMediaItem``s as a motion photo

Open
#2,150 1 comment 0 reactions 1 assignee View on GitHub

@droid-girl is already working on this.

Since Feb 17, 2025.

editing enhancement
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Use case description

Currently, the media3 Transformer APIs allow you to either use the photo or video portion of the Motion Photo as an EditedMediaItem.

This is the opposite of what I need to do. My use case is combining a sequence of images (EditedMediaItems) and encoding a Motion Photo. The image sequence would be encoded as the video portion and one of the images would be set as the photo portion.

Proposed solution

Provide and API to encode Motion Photos from EditedMediaItems.

A naive take on what the API could look like:

Transformer.Builder(context)
    .setMotionPhotoMimeType(MimeTypes.IMAGE_JPEG)
    .setMotionPhotoPrimaryPhoto(EditedMediaItem(...))
    .setMotionPhotoMediaItems(ImmutableList.of(
        EditedMediaItem(...),
        EditedMediaItem(...),
        ...
    )).build()
Alternatives considered

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.