-
Notifications
You must be signed in to change notification settings - Fork 719
Description
Use case description
Ability to set an instance of androidx.media3.transformer.Composition into an instance of androidx.media3.exoplayer.ExoPlayer so that the ExoPlayer instance is able to playback/loop/seek an audio/video preview of the contents of the Composition without requiring that a androidx.media3.transformer.Transformer first generate an output video file. Robust video editing applications do not generally require that an output file, made from an entire video editing timeline, is created prior to the user being able to preview the results of adjustments that were made using an interactive video-editing timeline-control.
Understanding that the Composition is part of androidx.media3.transformer and ExoPlayer is part of androidx.media3.exoplayer, I hope that something similar to my feature request, at least in spirit, is possible.
Proposed solution
Similar to ExoPlayer.setMediaSource(), or ExoPlayer.setMediaItem(), an app could call ExoPlayer.setComposition(). Alternatively, perhaps a Composition could generate something like a MediaSource that could be set into the ExoPlayer. AVFoundation, on iOS and MacOS, offers exactly this functionality; an app can create an instance of AVComposition and then set it into an instance of AVPlayer, which can then provide a preview of the contents of the composition.
Alternatives considered
Create my own video editing framework for Android. Especially when considering transitions, such as cross dissolves, live-previewing the contents of something as complex as a full-featured video editing timeline cannot be successfully handled by existing ExoPlayer APIs such as ExoPlayer.setVideoEffects() or ExoPlayer.setMediaSources()