-
Notifications
You must be signed in to change notification settings - Fork 575
Description
Version
Media3 main branch
More version details
I used the main branch, but I added the video in a commit. Here is my branch: https://github.com/moi15moi/media/tree/Bug-report
Devices that reproduce the issue
Motorola Moto G Stylus (2023) - Android 14
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
- Launch the demo app in
noDecoderExtensionsRelease
. - Start recording your screen.
- Launch the
test_video_problem.mkv
. - Stop the video.
- With mpv, check out the video recorded. Use
,
and.
to go frame per frame. In media3, you will see that the subtitle doesn't exactly start at the frame 10 and it stop been showed at the frame 21. But, in mpv, you will see that it exactly start at the frame 10 and stop at the frame 20.
Expected result
The subtitle should start being shown at frame 10, remain visible until frame 20, and no longer be shown at frame 21.
Actual result
At frame 10, the subtitle is still not visible.
Then, it appears (even if we are already on the frame 10)
At frame 21, the subtitle is still visible (which it shouldn’t be).
Finally, the subtitle disappears at frame 21.
Here is a video where I recorded my screen while playing test_video_problem.mkv
(all my previous screenshot are from this video): https://github.com/user-attachments/assets/87f36fef-44ec-43b9-af6a-8a332d0813d8
Edit: This probably happen because TextRenderer.render() is not called on each renderer frame timestamps. I added Log.d("DebugRender", "Time: " +getPresentationTimeUs(positionUs) / 1000 + " ms");
at the beginning of render and I got this:
Time: 0 ms
Time: 0 ms
Time: 0 ms
Time: 0 ms
Time: 6 ms
Time: 15 ms
Time: 25 ms
Time: 36 ms
Time: 46 ms
Time: 56 ms
Time: 66 ms
Time: 77 ms
Time: 87 ms
Time: 96 ms
Time: 107 ms
Time: 117 ms
Time: 127 ms
Time: 138 ms
Time: 147 ms
...
For my video (test_video_problem.mkv
), it should be called with these:
Time: 0 ms
Time: 42 ms
Time: 83 ms
Time: 125 ms
Time: 167 ms
From what I can see, this is the workflow to call TextRenderer.render()
:
- ExoPlayerImplInternal.handleMessage()
- ExoPlayerImplInternal.doSomeWork()
- RendererHolder.render()
- TextRenderer.render()
It doesn't seems possible to use the frame timestamps to call TextRenderer.render()
, so I'm not really sure how we could fix this issue.
Media
You can find the video test_video_problem.mkv
in my branch: https://github.com/moi15moi/media/tree/Bug-report
Here is the exact link: https://github.com/moi15moi/media/blob/Bug-report/demos/main/src/main/assets/test_video_problem.mkv
Bug Report
- You will email the zip file produced by
adb bugreport
to android-media-github@google.com after filing this issue.