Open GlebPBanuba opened 4 months ago
Thanks for sharing the example project!
The reason for what you are seeing is that each item is played independently. Each individual clip needs to decode samples from the previous keyframe to start at the correct frame. By default, ExoPlayer uses a single codec for a playback, so at every transition there is small gap where the codec needs to process all the samples from the previous keyframe that are not shown on screen.
We are working on improvements that allow to use a second decoder for these types of transitions. This way the second decoder can already decode the required samples for the next clip and the transitions can become seamless again. This is still work in progress though, so I'll mark it an enhancement. @microkatz not sure if there is already another enhancement tracking this support, feel free to de-duplicate if so.
Version
Media3 main branch
More version details
No response
Devices that reproduce the issue
All
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
We are experiencing the serious issue while playing video by trimmed media sources within single video. Let's say there is a video (60 seconds) and the user wants to trim the video by selecting a number of sources in the video i.e.
The player does not play these source smoothly while using ConcatenatingMediaSource and ConcatenatingMediaSource2.
This sample https://github.com/Banuba/android-media3-issue-concatenating is prepared to clearly demonstrate the issue.
PTAL and advice how to mitigate an impact of this issue.
Expected result
No long visible freezes
Actual result
Long freezes while playing a number of trimmed media source within one video
Media
This sample https://github.com/Banuba/android-media3-issue-concatenating is prepared to clearly demonstrate the issue. Zip file with the sample is attached as well. android-media3-issue-concatenating.zip android-media3-issue-concatenating.zip
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.