Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to show images and video in a playlist in an exoplayer? #844

Closed
kleiren opened this issue Nov 28, 2023 · 2 comments
Closed

Comments

@kleiren
Copy link

kleiren commented Nov 28, 2023

I'm looking for a way to show video and images in sequence in an Exoplayer as an "interactive preview" for a Transformer export.

When using Transformer (in release 1.2.0), an EditedMediaItem can be created from an image MediaItem and added to an EditedMediaItemSequence together with some videos. After exporting the result is a video with the static image in the exported sequence with the defined framerate and time.

This does not work (or at least it is not as straightforward to do) in an Exoplayer to play in a normal playlist. A mediaItem can be created from an image and added to the exoplayer, but the exoplayer will only play video media items.

I see that there are image extractors, an ImageDecoder and an ImageRenderer, but it seems that the ImageRenderer needs an output and does not output to the same place as the videoRenderers.

Is there any way to use this ImageRenderer to output the same way as the video in the exoplayer, with effects from setVideoEffects applied on top? Or just a way to show these images from the mediaitems from the exoplayer mediasources.

Thanks!

@tof-tof
Copy link
Contributor

tof-tof commented Nov 29, 2023

In the last release we added the building blocks for support images to Exoplayer, seen in the image extractors, ImageDecoder and an ImageRenderer you mention, but the ImageRenderer is not linked to the output surface, which is why you see that you the images do not appear on screen.

Currently to play images in exoplayer you must do the following:

  • Set an image duration in the MediaItem
  • Create an ImageOutput dictating where the rendered image should go (i.e. draw the bitmap to the surface) and instantiate an ImageRenderer with this imageOutput, and ensure it is built in your renderer factory. In the next release, you'll be able to set an imageOutput in the defaultRenderersFactory and have the ImageRenderer built for you.

@kleiren
Copy link
Author

kleiren commented Nov 29, 2023

Ok, thank you!
I'll play around with the ImageRenderer.

@kleiren kleiren closed this as completed Nov 29, 2023
@androidx androidx locked and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants