ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Fast play will cause the HD video frozen

Open robin2046 opened this issue 9 years ago • 10 comments

Issue description

When testing the new feature of set playback speed, it works well with small video clips, lets say, 240p or 480p, with speed from 1/8 to 8x. However, when trying this feature with HD video, e.g. video clip captured by camera app, when speed is <1.0f it worked fine but if setting speed >= 2.0f, video will freeze after playing several frames (1-2s). And this cannot be recovered no matter how long I waited.

Reproduction steps

Just use the new simple Exoplayer to play a HD video clip captured by camera app, set the speed > 2.0f.

Link to test content

Use camera app to record some HD video clip

Version of ExoPlayer being used

r2.4.0

Device(s) and version(s) of Android being used

Google Pixel Phone, Android Nougat 7.1

robin2046 avatar May 05 '17 15:05 robin2046

if possible, when the power of the device cannot support fast playing of HD video, can Exoplayer try to seek for the iFrame only?

robin2046 avatar May 07 '17 05:05 robin2046

Yes, this is on our list of follow-up work for variable speed playback.

ojw28 avatar May 07 '17 08:05 ojw28

Before the enhancement is ready, how can I detect this frozen and take action?

robin2046 avatar May 10 '17 03:05 robin2046

Same issue. Tested on Nexus 5 with API 23, Samsung Galaxy Tab A (2016) SM-T280 API 21. But on Samsung SM-T580 API 23 HD video with 2x is working.

KirillMakarov avatar Jun 01 '17 15:06 KirillMakarov

I think this is fixed in 2.6.0. @andrewlewis - Can this be closed? Thanks!

ojw28 avatar Jan 02 '18 18:01 ojw28

I can still reproduce this bug on latest dev-v2 branch:

In PlayerActivity::initializePlayer(), add player.setPlaybackParameters(new PlaybackParameters(2.0f, 1.0f)); Then build and install the demo app on a Google Pixel Phone with Android 7.1, run the demo app, and play a 1080p video, for example, Misc -> Screens 1080p (FMP4, H264, No Audio)

Can you see if the above steps reproduce the bug for you? Thanks.

jinminghe avatar Jan 03 '18 04:01 jinminghe

Yes, I think this can be closed: video renderers now skip to keyframes if their decoders can't keep up.

@jinminghe That sample plays as expected at high playback speeds for me: video is not smooth but keyframes are now shown (the old behavior was that one video frame was shown then video was frozen for the duration of playback). In the demo app you should see that a frame is rendered occasionally and the "dropped to keyframe" counter labeled dk: gets incremented each time a frame is shown when the decoder can't keep up.

andrewlewis avatar Jan 03 '18 08:01 andrewlewis

@andrewlewis Thanks. Thought the frame drops were same as 'frozen'.

jinminghe avatar Jan 03 '18 14:01 jinminghe

I can still reproduce this bug on version 2.7.2:

In PlayerActivity::initializePlayer(), add player.setPlaybackParameters(new PlaybackParameters(2.0f, 1.0f)); Then build and install the demo app on a Google Pixel Phone with Android 7.1, run the demo app, and play a 1080p video, for example, Misc -> Screens 1080p (FMP4, H264, No Audio)

please help.

vishal105 avatar Mar 30 '18 08:03 vishal105

Addressed in #4061.

andrewlewis avatar Apr 05 '18 18:04 andrewlewis