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

Live stream issues on Tizen 2.4 since 2.5.0 #1134

Closed
JeppeTh opened this issue May 23, 2021 · 22 comments · Fixed by #1258
Closed

Live stream issues on Tizen 2.4 since 2.5.0 #1134

JeppeTh opened this issue May 23, 2021 · 22 comments · Fixed by #1258

Comments

@JeppeTh
Copy link

JeppeTh commented May 23, 2021

Description

Since 2.5.0 I have issues with some HLS live streams.
Hangs on repeated vhs-live-resync.
Not sure how to gather more information...

Sources

Steps to reproduce

Results

Expected

On 2.4.2 playback starts

Error output

More than once per seconds I get
Usage:vhs-live-resync
State:0

Additional Information

videojs-http-streaming version

videojs-http-streaming 2.5.0

videojs version

Any video.js version.

Browsers

Platforms

Tizen 2.4

Other Plugins

Other JavaScript

@welcome
Copy link

welcome bot commented May 23, 2021

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@pmendozav
Copy link

I had the same issue.. my guess was that it is related with the chromium version that tizen uses, there was an update related with pts/dts that was done for modern browsers

@JeppeTh
Copy link
Author

JeppeTh commented Jul 20, 2021

I had the same issue.. my guess was that it is related with the chromium version that tizen uses, there was an update related with pts/dts that was done for modern browsers

"had"? So how was it solved you mean, by some chromium/browser update? Can you find out which chromium version my tizen is using with some debug call?
From this spec it seems at least 2.4 is running webkit and not chromium...
https://developer.samsung.com/smarttv/develop/specifications/web-engine-specifications.html

I have a 2020 TV as well - don't remember if I got this issue there or not...

@JeppeTh
Copy link
Author

JeppeTh commented Jul 23, 2021

Analysed some more - it seems in 2.4.2 seekable.lenth equals 0 which means it will never end up in the resync part.
In > 2.4.2 seekable.length is set to 1. But I guess the "beforeSeekableWindow" should check state or similar as well.
At least it seem the seek to livePoint fails and we end up in a loop (i.e. currentTime is always 0)

This goes on forever:
seekable.start(0): 8
seekable.end(0) : 28
Fell out of live window at time 0. Seeking to live point (seekable end) 28

seekable.start(0) : 8
seekable.end(0) : 28
Fell out of live window at time 0. Seeking to live point (seekable end) 28

@JeppeTh
Copy link
Author

JeppeTh commented Jul 23, 2021

Adding a currentTime > 0 to the beforeSeekableWindow_ to avoid the loop didn't really make it work.
Instead it ends up in stalled where it seems to hang forever - no events.

@gkatsev
Copy link
Member

gkatsev commented Jul 26, 2021

From what I can gather, though, I haven't tried it on a real device and the emulator isn't working for me, all these issues with old TVs is the switch from DTS to PTS in chrome and other browsers that we followed to support them. Unfortunately, there likely isn't a good way for us to support those older browsers which use DTS while supporting the newer browsers which use PTS.
Our recommendation would be to pin the version of VHS to to 2.4.

@JeppeTh
Copy link
Author

JeppeTh commented Jul 26, 2021

How can you notice that https://github.com/videojs/http-streaming/releases/tag/v2.5.0 changed anything related to DTS/PTS?

Is there anyway to confirm that this (=DTS vs PTS) is the issue I'm getting?

I tried once more with latest video.js and then actually any streams (not just live streams) fails to play - they end up in stalled instead of resync loop though....

@pmendozav
Copy link

pmendozav commented Aug 9, 2021

The dummy way I used to check that the problem was related with pts/dts was: compiling http-streaming switching ptsTime -> dtsTime in segment.js

@JeppeTh
Copy link
Author

JeppeTh commented Aug 9, 2021

Ok thx, but don't know how to build it...
But diffing http-streaming.js between 2.4.2 and 2.5.0 showed no differences in the ptsTime occurences. But there might of course be other diffs causing it to end up at ptsTime instead of dtsTime...

@JeppeTh
Copy link
Author

JeppeTh commented Dec 26, 2021

I changed ptsTime -> dtsTime and built manually, but still doesn't work.
I don't see vhs-live-resync - but the reason for that could be that the live streams has changed something.
I can't get any kind of stream working with 2.5 and pts->dts doesn't make a difference - all I get is stalled state.

Any other suggestions on differences between 2.5 and 2.4.2?
I also noticed that already 2.4.2 uses ptsTime - changing back leads to the resync event again...

Also saw that vhs-utils had been stepped - tried to use the old version, lead to some compilation warning and still resync...

Tried
b072c93 @ chore: update @videojs/vhs-utils to v3.0.0 (#1036)
which doesn't work either. So I guess something in this one breaks...

@JeppeTh
Copy link
Author

JeppeTh commented Dec 29, 2021

Seems I kind of solved it - but can't understand from/why there's a problem from b072c93

imported/videojs-http-streaming.min.js (4) :syncPoint for [time: 0] chosen with strategy [Playlist]: [time:0, segmentIndex:0]
imported/videojs-http-streaming.min.js (4) :checkBuffer_ returning https://lbs-aws-hls.tv4play.se/group01/bbr-event1/live.isml/live-audio_0=128000-video=2499968-427287073.ts
imported/videojs-http-streaming.min.js (4) :READY -> WAITING
imported/videojs-http-streaming.min.js (4) :syncPoint for [time: 0] chosen with strategy [Playlist]: [time:0, segmentIndex:0]
imported/videojs-http-streaming.min.js (4) :syncPoint for [time: 0] chosen with strategy [Playlist]: [time:0, segmentIndex:0]
imported/videojs-http-streaming.min.js (3) :TypeError: 'undefined' is not a function (evaluating 'ArrayBuffer.isView(t)')

If I change to it works.
var isTypedArray = function isTypedArray(obj) { try { return ArrayBuffer.isView(obj); } catch (e) { return false; } };

@video-archivist-bot
Copy link

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

JeppeTh referenced this issue in videojs/vhs-utils Dec 29, 2021
…rsing codecs from files (#14)

BREAKING CHANGE: toUint8 in byte-helpers functions slightly differently
BREAKING CHANGE: getId3Offset is exported from id3-helpers rather than containers

We can now parse the container for and many of the codecs within (where applicable) for mp4, avi, ts, mkv, webm, ogg, wav, aac, ac3 (and ec3 which is contained in ac3 files), mp3, flac, raw h265, and raw h264.

Codec parsing has also been extended to parse codec details in a file for vp09, avc (h264), hevc (h265), av1, and opus

Finally we have the following additional features to our parsing of codec/container information:
* skipping multiple id3 tags at the start of a file for flac, mp3, and aac
* discarding emulation prevention bits (in h264, h265)
* parsing raw h264/h265 to get codec params for ts, avi, and even raw h264/h265 files
@gkatsev
Copy link
Member

gkatsev commented Mar 14, 2022

Tizen's documentation seems to imply that TypedArrays on TVs weren't available until 3.0, but on mobile it was available on 2.4 (https://docs.tizen.org/application/web/guides/w3c/supplement/typedarray/#related-information). Are you running on TV or on Mobile?

Though, based on your comment, it seems like it worked with just gating the isTypedArray check in VHS-utils. I wonder if they have TypedArrays, but it isn't complete? Like ArrayBuffer.isView() is missing?
According to MDN, ArrayBuffer was added in Chrome 7, but ArrayBuffer.isView() was added in Chrome 32.

@JeppeTh
Copy link
Author

JeppeTh commented Mar 16, 2022

Yes running TV 2.4.

Do you want me to try
var isTypedArray = function isTypedArray(obj) { return ArrayBuffer && ArrayBuffer.isView(obj);}
instead?;

@gkatsev
Copy link
Member

gkatsev commented Mar 16, 2022

@JeppeTh can you check if ArrayBuffer.isView is available?

@gkatsev
Copy link
Member

gkatsev commented Mar 16, 2022

And whether stuff like Uint8Array are available.

@JeppeTh
Copy link
Author

JeppeTh commented Mar 16, 2022

Yes sure - I'll check
ArrayBuffer
ArrayBuffer.isView
Uint8Array

@gkatsev
Copy link
Member

gkatsev commented Mar 16, 2022

Thanks!

@JeppeTh
Copy link
Author

JeppeTh commented Mar 17, 2022

Seems ArrayBuffer and Uint8Array exists but ArrayBuffer.isView is undefined as you were guessing.

@gkatsev
Copy link
Member

gkatsev commented Mar 17, 2022

Awesome! Thanks for checking. Then, I'll work on getting releases out tomorrow, but should then be fixed with videojs/vhs-utils#33 and #1258

@JeppeTh
Copy link
Author

JeppeTh commented Mar 17, 2022

Great - thx!

@gkatsev
Copy link
Member

gkatsev commented Apr 20, 2022

This is now published in Video.js 7.19.2!

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

Successfully merging a pull request may close this issue.

4 participants