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

Channels not playing "Live" #22

Closed
bds3151 opened this issue Dec 6, 2020 · 131 comments · Fixed by xbmc/inputstream.adaptive#626 or xbmc/inputstream.adaptive#564
Closed

Channels not playing "Live" #22

bds3151 opened this issue Dec 6, 2020 · 131 comments · Fixed by xbmc/inputstream.adaptive#626 or xbmc/inputstream.adaptive#564

Comments

@bds3151
Copy link

bds3151 commented Dec 6, 2020

I'm on a Windows 10 machine running Kodi 18.9 and inputstream,adaptive 2.4.5 and every channel starts from the beginning of the program - not live. Also, when the program ends and sometimes randomly, the channel disconnects and goes back to the Kodi home screen.

@xags
Copy link

xags commented Dec 6, 2020

I'm having the same issue. Debug log includes nothing interesting.

@Doctor-Eggs
Copy link
Contributor

The one thing that I'm seeing in my log is that it appears InputStream Adaptive thinks that it's video on demand (Type: VOD) which aligns with it starting from the beginning and then stopping when it gets to the end.
Example:
INFO: AddOnLog: InputStream Adaptive: Successfully parsed .mpd file. #Periods: 1, #Streams in first period: 2, Type: VOD, Download speed: 10316768.0537 Bytes/s

@d21spike
Copy link
Owner

d21spike commented Dec 6, 2020

I've been looking into the playback issues, hopefully have something soon.

@xags
Copy link

xags commented Dec 6, 2020

I've been running some burpsuite captures all morning and digging too and have yet to see a difference between browser and the plugin. Have you found anything interesting @d21spike? I did see an IA issue but wouldn't think it would be related: xbmc/inputstream.adaptive#560

@d21spike
Copy link
Owner

d21spike commented Dec 6, 2020

@xags I feel you may be onto something. Looking through the logs I do see inputstream.adaptive throwing the following

...

2020-12-06 17:49:24.542 T:5812 DEBUG: ActiveAE::SyncStream - average error of -52.027954, start adjusting
2020-12-06 17:49:24.542 T:5812 DEBUG: ActiveAE::SyncStream - average error -22.027954 below threshold of 30.000000
...
2020-12-06 17:49:25.601 T:2108 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-49589.944928, adjusted:-49589.944928

I think the negative results just force it to the beginning of the stream. Doing some more digging, I don't see any KODIPROP for setting a stream to "live" or "realtime". This tells me it's automatically determined and is a bug on that part. For example ffmpegdirect has the following option,

#KODIPROP:inputstream.ffmpegdirect.is_realtime_stream=true

As of the past couple weeks I have also noticed some licensing issues that popped up and that seem to be resolved now. I feel as though perhaps inputstream.adaptive is undergoing changes perhaps to further support for Kodi 19

I also noticed you can fast forward up-to live but crashes if you go past.

@Doctor-Eggs That is also a possibility which also unfortunately, the mpd parsing is handled by inpustream.adaptive natively and I don't currently see a way to modify that.

On further review of inputstream.adaptive in main.cpp to print the line referenced by @Doctor-Eggs the addon calls

adaptiveTree_->has_timeshift_buffer_

The code to print the log entry

kodi::Log(ADDON_LOG_INFO,
            "Successfully parsed .mpd file. #Periods: %ld, #Streams in first period: %ld, Type: "
            "%s, Download speed: %0.4f Bytes/s",
            adaptiveTree_->periods_.size(), adaptiveTree_->current_period_->adaptationSets_.size(),
            adaptiveTree_->has_timeshift_buffer_ ? "live" : "VOD", adaptiveTree_->download_speed_);

In trying to see where the adaptiveTree is coming from, we can a switch statement

switch (manifest_type_)  
  {  
    case MANIFEST_TYPE_MPD:
      adaptiveTree_ = new adaptive::DASHTree;
      break;
    case MANIFEST_TYPE_ISM:
      adaptiveTree_ = new adaptive::SmoothTree;
      break;
    case MANIFEST_TYPE_HLS:
      adaptiveTree_ = new adaptive::HLSTree(new AESDecrypter(license_key_));
      break;
    default:;
  };

Considering inside Kodi we specify it's an mpd we can deduce it will be a DASHTree

Looking at parser/DASHTree.cpp, there is the following

else if (strcmp((const char*)*attr, "timeShiftBufferDepth") == 0)
      {
        tsbd = (const char*)*(attr + 1);
        dash->has_timeshift_buffer_ = true;
      }

Meaning it's looking for timeShiftBufferDepth in the file which is not there.

In my short lookup of MPD structure and it's syntax, I feel if the developer instead chose to use:

profiles="urn:mpeg:dash:profile:isoff-live:2011"

identifier for MPEG-DASH ISO Base media file format live profile.

or
Live Designation

type="dynamic"

VOD Designation

type="static"

This is talked about in more detail here Support for LIVE (type == dynamic) streams

I'm sure the developer knows a lot more about this than me and has reasoning for the decisions made, this just things I've come up with.

@xags
Copy link

xags commented Dec 7, 2020

@d21spike Great analysis! So for now it doesn't look like anything can be done unless implemented within IA. It seems really odd that those of us using Leia with IA 2.4.5 (that hasn't had a commit since May 18th) that the behavior would suddenly change. I tried to reference a previous MPD from Sling but couldn't find one. I have a feeling that there may be something added within it that's throwing IA off but haven't been able to validate.

@d21spike
Copy link
Owner

d21spike commented Dec 7, 2020

@xags my best guess is Sling changed their MPD format, perhaps standardizing it more. Not surprised either since right now I'm stuck rewriting the login script. Currently starting fresh you wont be able to log in since they changed their endpoints.

@matthuisman
Copy link
Contributor

matthuisman commented Dec 8, 2020

it does check the type..
https:/peak3d/inputstream.adaptive/blob/Matrix/src/parser/DASHTree.cpp#L1020

So this is example mpd
http://p-cdn1-c-cg14-linear-cbd46b77.movetv.com/clipslist/9/20201208T230000Z/20201209T000000Z.mpd

Looks like only urn:mpeg:dash:profile:isoff-live:2011 is used

@xags
Copy link

xags commented Dec 9, 2020

Here is a recent MPD:

<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dvb="urn:dvb:dash:dash-extensions:2014-1" xmlns:move="http://www.movenetworks.com/dash/v1" xmlns:ms="urn:microsoft" xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" maxSegmentDuration="PT2.048000S" minBufferTime="PT2.048000S" publishTime="2020-12-07T20:30:00Z" type="dynamic" minimumUpdatePeriod="PT2.048000S" availabilityStartTime="2020-12-07T20:30:15Z" mediaPresentationDuration="PT9000.000000S" suggestedPresentationDelay="PT4.096000S">
    <ProgramInformation>
        <Linear xmlns="http://www.movenetworks.com/dash/v1">true</Linear>
        <Gaps xmlns="http://www.movenetworks.com/dash/v1" possible="true"></Gaps>
    </ProgramInformation>
    <Period id="1" duration="PT9000.000000S" start="PT0.000000S">
        <BaseURL serviceLocation="A-Akamai" dvb:priority="1" dvb:weight="34">http://p-cdn1-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Fastly" dvb:priority="1" dvb:weight="33">http://p-cdn4-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Level3" dvb:priority="1" dvb:weight="33">http://p-cdn3-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Akamai" dvb:priority="2" dvb:weight="34">http://p-cdn1-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Fastly" dvb:priority="2" dvb:weight="33">http://p-cdn4-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Level3" dvb:priority="2" dvb:weight="33">http://p-cdn3-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Akamai" dvb:priority="3" dvb:weight="34">http://p-cdn1-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Fastly" dvb:priority="3" dvb:weight="33">http://p-cdn4-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <BaseURL serviceLocation="A-Level3" dvb:priority="3" dvb:weight="33">http://p-cdn3-a-cg14-linear-cbd46b77.movetv.com/15803/live/AMCSTR/eb8b58c8386f11eba0930025b5471112/</BaseURL>
        <AdaptationSet contentType="audio" mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1" codecs="mp4a.40.2" lang="en">
            <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="8f1e379b-07ae-4cee-b53a-6c402c2bdbd4" xmlns:v1="http://www.movenetworks.com/dash/v1" v1:widevineProxy="http://p-drmwv.movetv.com/widevine/proxy"></ContentProtection>
            <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="MSPR 2.0">
                <cenc:pssh>AAADMnBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAxISAwAAAQABAAgDPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAHAALQBwAGwAYQB5AHIAZQBhAGQAeQAuAG0AbwB2AGUAdAB2AC4AYwBvAG0ALwBwAGwAYQB5AHIAZQBhAGQAeQAvAHIAaQBnAGgAdABzAG0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAOgAvAC8AcAAtAHAAbABhAHkAcgBlAGEAZAB5AC4AbQBvAHYAZQB0AHYALgBjAG8AbQAvAGwAbwBnAGkAbgAuAGEAcwBwAHgAPAAvAEwAVQBJAF8AVQBSAEwAPgA8AEsASQBEAD4AbQB6AGMAZQBqADYANABIADcAawB5ADEATwBtAHgAQQBMAEMAdgBiADEAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBaAGIATABCADEATgBFAHAAMABGAEEAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=</cenc:pssh>
            </ContentProtection>
            <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
                <cenc:pssh>AAAAXHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADwIARIgOGYxZTM3OWIwN2FlNGNlZWI1M2E2YzQwMmMyYmRiZDQaB3NsaW5ndHYiBkFNQ1NUUioFU0RfSEQ=</cenc:pssh>
                <ms:laurl licenseUrl="http://p-drmwv.movetv.com/widevine/proxy"/>
            </ContentProtection>
            <ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b">
                <cenc:pssh>AAAAIHBzc2gAAAAAEHfv7MCyTQKs4zweUuL7SwAAAAA=</cenc:pssh>
            </ContentProtection>
            <SegmentTemplate timescale="1000" duration="2048" startNumber="19101" initialization="audio/$RepresentationID$/init.mp4" media="audio/$RepresentationID$/$Number%08x$.m4s"></Representation>
        </AdaptationSet>
    </Period>
</MPD>`

@taylormia
Copy link

I'm experiencing the same issue with the channels not playing live. Here's my debug log if it helps. I played CNN to replicate:

https://paste.kodi.tv/avudihafog.kodi

Let me know if I can provide any other logs that may help.

Thanks.

@d21spike
Copy link
Owner

d21spike commented Dec 9, 2020

@matthuisman See below, notice the first two are live and are dynamic but still show up as VOD. The third is On Demand and is coded static and shows up as VOD. I can't deny the code you referenced, it does check. But perhaps it's overwritten at a later point then?

AMC Live

2020-12-08 19:31:08.266 T:23608   DEBUG: CVideoGUIInfo::InitCurrentItem(plugin://plugin.video.sling/?url=http%3A%2F%2Fcbd46b77.cdn.cms.movetv.com%2Fcms%2Fapi%2Fchannels%2F21d18937ced74ecfbba333476d6f4270%2Fschedule%2Fnow%2Fplayback_info.qvt&mode=play&name=AMC)
2020-12-08 19:31:08.266 T:23608   DEBUG: CPlayerGUIInfo::InitCurrentItem(plugin://plugin.video.sling/?url=http%3A%2F%2Fcbd46b77.cdn.cms.movetv.com%2Fcms%2Fapi%2Fchannels%2F21d18937ced74ecfbba333476d6f4270%2Fschedule%2Fnow%2Fplayback_info.qvt&mode=play&name=AMC)
2020-12-08 19:31:08.285 T:14800   DEBUG: Thread BackgroundLoader 14800 terminating
2020-12-08 19:31:08.315 T:14828   DEBUG: AddOnLog: InputStream Adaptive: Effective URL http://p-cdn1-a-cg14-linear-cbd46b77.movetv.com/clipslist/159/20201208T230000Z/20201209T010000Z.mpd
2020-12-08 19:31:08.315 T:14828   DEBUG: AddOnLog: InputStream Adaptive: Download http://p-cdn1-a-cg14-linear-cbd46b77.movetv.com/clipslist/159/20201208T230000Z/20201209T010000Z.mpd finished
2020-12-08 19:31:08.315 T:14828    INFO: AddOnLog: InputStream Adaptive: Successfully parsed .mpd file. #Periods: 1, #Streams in first period: 2, Type: VOD, Download speed: 2588777.9094 Bytes/s

MPD Header

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dvb="urn:dvb:dash:dash-extensions:2014-1" xmlns:move="http://www.movenetworks.com/dash/v1" xmlns:ms="urn:microsoft" xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" maxSegmentDuration="PT2.048000S" minBufferTime="PT2.048000S" publishTime="2020-12-08T23:00:00Z" type="dynamic" minimumUpdatePeriod="PT2.048000S" availabilityStartTime="2020-12-08T23:00:15Z" mediaPresentationDuration="PT7200.000000S" suggestedPresentationDelay="PT4.096000S">

Comedy Central Live

2020-12-08 19:34:52.788 T:18516   DEBUG: AddOnLog: InputStream Adaptive: Effective URL http://p-cdn1-805-cg14-linear-cbd46b77.movetv.com/clipslist/613/20201209T002500Z/20201209T010000Z.mpd
2020-12-08 19:34:52.788 T:18516   DEBUG: AddOnLog: InputStream Adaptive: Download http://p-cdn1-805-cg14-linear-cbd46b77.movetv.com/clipslist/613/20201209T002500Z/20201209T010000Z.mpd finished
2020-12-08 19:34:52.788 T:18516    INFO: AddOnLog: InputStream Adaptive: Successfully parsed .mpd file. #Periods: 1, #Streams in first period: 2, Type: VOD, Download speed: 2822072.5033 Bytes/s

MPD Header

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dvb="urn:dvb:dash:dash-extensions:2014-1" xmlns:move="http://www.movenetworks.com/dash/v1" xmlns:ms="urn:microsoft" xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" maxSegmentDuration="PT2.048000S" minBufferTime="PT2.048000S" publishTime="2020-12-09T00:25:00Z" type="dynamic" minimumUpdatePeriod="PT2.048000S" availabilityStartTime="2020-12-09T00:25:15Z" mediaPresentationDuration="PT2100.000000S" suggestedPresentationDelay="PT4.096000S">

Now for comparison, On Demand - AMC Merry Madagascar (2009)

2020-12-08 19:38:55.394 T:22824   DEBUG: CurlFile::Open(0x26e69154b40) http://p-cdn4-1-cg7-vod-cbd46b77.movetv.com/cms/publish3/entitlement/asset/75b31408171a4dd48d714df7bc34436c/eb068121e3634caeaf90501a0d3ac056.mpd
2020-12-08 19:38:55.396 T:13668   DEBUG: Thread BackgroundLoader 13668 terminating
2020-12-08 19:38:55.425 T:22824   DEBUG: AddOnLog: InputStream Adaptive: Effective URL http://p-cdn4-1-cg7-vod-cbd46b77.movetv.com/cms/publish3/entitlement/asset/75b31408171a4dd48d714df7bc34436c/eb068121e3634caeaf90501a0d3ac056.mpd
2020-12-08 19:38:55.426 T:22824   DEBUG: AddOnLog: InputStream Adaptive: Download http://p-cdn4-1-cg7-vod-cbd46b77.movetv.com/cms/publish3/entitlement/asset/75b31408171a4dd48d714df7bc34436c/eb068121e3634caeaf90501a0d3ac056.mpd finished
2020-12-08 19:38:55.426 T:22824    INFO: AddOnLog: InputStream Adaptive: Successfully parsed .mpd file. #Periods: 1, #Streams in first period: 2, Type: VOD, Download speed: 2475724.5046 Bytes/s

MPD Header

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dvb="urn:dvb:dash:dash-extensions:2014-1" xmlns:move="http://www.movenetworks.com/dash/v1" xmlns:ms="urn:microsoft" xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" maxSegmentDuration="PT2.048000S" minBufferTime="PT2.048000S" type="static" mediaPresentationDuration="PT1414.654000S">

@matthuisman
Copy link
Contributor

matthuisman commented Dec 9, 2020

i see the issue, the mpd is using mediaPresentationDuration.
https:/peak3d/inputstream.adaptive/blob/Matrix/src/parser/DASHTree.cpp#L1015

It comes after the type attribute

So, its looping through each attribute.
It sees type=dynamic and bStatic is set to False
Then it comes across mediaPresentationDuration which sets bStatic to True

removing line https:/peak3d/inputstream.adaptive/blob/Matrix/src/parser/DASHTree.cpp#L1018 would fix it i think.
And I think that may be a correct fix as obviously mediaPresentationDuration doesn't always mean it's static.

mediaPresentationDuration is telling Kodi how long the current program is.
That is why IA will be thinking that means its static

Ill whip up a test Leia windows test build with above change and users can test with..

Anaother work around you could do is proxy the mpd and move "type" after "mediaPresentationDuration "

@d21spike
Copy link
Owner

d21spike commented Dec 9, 2020

@matthuisman Definitely makes sense. I appreciate your help with this. Seems like I have to keep getting familiar with the IA code and MPD format.

My issue with proxy would be more overhead, which smaller devices probably wouldn't like. I personally think that no matter what if the type is dynamic that it should be treated as live, regardless of the order. Perhaps a flag as an override after the if statement, otherwise I think you are correct that removing that line should fix it.

@matthuisman
Copy link
Contributor

matthuisman commented Dec 9, 2020

Here is a Leia Windows version to test with:
https://f.mjh.nz/ia/2.4.6-windows-x86_64-vod-pr.zip

@Doctor-Eggs
Copy link
Contributor

@matthuisman
Tried it but it wasn't successful. I looks like it is now reading it in as live tv but it eventually gives a 404 stream not found error.

https://paste.kodi.tv/ajekaqusur.kodi

@d21spike
Copy link
Owner

d21spike commented Dec 9, 2020

Kodi 18.4 Wouldn't install, below is the message.
image

Kodi 18.9 Took it no problem, unfortunately playback failed. I captured a A&E Live log snippet both with the IA version above and the public release. My current take-away is the changes you've made successfully designate the channel as live. Unfortunately, if you look at the logs below. Once it gets to CApplication::OnAVChange: CApplication::OnAVChange the public one runs CurlFile on ...video/vid03/0000166f.m4s whereas the one you compiled tried to open video/vid03/fffffff8.m4s. Ofcourse the one with a valid link successfuly plays.

Version Above
Complete Log

2020-12-09 07:40:52.155 T:27676   DEBUG: CApplication::OnAVChange: CApplication::OnAVChange
2020-12-09 07:40:52.155 T:13548   DEBUG: CDVDClock::SetSpeedAdjust - adjusted:-0.050000
2020-12-09 07:40:52.156 T:21168   DEBUG: CurlFile::ParseAndCorrectUrl() adding custom header option 'connection: keep-alive'
2020-12-09 07:40:52.156 T:21168   DEBUG: CurlFile::Open(0x1642a970100) http://p-cdn3-805-cg14-linear-cbd46b77.movetv.com/15805/live/AESTR/e51f916239fe11eb88d20025b547210d/video/vid03/fffffff8.m4s
2020-12-09 07:40:52.335 T:21168   ERROR: AddOnLog: InputStream Adaptive: Download http://p-cdn3-805-cg14-linear-cbd46b77.movetv.com/15805/live/AESTR/e51f916239fe11eb88d20025b547210d/video/vid03/fffffff8.m4s failed with error: 404

Public Release
Complete Log

2020-12-09 07:43:31.020 T:8320   DEBUG: CApplication::OnAVChange: CApplication::OnAVChange
2020-12-09 07:43:31.020 T:19732   DEBUG: CurlFile::ParseAndCorrectUrl() adding custom header option 'connection: keep-alive'
2020-12-09 07:43:31.021 T:19732   DEBUG: CurlFile::Open(0x1642b376c30) http://p-cdn3-805-cg14-linear-cbd46b77.movetv.com/15805/live/AESTR/e51f916239fe11eb88d20025b547210d/video/vid03/0000166f.m4s

@matthuisman
Copy link
Contributor

Oh, that second version I posted doesn't have the 1st fix in it to fix the original wrong segments issue (doh!). I'll get a test version with both fixes applied

@xags
Copy link

xags commented Dec 9, 2020

I'd be happy to test a Linux x86_64 version if that gets built too.

@matthuisman
Copy link
Contributor

ok, here is a Leia Windows build to try with both PRs in it
https://f.mjh.nz/ia/2.4.5-windows-x86_64-with-prs.zip

Most interested in what the time displays at the bottom, and if it corrects itself at the next show etc.
Also how rewinding goes etc

@d21spike
Copy link
Owner

d21spike commented Dec 10, 2020

So this is what I'm seeing, definitely acts more like live but seems to be about 20 minutes behind. I have a feeling the time is arbitrary and it just starts playing at the beginning of the playlist file. If you notice in the screenshot it says the episode starts at 6:30 but in reality the screenshot was taken less than a minute into the new episode. Also, when I jump out and back in it, it jumps to the same "starting point". In other words the same spot it did last time and treats it as live.

In terms of rewind, seems to go back just fine. Went back 15 minutes without issue.

image

@bds3151
Copy link
Author

bds3151 commented Dec 10, 2020 via email

@matthuisman
Copy link
Contributor

@peak3d will need to have a look.

@d21spike
Copy link
Owner

@matthuisman Will another log be needed?

@matthuisman
Copy link
Contributor

matthuisman commented Dec 10, 2020

i have one more idea to try...
I suspect IA doesnt like having mediaPresentationDuration for Live content.
So my plan it to only set that if the content is VOD.

Will have build soon to test.

OK, next test build to try:
https://f.mjh.nz/ia/2.4.5-windows-x86_64-with-prs-2.zip

@Doctor-Eggs
Copy link
Contributor

Tried the new build but it is still going to the beginning of the episode.

@d21spike
Copy link
Owner

Yeah same behavior.

@taylormia
Copy link

Just wanted to know if @peak3d or anyone else is pursuing a fix.....or is it not fixable?

@sha1
Copy link

sha1 commented Dec 20, 2020

Looking at test MPDs at https:/Dash-Industry-Forum/dash-live-source-simulator/wiki/Test-URLs, I see that start time is passed to the server through the URL.
E.g. http://livesim.dashif.org/livesim/testpic_2s/Manifest.mpd#t=posix:now
http://livesim.dashif.org/livesim/testpic_2s/Manifest.mpd#t=posix:1465406946

Don't know if this is just a feature of the demo server implementation, or if it's standardized in any way. Still may be worth checking out.

@sha1
Copy link

sha1 commented Dec 20, 2020

From https://modernweb.com/building-an-online-video-player-with-dash-264/, which seems to support my previous comment:

The unfortunate reality is that the DASH specification does not specify whether or not a stream is live. To handle this, the player needs to be built to allow implementers to externally indicate if the stream should be treated as a live stream or not.

Furthermore, how to calculate the live edge:

At the simplest, the calculation to compute the Live Point of a stream is the availabilityStartTime attribute from the MPD subtracted from the actual time. (NOW – MPD.@availabilityStartTime). There are a number of other values in the manifest which can affect this.

In reality, it gets more complex, in that the manifest may separately specify a suggestedPresenetationDelay and a minBufferTime. So, to take those into account, the formula becomes NOW-availabilityStartTime – suggestedPresentationDelay – minBufferTime. The results of that must be checked to make sure it is now greater than NOW-timeShiftBufferDepth, or it will end up looking for a segment which does not yet exist. Once the live edge is calculated, a check needs to be made against the manifest to find the closest segment which starts before that live edge time.

@matthuisman
Copy link
Contributor

sorry, no arm builds yet.

@gazrob
Copy link

gazrob commented Apr 8, 2021

No problem I'll keep an eye out for an update,thanks

@d21spike
Copy link
Owner

d21spike commented Apr 8, 2021

Just tested (Win10 Kodi 19) from the Kodi repo, seems that we are back in business.
image

@bds3151
Copy link
Author

bds3151 commented Apr 8, 2021

Just tried Win10 K19 IS 2.6.11 and Sling didn't play channels. Did you have to do anything other than install Sling and IS?

@d21spike
Copy link
Owner

d21spike commented Apr 8, 2021

@bds3151 Are you on the latest Sling version?
I do have it updated on my repo, repo zip @ http://iofault.com/repo-matrix (Copy-paste in browser for download)

Also make sure the previous workaround is disabled in Sling settings if Slinger is enabled.
image

I did have issues going from Kodi 18 to 19. I had to uninstall including the roaming directory and then install 19. After that, the addon should install IA for you.

All else fail, post a log snippet.

@bds3151
Copy link
Author

bds3151 commented Apr 8, 2021

Yep! Just disabling the workaround got it going - thx.

@matthuisman
Copy link
Contributor

matthuisman commented Apr 8, 2021

Leia big backport PR is ready and awaiting approval:
xbmc/inputstream.adaptive#634

Test builds here if anyone can't wait:
https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-634/11/artifacts/

@d21spike
Copy link
Owner

d21spike commented Apr 9, 2021

Tested inputstream.adaptive+windows-i686/inputstream.adaptive-2.4.7.zip seems to work no problem.

@matthuisman I see the Leia test builds include android. Do you happen to know what the issue (hold up) is with the android builds for Matrix?
This is from https://mirrors.kodi.tv/addons/matrix/
image

@matthuisman
Copy link
Contributor

Its currently being worked on to switch the builds on android from built-in to repo. Hopefully over next days for 19. Then a few more days for 18

@d21spike
Copy link
Owner

@matthuisman improvement in the process is a good thing. As always, I appreciate the hard work.

@matthuisman
Copy link
Contributor

yes, having it provided via the repos instead of built-in on android means updates can be pushed without a new version of Kodi. and slightly smaller APK size too as it won't be in it.

@d21spike
Copy link
Owner

Yeah I think the update capabilities alone make it worth it. Especially considering, android tv is becoming more and more prevalent. Pushing bug fixes will be easier.

@matthuisman
Copy link
Contributor

yup, it will also be going into the Leia repo too (xbmc/inputstream.adaptive#634)
Even though it probably won't get any more updates - im sure if there is something critical we could get a fix out

@d21spike
Copy link
Owner

I figure it will take the better part of a year for most people to transition to Matrix, so it makes sense. I'm trying to maintain both both builds for now as well. Heck I even rewrote my application for packaging/pushing updates to my Kodi Repo, mainly to allow me to pick and choose branches instead of default.

@d21spike
Copy link
Owner

d21spike commented Apr 11, 2021

Sling with IA 2.6.13 on Samsung S10+ and Nvidia Shield confirmed live working with Kodi Matrix
Screenshot_20210410-210256_Chrome

@matthuisman
Copy link
Contributor

matthuisman commented Apr 11, 2021

Leia update should now be live too. 2.4.7
When I get a minute, I'll PR update to coreelec and libreelec

@gazrob
Copy link

gazrob commented Apr 11, 2021

Leia update should now be live too. 2.4.7
When I get a minute, I'll PR update to coreelec and libreelec
Excellent,thanks 👍🏻

@gazrob
Copy link

gazrob commented Apr 11, 2021

Everything working great,thanks guys 👍🏻

@d21spike
Copy link
Owner

Repo version IA 2.4.7 tested on Win 10 with Kodi 18, no issues.

@taylormia
Copy link

I'm on Kodi 18.9 on Win 10 and updated to IA 2.4.7. But when I try to update Sling to version 2021.4.9.1., I get the error "Dependency on XBMC Python version 3.0 could not be satisfied". Any ideas? Thanks.

@d21spike
Copy link
Owner

@taylormia You're trying to run a Kodi Matrix version of the addon on Kodi Leia.

If cloning this repo, make sure you select the right branch
image

Like-wise, my Kodi repo has both versions ... Matrix and Leia

@taylormia
Copy link

The Sling version 2021.4.9.1 showed up as an update...so I tried it...and got the Python error. But it seems like Sling version 10.0.110 on Kodi 18 is working fine with IA 2.4.7 for live channels...with a few seconds delay...which I believe is normal. No plans to update to Kodi 19 yet....thanks @d21spike for all the testing and @matthuisman for the IA fix.

@d21spike
Copy link
Owner

@taylormia Sounds like you're using my repo Kodi for the update.

Update the repo from http://iofault.com/repo-leia
or
https:/d21spike/IOFault-Repo/tree/Leia
image

Then update Sling from there, you should be fine after that.

@taylormia
Copy link

@d21spike Updated to your Leia repo, restarted Kodi and the Sling update went fine. Thanks.

@taylormia
Copy link

Any idea when IA 2.4.7 will be available for Librelec on Kodi 18? The latest version available is 2.4.6.1. Looks like version IA 2.4.7 is required for the live channels fix.

@matthuisman
Copy link
Contributor

I put through a PR to libreelec to update yesterday. It should be in any time now...

@taylormia
Copy link

Updated to IA 2.4.7.1 on LibreELEC 9.2.6 (Kodi 18.9) and Sling Live channels are working now without the delay. Thanks @matthuisman .

@d21spike
Copy link
Owner

Sounds like it's safe to say this issue is now resolved?

@taylormia
Copy link

I would agree from the Kodi 18.9 perspective at least...since that's the version I use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
10 participants