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

Player panics when large gaps in playback stream #200

Open
yaruno opened this issue Jul 9, 2024 · 4 comments
Open

Player panics when large gaps in playback stream #200

yaruno opened this issue Jul 9, 2024 · 4 comments

Comments

@yaruno
Copy link
Contributor

yaruno commented Jul 9, 2024

Hi,

Love your project and got a couple of questions related to managing media streams that are missing parts of it.

I'm testing out delivering h264/h265 mpeg-ts stream over webrtc to the player. Everything works flawlessly in good networking conditions (i.e. no packet loss) but when I introduce gaps or packet loss to the stream the player starts to panic and starts giving out [MSEController] > Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null errors.

To my understanding this comes from the deeper browser side as it's unable to 'bridge the gaps' between segments that it is attempting to play. Now naturally I'd like to solve this issue in some smart way. In your opinion what would the best approach to handle or managing the missing information or gaps on video & audio streams? Is there a way to quickly reset the media player or should this be handled at remuxer e.g. by inserting last received video frames again when gap is detected or maybe h264payload parser level? At the moment I'm resorting on reloading the player when it panics but it's not a great way going forwards.

@xqq
Copy link
Owner

xqq commented Jul 10, 2024

@yaruno

The player could only provide a log like Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null errors. since the JavaScript side doesn't provide any details about the reason for the playback error.

Firstly you'd better check the browser's internal media logs like chrome://media-internals, or the Media Tab in the DevTools for more detailed error information.

@yaruno
Copy link
Contributor Author

yaruno commented Jul 10, 2024

Hi xqq,

Yeah the JS unfortunately isn't very verbose about the errors. For reference, here's what chrome://media-internals says when the player panics.

Screenshot 2024-07-09 at 10 54 54

What I've been testing out has been sending a h264 video feed to a player and then introducing gaps into it by omitting e.g. 10 % of video packets. I'm curious on how the player handles gaps in mpeg-ts video feed but so far it's not very happy about them. In contrast to audio only streams over mpeg-ts which seems to be more robust as when gaps appear as it seems like silent frames are added in the remuxing phase to the audio stream.

I'm curious what's your opinion on handling potential gaps or missing frame data on the video stream. What would be the best approach to tackle them?

@HCLAC
Copy link

HCLAC commented Jul 31, 2024

Hi, yaruno, I use the data channel of WebRTC to transmit H265 format videos to the web. I would like to consult with you on how to play videos using Mpets.js?

@abhion
Copy link

abhion commented Nov 6, 2024

@xqq I have the same issue.

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

4 participants