-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Playback without Surface causes dropped frames and delay in video playback when a Surface is added #2575
Comments
Thanks for reporting this. It looks like we should subtract
If you could confirm whether that fixes the issue, that would be great. Thanks! |
hmm not that easy to do that as
where |
Another issue that I encountered in this szenario is that the video never end as long as no surface is set on the video renderer. This is because the I have not tested if the above fix also fixes this issue, I will try that again later if you want. Also should I create a seperate issue for this? |
Yes, we're aware that's a problem. Feel free to file a separate issue for tracking purposes. We're currently trying to figure out exactly how this kind of case should behave. Note that you can disable the renderer (rather than just not having a Surface attached to it) as one way to avoid this problem, although you may find that enabling it again is not seamless. We may change it to be seamless in the future and at that point require that the renderer be disabled, although this is still under discussion. |
I created #2582 just to keep track of it :) |
Issue: #2575 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=150622487
Issue description
When removing the surface from the SimpleExoPlayer and after some time re-adding it a lot of "droppedFrames" messages are triggered. This cause quite some delay before the video playback is continued (while sound is normally playing)
This is cause by a wrong translation of timestamps:
When the MediaCodecRenderer doesn't have a codec it calls
skipToKeyframeBefore
withpositionUs
. This will callskipToKeyframeBefore
on the stream. The stream expects theperiodPositionUs
but the used position therendererPositionUs
. In simple cases this can be adjusted usingRENDERER_TIMESTAMP_OFFSET_US
, but in other cases the offset can be a more variable value and it is not possible to adjust it withoutMediaPeriodHolder
(which is not accessible in theMediaCodecRenderer
. Because the seek fails, the renderer will try to decode all the frames as soon as an output is available again (Surface). As the delay is too high (>30 ms) the frames will be dropped.Reproduction steps
Instantiate a SimpleExoPlayer (
ExoPlayerFactory.newInstance
). Clear surface but let video playback continue. Re-add a surface.Link to test content
http://html5demos.com/assets/dizzy.mp4 (it's easier with longer videos to get some time for a larger time gap -> frames that are dropped)
Version of ExoPlayer being used
r2.3.0
Device(s) and version(s) of Android being used
Tested on PixelXL (7.1.1) and OnePlus 2 (6.0.1)
A full bug report captured from the device
The text was updated successfully, but these errors were encountered: