videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.48k stars 421 forks source link

false positive illegalMediaSwitch #425

Open mjneil opened 5 years ago

mjneil commented 5 years ago

Description

A segment that has multiple differing PMTs can cause a false positive illegalMediaSwitch to occur. The setup is a muxed stream where each segment contains more than one PMT, where the FIRST PMT only contains 1 track (audio or video), and the next PMT contains both tracks. For transmuxing and playback, this is fine and valid, as our transmuxer will "refresh" its internal PMT whenever it encounters a new one. However, illegalMediaSwitch detection uses the results of the tsprobe, which ONLY parses the FIRST PMT it finds and stops since it runs on the main thread and we want to probe very quickly. This means SegmentLoader will think startingMedia will be only video or only audio, depending on the value of the first PMT. The false positive occurs when a future segment in the stream has a first PMT with the track that was not present in the starting segment, falsely thinking we are transitioning from an audio only stream to a video only stream (or vice versa) even though every segment has audio and video frames.

An easy and obvious solution would be to have the probe parse every single packet to look for additional PMTs, but being on the main thread this could have performance impacts. TBA changes would probably take care of this automatically.

Sources

http://d2zihajmogu5jn.cloudfront.net/bad-pmt/media.ts http://d2zihajmogu5jn.cloudfront.net/bad-pmt/index.m3u8

videojs-http-streaming version

latest

mparisi76 commented 5 years ago

Hi @mjneil. Thanks for creating this ticket. This is a rather urgent problem for us as we were not able to release the new version of videojs for our clients last Friday. We have not been able to address this issue on our end using PMT as you suggested. I couldn't find any information on this. Can you provide an estimate as to when you think the videojs team will address this?

Thank you.

Matt

mparisi76 commented 5 years ago

Any updates on this?

mparisi76 commented 5 years ago

Any updates on this?

mparisi76 commented 5 years ago

@mjneil Any updates up on this?

Thank you.

Matt