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

Optimize seek(0, mdk::SeekFlag::FromStart) #188

Open
Vizalkar opened this issue Mar 28, 2024 · 1 comment
Open

Optimize seek(0, mdk::SeekFlag::FromStart) #188

Vizalkar opened this issue Mar 28, 2024 · 1 comment

Comments

@Vizalkar
Copy link

Vizalkar commented Mar 28, 2024

The problem
In our software, the user has the ability to switch to another rendered scene and this is sometimes setup in the way that some videos that were paused need :

  • to reset to start position : seek(0)
  • then switch from paused to playing

This rendered scene switch is not predictable, it is made by the user so we cannot prepare the players before the switch is asked

There are circumstances where there is a perceivable delay between the seek(0) request and the video actually restarting.
That is problematic for our users as they experience this as a lag
NB : this happens even though we do the seek(0) call before the setState(mdk::State::Playing)call

Wanted solution
An optionnal setting that would allow instantaneous restart of videos. This would probably involve a small tradeoff in memory for storing the first frames of the start of the video.

Is this by any means already possible ?

Regards

@wang-bin
Copy link
Owner

wang-bin commented Apr 2, 2024

What decoder are you using? Threading is enabled by default for all decoders, the delayed frames is thread count, event for the key frame decoding. I'm not sure the relationship between delay time and threads. Software decoder is slow. But hw decoders should be fast enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants