Closed fragande closed 5 years ago
I am only experiencing it with InputStream Adaptive as well, do you know of any channels where I might experience this more often than others?
I am only experiencing it with InputStream Adaptive as well, do you know of any channels where I might experience this more often than others?
Not really, but I'm getting an ad immediately every time I'm opening a (partnered I'm guessing) stream when enough time has passed. There seems to be a time-since-last-ad-check, I'm guessing 15-30 min. After the initial ad it seems like it's up to the streamer to play ads or not, I'm not getting random ones I don't think. One of Twitch's own channels like Twitchpresents or Twitchrivals are probably a safe bet. Let me know if there's something I can assist with, like specific logging or similar.
A clue, maybe, from the streamlink GitHub page:
In the HLS stream, the start and end of an ad sequence is annotated with the #EXT-X-DISCONTINUITY tag. This is meant for telling the player to reset its decoding/rendering state. That does of course only work if a player is reading the HLS stream directly and implements it correctly.
I don't know anything about how inputstream.adaptive actually works, but my impression is that it's an "extra layer" between the player and stream content. Maybe this explains why the ad isn't handled properly with it enabled but works fine when the stream is passed directly to the Kodi video player. Just guessing though.
I did some quick tests and seem to have at least temporarily resolved the issue.
From streamlink I notice they also found that changing the platform to _
worked, but that doesn't seem to be the case anymore. However changing the platform to ps4
changes server_ads
from true
to false
in the token, and I haven't seen any ads since.
From initial (limited) testing it seems to work, I have not seen an ad yet. As it seems Twitch are hellbent on injecting these ads on all platforms now I'm guessing this will be patched as the platform="_" was, but for the time being this seems like a possible workaround.
Would it be possible to simply ignore the segments between the #EXT-X-DISCONTINUITY
markers (resulting in a blank screen or stuck on last frame) or would this cause all sorts of other problems?
From what I was reading, ignoring segments between #EXT-X-DISCONTINUITY
would cause a pause on the last frame or similar until ad was over(as the segments for the stream during that time are replaced by the ad), would also have to be done in InputStream Adaptive.
I don't expect ignoring segments between #EXT-X-DISCONTINUITY
would be accepted for InputStream Adaptive, but I will try to get the black screen reported so it can be resolved for the future.
I see. Well this workaround is very appreciated for the time being. Thank you very much for your efforts.
Thank you! I will try this tonight.
I've updated the beta zip, https://github.com/MrSprigster/Twitch-on-Kodi/releases/tag/2.4.3-dev
Sadly I didn't get a chance to try this out last night but I will re-double my efforts tonight. As always, thank you @anxdpanic !
@anxdpanic I tested plugin.video.twitch-2.4.4.3.3.beta2 on Kodi 17.6 (OSMC 2018.12-1) and it works. Thank you.
Looks good over here!
Thanks for confirming 👍 Closed by 87bb915ee6b2dd46f37b60c77f49f4b592623eef
Twitch recently launched a new ad delivery system which seems to inject ads into the HLS stream. They are calling it SureStream. The problem is that this seems to break the add-on, as every time an ad is supposed to play the screen goes black and stays that way. One or two times an ad has actually played, but screen stays black after. I have not yet been able to capture an instance of this in the log as I've just enabled full logging, will update the post when I do (if there's anything of value in it).
The issue doesn't seem to be with the HLS stream itself as it works fine using Streamlink (the ad plays and stream continues after).
EDIT: Seems like segments are marked as advertisements with SCTE-35 flags (whatever that means...). Could it be that some component of the add-on can't handle these segments properly?
EDIT2: This is what kodi.log looks like when this happens:
And more of the same message until I press the stop button. Don't know if inputstream.adative is to "blame" for this or not. Currently logging with it turned off.
EDIT3: Yes, it does seem like the problem lies with inputstream.adaptive. Turning it off results in the ad playing normally and the stream resuming afterwards. Now the question is if inputstream.adaptive is the culprit in itself or if there's a problem with the way the Twitch add-on is interacting with it.