Skip to content
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

Slow scrubbing issue in exoplayer. #9850

Closed
Kanchan3265 opened this issue Jan 10, 2022 · 6 comments
Closed

Slow scrubbing issue in exoplayer. #9850

Kanchan3265 opened this issue Jan 10, 2022 · 6 comments
Assignees
Labels

Comments

@Kanchan3265
Copy link

I am having problem when I am trying to seek through the video in exoplayer. It does not update immediately in the player view. It takes some time to decode the current frame. So when I am seeking the video I can't see the frames in between. Any help or suggestion is appreciated.

@icbaker
Copy link
Collaborator

icbaker commented Jan 10, 2022

Please provide more information about exactly what you're doing and what you expect to see.

So when I am seeking the video I can't see the frames in between.

When you call Player.seekTo(long) the player will not render any frames between the previous playback position and the seek position, so this sounds expected (unless I'm misunderstanding what you're doing here - see above).


The title of your issue mentions 'scrubbing', but it's not mentioned in the issue text. Are you trying to update the currently visible frame while the user is still dragging the time bar around? In that case you will see delays whenever you try and display a non-keyframe, because the decoder has to first decode the preceding keyframe and all intermediate frames before it can decode the target frame.

If your content is HLS or DASH you may wish to look into 'trick play', which is a dedicated video track that only contains keyframes (at low frame rate) and can be used to more quickly render representative frames when scrubbing or fast-forwarding through content.

@Kanchan3265
Copy link
Author

Hey Thanks for replying
I am trying to update the currently visible frame while the user is dragging the time bar around and it is not updating the frames in the player immediately. The video file I am using is a simple downloaded mp4 file.

@icbaker
Copy link
Collaborator

icbaker commented Jan 11, 2022

You can try calling ExoPlayer#setSeekParameters(SeekParameters) to change the seek behaviour away from the default of EXACT. This will make the thumbnail shown less accurate, but it should render faster (because the player only needs to decode a single frame).

Depending on how frequent the key frames are in your content, and how sensitive you are to inaccurate seeking, you may want to only do this when scrubbing (and revert back to 'exact' seeking in other cases).

@Kanchan3265
Copy link
Author

Actually even after trying all the seekparameters I am not getting the required output.It is not smooth enough the frames still take time to reflect.So can you suggest any different approach for acheiving this frame by frame kind of thing.

@tonihei
Copy link
Collaborator

tonihei commented Jan 11, 2022

There is also some guidance for the same issue in #6794 (comment). (Replace the part about onSeekProcessed with onPlaybackStateChanged to STATE_READY when using the latest ExoPlayer version).

And we have an open feature request to automatically adapt the player logic to scrubbing/trick play: #7171

@icbaker
Copy link
Collaborator

icbaker commented Jan 11, 2022

I'm going to close this because I don't think there's anything further to add beyond the references that Toni has linked to.

@icbaker icbaker closed this as completed Jan 11, 2022
@google google locked and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants