ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Can ConcatenatingMediaSource connect multiple video sources to achieve smooth transition at the connection?

Open androidGhost opened this issue 2 years ago • 6 comments

I use ConcatenatingMediaSource to play multiple videos continuously, but sometimes it will pause for a while when playing the next video, is there a good solution to solve this problem, thank you

androidGhost avatar Jul 06 '22 06:07 androidGhost

Have you tried to use the MediaItem API and add multiple media items to the player, one for each video? The player should make transitions seamlessly (no pausing).

The demo app demonstrates this under "Playlists".

christosts avatar Jul 06 '22 14:07 christosts

Thank you for your answer. My requirement is to crop the video and then splicing it together for playback, so I use ClippingMediaSource and ConcatenatingMediaSource for processing, but sometimes the two video connections can be played smoothly, sometimes it will stop for a while, what I need is how to solve it Can't play smoothly.

androidGhost avatar Jul 07 '22 01:07 androidGhost

The version I'm currently relying on is 'com.google.android.exoplayer:exoplayer-core:2.11.4'

androidGhost avatar Jul 07 '22 01:07 androidGhost

@marcbaechinger do you have any insights of the behavior of ConcatenatingMediaSource in 2.11.4?

christosts avatar Jul 07 '22 08:07 christosts

I think this is difficult to achieve because of #9319, #2347 and #5501.

Roughly, #9319 is about the codecs being flushed in between timeline items which results in the problem you are observing.

The other two issues are about the requirement that a media item is clipped at exactly a key frame boundary. If you have this clipping set at a key frame boundary, you may be able to disable flushing the codecs manually as mentioned in https://github.com/google/ExoPlayer/issues/9319#issuecomment-986946127

marcbaechinger avatar Jul 07 '22 11:07 marcbaechinger

I think this is difficult to achieve because of #9319, #2347 and #5501.

Roughly, #9319 is about the codecs being flushed in between timeline items which results in the problem you are observing.

The other two issues are about the requirement that a media item is clipped at exactly a key frame boundary. If you have this clipping set at a key frame boundary, you may be able to disable flushing the codecs manually as mentioned in #9319 (comment)

@marcbaechinger Would you be able to provide a sample on how to manually disable codec flushing? I have been struggling with this issue for a while and could not find a solution. Thank you

ShahyarTaheri avatar Jul 26 '22 20:07 ShahyarTaheri

I think we can close this issue as a combined duplicate of #9319 and #5501 because there is no additional feature tracked that isn't covered by these items already.

tonihei avatar Apr 06 '23 09:04 tonihei