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

Backward-seeking frame in video get stuck #5499

Closed
5 tasks done
salesh opened this issue May 23, 2023 · 3 comments · Fixed by #5502
Closed
5 tasks done

Backward-seeking frame in video get stuck #5499

salesh opened this issue May 23, 2023 · 3 comments · Fixed by #5502

Comments

@salesh
Copy link

salesh commented May 23, 2023

What version of Hls.js are you using?

v1.4.3

What browser (including version) are you using?

Chrome Version 113.0.5672.92 (Official Build) (64-bit)

What OS (including version) are you using?

Ubuntu 20

Test stream

https://5be196f4-a905-4a83-a0d4-e04cf2e9fe9f.s3.eu-central-1.amazonaws.com/test-two/channel-a_adaptive.m3u8

Configuration

{
  "debug": true,
  "enableWorker": true,
  "lowLatencyMode": true,
  "backBufferLength": 90,
  "maxBufferHole": 0,
  "maxFragLookUpTolerance": 0
}

Additional player setup steps

No response

Checklist

Steps to reproduce

As suggested in #4956 (comment)
I am opening a separate issue.

Currently, we are using in PROD your previous suggestion

I did rebase https://github.com/video-dev/hls.js/compare/bugfix/nudging-over-buffer-hole-when-paused on v1.3.1 and it works.
ref. #5093 (comment)

We are using hls.js in combination with ngx-videogular for live-streaming and playing videos.
We are using Ant Media for producing streams.

The easiest thing for us was to stream test Bunny stream through Ant Media (to avoid copyrights)
https://5be196f4-a905-4a83-a0d4-e04cf2e9fe9f.s3.eu-central-1.amazonaws.com/test-two/channel-a_adaptive.m3u8

[1] Go to https://hls-js.netlify.app/demo
[2] Use

{
  "debug": true,
  "enableWorker": true,
  "lowLatencyMode": true,
  "backBufferLength": 90,
  "maxBufferHole": 0,
  "maxFragLookUpTolerance": 0
}

as suggested by #4956
[3] seek somewhere in the middle and pause the video
[4] add function in the console

const seekFrame = () => {
	const video = document.getElementById('video');
	const newCurrentTime = video.currentTime - 0.04; // 25 FRAME seek
	video.currentTime = newCurrentTime;
	console.log(newCurrentTime);
} 

[5] keep calling till you reach to
[warn] > skipping hole, adjusting currentTime from 459.988593 to 460.088593

Screenshot from 2023-05-23 22-50-02

Observations:

This issue only happens when we are producing adaptive bitrate

Let me know if I can help with more details.
Thank you, Rob!

Expected behaviour

We should be able to do back frame seeking and not hit the wall.

What actually happened?

It hits the wall and can't seek anymore

Console output

It's easily reproducible with a test stream on https://hlsjs.video-dev.org/demo

Chrome media internals output

No response

@salesh salesh added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels May 23, 2023
@robwalch robwalch added Confirmed and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels May 24, 2023
robwalch added a commit that referenced this issue May 24, 2023
@robwalch
Copy link
Collaborator

Confirmed. When seeking to the start of a buffered segment where video has been buffered, but audio starts after the playhead, the gap-controller detects "start gap" conditions because the combined buffer is empty at the playhead, so it seeks forward.

@robwalch
Copy link
Collaborator

Hi @salesh,

Let me know if #5502 resolves the issue for you.

@robwalch robwalch added this to the 1.5.0 milestone May 25, 2023
robwalch added a commit that referenced this issue May 26, 2023
@robwalch robwalch added the Verify Fixed An unreleased bug fix has been merged and should be verified before closing. label May 26, 2023
@salesh
Copy link
Author

salesh commented Jun 1, 2023

Hey @robwalch thank you very much for this!

There was an issue with our environment, so it took a little longer...
Fix works!
Thank you very much!

I tried to look for some buy me a coffee or if there is a way to buy you some beer :)

@robwalch robwalch removed the Verify Fixed An unreleased bug fix has been merged and should be verified before closing. label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants