xbmc / inputstream.adaptive

kodi inputstream addon for several manifest types
Other
453 stars 242 forks source link

Aborting playback in the event of commercial breaks or X-discontinuity with the inputstream.adaptive addon #1507

Closed werimail closed 5 months ago

werimail commented 7 months ago

Bug report

Describe the bug

Here is a clear and concise description of what the problem is: Hi @CastagnaIT I noticed that the stream from DAZN Darts x PlutoTV simply stops after a certain time and you end up back in the Kodi main menu. It doesn't matter which Kodi version is used. According to the responsible developer @matthuisman , this is due to the lack of full support for ad breaks or X-discontinuity in the inputstream.adaptive addon. (https://github.com/matthuisman/slyguy.addons/issues/673#issuecomment-1987384548) For the same stream: https://pluto.tv/de/live-tv/64b67f0424ade50008a3be17, playback via browser works without any problems.

Expected Behavior

Here is a clear and concise description of what was expected to happen: The stream should run through without stopping after a certain time.

Actual Behavior

The stream from DAZN Darts x PlutoTV simply stops and ends up back in the Kodi main menu.

Possible Fix

To Reproduce

Steps to reproduce the behavior:

  1. Start Kodi
  2. Play Stream: https://r.mjh.nz/PlutoTV/64b67f0424ade50008a3be17-alt.m3u8 with IPTV Simple Client (with activated option to use HLS streams via the inputstream.adaptive Addon under "Advanced")

Debuglog

The debuglog can be found here: https://github.com/matthuisman/slyguy.addons/files/14551853/kodi.log

MPD/M3U8s/ISM

An example or copy of a manifest (or manifests for HLS - master and variants) can be found here: https://r.mjh.nz/PlutoTV/64b67f0424ade50008a3be17-alt.m3u8

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

note: Once the issue is made we require you to update it with new information should that be required. Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

matthuisman commented 6 months ago

Do other players support it? Vlc? We know ffmpeg doesn't.

On Thu, 18 Apr 2024, 18:03 Stefano Gottardo, @.***> wrote:

Im happy to add in proxy mods for Pluto if they arn't keeping to the standard.

it won't be easy even with a proxy

in my investigations i found these weird behaviours:

  • on next update, can be sent with "same" segments, so no new segs, but, PTS (from EXT-X-PROGRAM-DATE-TIME) are inaccurate and slightly different and endpoints are changed on all segments...
  • on next update, EXT-X-DISCONTINUITY-SEQUENCE could be provided with a broken value (usually higher than current available discontinuities that have no sense) and restored on next updates
  • if EXT-X-ENDLIST is sent after ads it may happen that on next update the EXT-X-DISCONTINUITY-SEQUENCE become badly lowered, on this use case the playlist does not seem to have any reference with the previous manifest, so it should therefore be plpayed starting from the first segment (?) then you should create a new custom discontinuity in order to play the playlist from start, secondary problem: also the decryption can change, and if change, will break the decoding because it is not initialized correctly (playback corrupted) then seem mandatory create a new period
  • if EXT-X-ENDLIST is sent in the middle a tvshow nothing particular happens on the next update (just skip bad manifest)
  • EXT-X-MEDIA-SEQUENCE as already said is unusable and must be recalculated based also on behaviours of previous points
  • EXT-X-PROGRAM-DATE-TIME as said above may vary slightly, should not be a problem if previous problems are solved (at least i hope)
  • if EXT-X-ENDLIST is sent (no segments) request the manifest too quickly results to download the same manifest with no segments, It seems that the server is somewhat busy (?!) in that period of time, here i halved the refresh time interval temporarily, although it doesn't always fill the buffer, but better than nothing...

I will try to see if i can improve the fix for EXT-X-MEDIA-SEQUENCE where in the current fix PR seems not to cover all use cases

— Reply to this email directly, view it on GitHub https://github.com/xbmc/inputstream.adaptive/issues/1507#issuecomment-2063066018, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPQAKPEQCGAJSYPBGYXU3LY55O23AVCNFSM6AAAAABEQBC44CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRTGA3DMMBRHA . You are receiving this because you were mentioned.Message ID: @.***>

CastagnaIT commented 6 months ago

nope webplayers and VLC are not able to play plutotv (VLC sometime play it, but playback broken after some time)

glennguy commented 6 months ago

in my investigations i found these weird behaviours:.......

To me it really sounds like we should look at it like this:

They use a playlist format that somewhat looks and feels like HLS But they break a bunch of rules defined by HLS It plays fine in their player but not others Therefore it is a custom spec manifest and player.

From our end it's hard to support something that isn't documented and whose erratic behaviour make it almost impossible to shoehorn into proper HLS.

The fact that EXT-X-MEDIA-SEQUENCE doesn't function properly puts it dead in the water for me.

One possibility is that they have a big bug in their packager which has gone unnoticed by way of the way their player operates.

But maybe what needs to happen is a parallel capture of what Kodi sees and what comes to the official player. It's possible this is an interesting form of scraping protection where the playlists are intentionally messed up like this to force people off other platforms? When I see the endpoint change after an update that includes PlutoTV_SamsungTV_Error_30sec in the path it makes me suspicious.

A new parser just for this which tracks partial path and filenames (e.g 720p/20230808_173212/hls/hls_2400-00000.ts) instead is an option but a lot of work, and not guaranteed to function correctly either. In the 3 playlists that @CastagnaIT posted earlier, the later update actually replaced older segements with completely different ones. How do you account in the parser for the current playing segment changing altogether??

CastagnaIT commented 6 months ago

How do you account in the parser for the current playing segment changing altogether??

this is a good question, also in my opinion im start thinking that is a custom HLS to discourage external video players to play these channels, playlists updates are too strange

the main problem happens when the ads come in, at which point a very mess happens to playlists updates less problems while a tvshow/film is in playing at that point the playlists are "more stable" (despite wrong sequences)

I tried two new approaches, the first failed, the second that im currently testing looks more promising at least on 4 ads tests has never freezed, so i fixed EXT-X-MEDIA-SEQUENCE and EXT-X-DISCONTINUITY-SEQUENCE by using EXT-X-PROGRAM-DATE-TIME in advance this seems to be sufficiently stable, ads are played but sometimes could be corrupted, such as duplicate segments or cut off but seems to continue playback without too much problems so when tvshow/movie returns after ads, it seems to return to a "stable" playback i need to do more tests, oddities cause all kinds of side effects

werimail commented 6 months ago

How do you account in the parser for the current playing segment changing altogether??

this is a good question, also in my opinion im start thinking that is a custom HLS to discourage external video players to play these channels, playlists updates are too strange

the main problem happens when the ads come in, at which point a very mess happens to playlists updates less problems while a tvshow/film is in playing at that point the playlists are "more stable" (despite wrong sequences)

I tried two new approaches, the first failed, the second that im currently testing looks more promising at least on 4 ads tests has never freezed, so i fixed EXT-X-MEDIA-SEQUENCE and EXT-X-DISCONTINUITY-SEQUENCE by using EXT-X-PROGRAM-DATE-TIME in advance this seems to be sufficiently stable, ads are played but sometimes could be corrupted, such as duplicate segments or cut off but seems to continue playback without too much problems so when tvshow/movie returns after ads, it seems to return to a "stable" playback i need to do more tests, oddities cause all kinds of side effects

Hi @CastagnaIT if I can help you with testing, just provide a fix. I can run the stream on the side and observe the behavior.

Greetings Weri

CastagnaIT commented 6 months ago

in the current state no, because i have partially dropped the code used to delete old periods/discontinuities since was causing problems and i need to understand how to do, without it will fill the memory i have to do more testing because i don't want it to have been pure coincidence that last night it was working...

CastagnaIT commented 6 months ago

i lost many hours to make tests and new changes, but the situation is much more hard than expected, in fact the last solution that i was testing has worked reasonably well, but new types of malformed update manifests are happened and caused freezes and crashes again this custom HLS is a giant crap of playlist...

I am thinking to try another solution that i will try to do on next days, but if this also fails, I will have no other solutions to fix plutotv, if so, the only way is to understand how works the custom plutotv HLS player, which i will not do...

CastagnaIT commented 6 months ago

Given the bad weather day, i decided to go ahead and finish my last attempt... i have tested ADS 3 times, with no freezes or crashes, could happen, however, situations where ADS's are cut, or ADS parts played twice, or ADS temporary freezed for some seconds, anyway the video playback should be restored when the regular tvshow starts

test build:https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/3/artifacts

NOTE: i have add a new parameter, that is mandatory enable it like others before the playback as follow: inputstream.adaptive.manifest_config with {"hls_ignore_endlist":true,"hls_fix_mediasequence":true,"hls_fix_discsequence":true}

Sidenote: Could be that set a inputstream.adaptive.live_delay with value 20, mitigate the possible temporary playback stall caused by manifest update of EXT-X-ENDLIST with no segments, but i have not tried it

MajinLugia commented 6 months ago

I have installed the test build on sony google tv but unfortunately it results in a black screen when watching channels such as 90’s Kids, usually after ads when it says “you are watching kids channels on pluto tv”. I really appreciate the efforts made in trying to fix this very troublesome problem.

glennguy commented 6 months ago

Where I was going with my earlier comments was: Can it be verified that using the official Pluto player, we receive malformed manifests and it plays correctly? Or is the official player getting 'nice' manifests all the time due to some header values or something else that isn't configured in Kodi?

I can try later in the week if needed.

CastagnaIT commented 6 months ago

Can it be verified that using the official Pluto player, we receive malformed manifests and it plays correctly? Or is the official player getting 'nice' manifests all the time due to some header values or something else that isn't configured in Kodi?

i havent found specifics headers at least not from my country, the italian plutotv channels here are more stable than foreign channels that are not accessible, so there are no so malformed playlists, i need to play every time more channels to find one that works a bit bad

The "DAZN Darts x" channel linked in to issue is one of more inconsistent channel, but from my country i cant compare theoriginal website network flow to see differences (VPN corrupt the website)

werimail commented 6 months ago

Hi @CastagnaIT, @glennguy I also tested fix #1532 in various environments over the weekend with the channel “DAZN Darts X”. I noticed that things are running much more stable overall. Every now and then there are interruptions in the middle of the program. The image freezes during the commercial break. I don't think it's perfect yet, but it's definitely good enough that you can look at it sensibly. So I would like to thank you again for the work you have done so far!

Greetings Weri

MajinLugia commented 6 months ago

I wish I was more knowledgeable in being able to report where streams end up freezing but I’m glad to hear that other regions are working a lot better! Unfortunately it seems like the US has troublesome streams such as the 90’s Kids channel and freezes when the “you are watching kids channels on pluto tv header” comes on at the end of commercials. Here is a link if anyone wants to test as this is out of my technical expertise. http://stitcher-ipv4.pluto.tv/v1/stitch/embed/hls/channel/6452c814939a590008567a3blivestitch/master.m3u8?deviceType=samsung-tvplus&deviceMake=samsung&deviceModel=samsung&deviceVersion=unknown&appVersion=unknown&deviceLat=0&deviceLon=0&deviceDNT=%7BTARGETOPT%7D&deviceId=%7BPSID%7D&advertisingId=%7BPSID%7D&us_privacy=1YNY&samsung_app_domain=%7BAPP_DOMAIN%7D&samsung_app_name=%7BAPP_NAME%7D&profileLimit=&profileFloor=&embedPartner=samsung-tvplus&profilesFromStream=true

CastagnaIT commented 6 months ago

thanks for the channel link so we have found another bug but not directly related to the issue

was unhandled transition between encrypted -> unencrypted periods example

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5
#EXT-X-DISCONTINUITY-SEQUENCE:5
#EXT-X-MEDIA-SEQUENCE:96
#EXT-X-PROGRAM-DATE-TIME:2024-04-22T11:00:33.047Z
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000004
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00003.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000005
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00004.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000006
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00005.ts
#EXT-X-DISCONTINUITY
#EXT-X-PROGRAM-DATE-TIME:2024-04-22T11:00:48.047Z
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000001
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00000.ts
#EXT-X-DISCONTINUITY
#EXT-X-PROGRAM-DATE-TIME:2024-04-22T11:00:53.047Z
#EXT-X-KEY:METHOD=NONE
#EXTINF:5,
http://siloh-ns1.plutotv.net/lilo/production/Nick/90sKidsTV/master_120240422T105936_2511628.ts
#EXTINF:5,
http://siloh-ns1.plutotv.net/lilo/production/Nick/90sKidsTV/master_120240422T105941_2511629.ts

this potentially was causing also crashes i have fixed and push to PR new test build: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/5/artifacts

Every now and then there are interruptions in the middle of the program.

yes this is caused because provider dont provide segments, in the worst case can happens also for two consecutive updates, i dont think we can do something here, only mitigate by using live_delay prop

i will try to see next days if im able to catch other cases of video freezes

werimail commented 6 months ago

Hi @CastagnaIT first tests with the new fix #1532 led to Kodi crashes during advertising breaks for me. Apparently there are other places that lead to the crash. kodi_plutotv.log.zip

Greetings Weri

CastagnaIT commented 6 months ago

unfurnately with kodi log is not possible determine the nature of crash, can be anything

MajinLugia commented 6 months ago

thanks for the channel link so we have found another bug but not directly related to the issue

was unhandled transition between encrypted -> unencrypted periods example

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5
#EXT-X-DISCONTINUITY-SEQUENCE:5
#EXT-X-MEDIA-SEQUENCE:96
#EXT-X-PROGRAM-DATE-TIME:2024-04-22T11:00:33.047Z
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000004
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00003.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000005
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00004.ts
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000006
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00005.ts
#EXT-X-DISCONTINUITY
#EXT-X-PROGRAM-DATE-TIME:2024-04-22T11:00:48.047Z
#EXT-X-KEY:METHOD=AES-128,URI="http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400_keyfile_0.key",IV=0x00000000000000000000000000000001
#EXTINF:5,
http://siloh-ns1.plutotv.net/481_Pluto_TV_OandO/clip/607efb363bbc1b001aee5546_PlutoTV_SamsungTV_Error_30sec/720p/20230808_173212/hls/hls_2400-00000.ts
#EXT-X-DISCONTINUITY
#EXT-X-PROGRAM-DATE-TIME:2024-04-22T11:00:53.047Z
#EXT-X-KEY:METHOD=NONE
#EXTINF:5,
http://siloh-ns1.plutotv.net/lilo/production/Nick/90sKidsTV/master_120240422T105936_2511628.ts
#EXTINF:5,
http://siloh-ns1.plutotv.net/lilo/production/Nick/90sKidsTV/master_120240422T105941_2511629.ts

this potentially was causing also crashes i have fixed and push to PR new test build: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/5/artifacts

Every now and then there are interruptions in the middle of the program.

yes this is caused because provider dont provide segments, in the worst case can happens also for two consecutive updates, i dont think we can do something here, only mitigate by using live_delay prop

i will try to see next days if im able to catch other cases of video freezes

It’s definitely working a lot better now! No freezes or black screens as of yet! Thank you for the hard work!

MajinLugia commented 6 months ago

I was testing out the Garfield and Friends stream and it freeze when the “you are watching Garfield and Friends channel on Pluto TV” banner came up. I’m assuming this issue is also part of the unhandled transition between encrypted and unencrypted periods? Here is the link to the channel. http://stitcher-ipv4.pluto.tv/v1/stitch/embed/hls/channel/60faf9ddfcc1f200070a5932/master.m3u8?deviceType=samsung-tvplus&deviceMake=samsung&deviceModel=samsung&deviceVersion=unknown&appVersion=unknown&deviceLat=0&deviceLon=0&deviceDNT=%7BTARGETOPT%7D&deviceId=%7BPSID%7D&advertisingId=%7BPSID%7D&us_privacy=1YNY&samsung_app_domain=%7BAPP_DOMAIN%7D&samsung_app_name=%7BAPP_NAME%7D&profileLimit=&profileFloor=&embedPartner=samsung-tvplus&

CastagnaIT commented 6 months ago

I’m assuming this issue is also part of the unhandled transition between encrypted and unencrypted periods?

i dont think because then most add-ons will complain about this, would be useful have the debug log + all saved manifests, to try understand a bit what happened i will try play the video to see if i catch some problem

but, however it should be considered that this "fix" PR will NEVER be perfect, because of malformed manifests there are situations that are not fixable, not only these situations cause problems to ISA to handle unexpected cases, but also cause problems to the VideoPlayer of Kodi core such as:

werimail commented 6 months ago

unfurnately with kodi log is not possible determine the nature of crash, can be anything

Hello @CastagnaIT , I went back to this version of Fix #1532/2. This means that Kodi runs for me without crashes with the known problems in the Pluto.TV streams. Apparently something was changed between the above version and this: #1532/6, which causes a crash in my environment...do you see a way to localize the problem?

Greetings Weri

CastagnaIT commented 6 months ago

today i have tested for more than 1 hour without crashes, so no idea what happens on your OS

in order to track your crash you need to get the stack trace log im not linux expert so i dont know how to do, but i know that you need "gdb" installed

CastagnaIT commented 6 months ago

@werimail you can try do this but i dont know if it is exactly right steps:

sudo apt-get install gdb gdb "kodi executable path" (or if you are in kodi folder maybe just the executable name) then after kodi crashed, on terminal type bt to get log bt > stacktrace.txt to save it

werimail commented 6 months ago

@werimail you can try do this but i dont know if it is exactly right steps:

sudo apt-get install gdb gdb "kodi executable path" (or if you are in kodi folder maybe just the executable name) then after kodi crashed, on terminal type bt to get log bt > stacktrace.txt to save it

Thanks @CastagnaIT for your tip, but my environment is not a Linux variant, but a custom rom based on Android (LineageOS).

So far the channel "DAZN Darts x" with the ISA version: #1532/7 from today has been running stable in my environment for several hours without crashes and freezes...whatever else you have changed in this version, it seems to work and at least for this channel you have found all possible bugs!

Many Thanks and Greetings Weri

CastagnaIT commented 6 months ago

Even for me it seems to be stable enough tried more times also with italian channels and with "Garfield and Friends channel" linked above seem ok

if you can confirm again, then let's move forward to merge the changes

Last build cleaned up: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/8/artifacts

ksooo commented 6 months ago

Merge it. Works good enough for my problematic (german) test channels. 😀

MajinLugia commented 6 months ago

Had no problems at all yesterday! It seems to work better than the official Pluto TV player! Go with the merge! And keep up the good work!

CastagnaIT commented 6 months ago

good! then i will request the review

werimail commented 6 months ago

Even for me it seems to be stable enough tried more times also with italian channels and with "Garfield and Friends channel" linked above seem ok

if you can confirm again, then let's move forward to merge the changes

Last build cleaned up: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/8/artifacts

Hi @CastagnaIT the last version (https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/8/artifacts) means that the stream is canceled every time there is an advertising break and then returns to the Kodi main menu. Is it possible that an error may have crept in as a result of the “cleaning up”? The previous version still runs in my environment without any problems.

Greetings Weri

CastagnaIT commented 6 months ago

make sure that you have set all three params: {"hls_ignore_endlist":true,"hls_fix_mediasequence":true,"hls_fix_discsequence":true}

werimail commented 6 months ago

make sure that you have set all three params: {"hls_ignore_endlist":true,"hls_fix_mediasequence":true,"hls_fix_discsequence":true}

@CastagnaIT I use this entry in my .m3u:

#EXTINF:-1 group-title="Neu auf Pluto TV;Pluto TV" tvg-chno="215" tvg-id="64b67f0424ade50008a3be17" tvg-logo="https://images.pluto.tv/channels/64b67f0424ade50008a3be17/colorLogoPNG.png" tvg-name="DAZN Darts x Pluto TV" , DAZN Darts x Pluto TV
#KODIPROP:inputstream.adaptive.manifest_config={"hls_ignore_endlist":true,"hls_fix_mediasequence":true,"hls_fix_discsequence":true}
https://r.mjh.nz/PlutoTV/64b67f0424ade50008a3be17-alt.m3u8

Attached is another debug.log: kodi.log

Edit: second version of the debug.log kodi_2.log

CastagnaIT commented 6 months ago

the problem seem to be due to

2024-04-26 09:41:56.108 T:6220 warning : AddOnLog: inputstream.adaptive: Cannot create sample reader due to unhandled representation container type

but its not clear to me how this can happen, i have tested again more times but im not able to replicate this

with the log only im not able to understand the situation if you enable "save manifests" from ISA expert settings you can provide all manifest files with the related log

werimail commented 6 months ago

the problem seem to be due to

2024-04-26 09:41:56.108 T:6220 warning : AddOnLog: inputstream.adaptive: Cannot create sample reader due to unhandled representation container type

but its not clear to me how this can happen, i have tested again more times but im not able to replicate this

with the log only im not able to understand the situation if you enable "save manifests" from ISA expert settings you can provide all manifest files with the related log

Ok @CastagnaIT, here are the manifest files for the mentioned protocol manifests.zip

Edit: by the way...this morning I temporarily switched back to the previous version 1532/7. This has been working for me without any problems so far...

Greetings Weri

CastagnaIT commented 6 months ago

@werimail by reading manifests+log looks similar to mine i tried again on m y pc but unfurnately im not able to replicate your problem

i have rerun the CI builds, i can suggest to try reinstall the binary to be sure that you are running the last PR change https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/9/artifacts

MajinLugia commented 6 months ago

Out of curiosity, do you know why the web url of pluto tv channels crash within a few seconds? I have the manifest here. and here is a URL to the stream. http://stitcher-ipv4.pluto.tv/v1/stitch/embed/hls/channel/6452c814939a590008567a3b/master.m3u8?deviceType=web&deviceMake=Chrome&deviceModel=Chrome&sid=0c9d9262-bcd4-4b33-a78f-afea1ee4a67e&deviceId=781d4c79-fb21-4162-97a4-9f543683f22a&deviceVersion=74.0.3729.131&appVersion=2.5.1-f9a6096b469cfe5e4f1cc92cc697e8500e57891c&deviceDNT=0&userId=&advertisingId=&deviceLat=38.8177&deviceLon=-77.1527&app_name=&appName=&appStoreUrl=&architecture=&serverSideAds=true

tmm1 commented 6 months ago

Happens when you use the same url as another person. The sid= argument must be unique

CastagnaIT commented 5 months ago

if i tried to play that link, after 2-3 manifests the server send only empty manifests with #EXT-X-ENDLIST then the stream become unplayable, however in my case i have no crashes could be one of the reasons of this video service behaviour is what @tmm1 said, anyway this is not related to this issue

MajinLugia commented 5 months ago

Pluto TV is sure a complex platform, the Roku url header results in freezes and shutters every few seconds but the stream doesn't crash while the Samsung and Vizio headers work fine. Each to their own I guess...

werimail commented 5 months ago

@werimail by reading manifests+log looks similar to mine i tried again on m y pc but unfurnately im not able to replicate your problem

i have rerun the CI builds, i can suggest to try reinstall the binary to be sure that you are running the last PR change https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1532/9/artifacts

Thanks @CastagnaIT so far the new version is working quite well for me. I will continue testing in various environments (Windows, Android) over the next few days, hopefully with positive results.

Greetings Weri

CastagnaIT commented 5 months ago

a new ISA version has been released with the patches

ksooo commented 5 months ago

Cool, then i will do a release for pvr.plutotv utilizing the new properties.

matthuisman commented 5 months ago

ill also update my pluto addon to set this new properties. I assume older versions the properties just get ignored so no need to check IA version before adding them?

CastagnaIT commented 5 months ago

they should be ignored by old versions

matthuisman commented 3 months ago

something changed recently? seems pluto playback is again pretty unstable

ksooo commented 3 months ago

seems pluto playback is again pretty unstable

Same for pvr.plutotv

CastagnaIT commented 3 months ago

you can try enable/disable workarounds introduced for pluto {"hls_ignore_endlist":true,"hls_fix_mediasequence":true,"hls_fix_discsequence":true}

since has malformed manifests that corrupt the playlist in any possible way there is a scary mess with segments on timeline and broken periods, they replace them by invalidating existing ones also with diffierents PTS, this causes impossibility even in determining the current period in playing from the manifest update this usually happens when they add ADS periods with also interlude break with "pluto logo"

the interlude break "pluto logo" often is added not caring if it does not match the current period / segments PTS

on last ISA release (of 2 weeks ago) there are no changes that affect it

MajinLugia commented 22 hours ago

Is it possible to have a workaround for whenever you switch to channel while ads are playing? Most Pluto TV channels don't load unless ads are done playing so its a little annoying waiting game.

CastagnaIT commented 14 hours ago

as said on my previous comment, some pluto channels are out-of-specs, so customized by the provider

If someone is able to improve the situation, you are free to propose a code change as long as it does not affect the standard HLS behaviour, acceptable if the change is not too large and can be enabled/disabled as the others workarounds

I've already spent a week on it to implement the workarounds for pluto, from my part i won't waste any more time for a single provider that provides out-of-spec streams

ksooo commented 11 hours ago

from my part i won't waste any more time for a single provider

I completely understand that. However, pluto is one of the biggest providers imo, many people are using pluto, esp. as it is free to use.

MajinLugia commented 10 hours ago

from my part i won't waste any more time for a single provider

I completely understand that. However, pluto is one of the biggest providers imo, many people are using pluto, esp. as it is free to use.

Huge fact, many channels from other regions can also be used which makes this possibly the biggest provider. The workarounds also do not stick when using playlist editors that makes life a whole lot easier when adding a new channel.

CastagnaIT commented 9 hours ago

if you use playlist editors with STRM or M3U8 files, you have to make sure that these playlist files include also ISA properties to enable the workarounds to each channel, otherwise is useless

just to make it clear HLS workarounds will never be enabled by default