-
Notifications
You must be signed in to change notification settings - Fork 211
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
ts-inspector crashes on keyframes without PTS/DTS #250
Comments
Can you share the problem segment? I'm curious how playback can even work without PTS/DTS information on the key frame. I saw your fix in #251 and while I don't really have an issue with adding an error check, I'm concerned that there is some other bug in our PES parsing that is incorrectly causing a null PTS/DTS |
No, unfortunately I can't do that. To give a bit more context about the segments:
I am not sure if the following bit about how the segments are obtained is going to be all that helpful, since it seems that this problem only appears in segments which ultimately trace back to some specific sources but not others. With other sources, there is no lack of PTS/DTS info on the keyframes so the problem does not occur. With that said: the segments are recorded from (multicast) UDP input with GStreamer 1.14 using roughly the following pipeline:
The original source is, in fact, RTSP but for $reasons it is received and resent as (multicast) UDP first. The sender is also a (rather older) GStreamer pipeline, similarly to this:
|
I came across a
TypeError
where a bit ofts-inspector
code tried to assign atype
property on anull
object while debugging playback in video.js 7.4 on certain HLS streams that use TS fragments.Tracing the error back to the source, it turns out that when the first key frame is encountered at line 223 of
lib/tools/ts-inspector.js
, an attempt is made to parse the PTS/DTS timestamps using theparsePesTime
function fromlib/m2ts/probe.js
. Looking at this function, that can actually returnnull
on a number of 'error' conditions, in particular when no PTS/DTS information is included with the keyframe.After hacking up a Node JS script to run the affected segment(s) through
ts-inspector.js
to reproduce the crash and adding a bunch ofconsole.log()
calls, it turned out that, yes, these segments did in fact not appear to contain PTS/DTS info. I verified this by looking at the bytes I logged, assuming the offsets used byprobe.js
were correct: on my example segments both the PES flags and size fields were consistently zero.For HLS playback in Chromium and Firefox, at least, this can be fixed by guarding against
null
ints-inspector.js
. Simply not settingfirstKeyframe
in theresult
object seems to work fine.The text was updated successfully, but these errors were encountered: