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

MPTS not working for live inputstreams but working for recordings #219

Closed
phunkyfish opened this issue May 6, 2019 · 15 comments
Closed
Labels
kodi issue Issue likely in kodi and not the addon kodi pvr Raised issue likely in Kodi PVR not addon

Comments

@phunkyfish
Copy link
Member

When using certain providers in europe that leverage MPTS, such as NOS in portugal these channels will not open a live inputstream (i.e bHandlesInputstream is true and GetChannelStreamProperties and GetRecordingStreamProperties not implemented).

Note that the addon changed from simply passing a URL to kodi pvr to using live streams which caused this to break (in order to support timeshift etc.). The strange thing is a recording will play back just fine, even though recordings for Enigma2 are just raw stream dumps and also use inputstreams.

The following gist contains the logs based on matrix (this also occurs in Leia). The logs provided show:

  1. The addon not playing back a channel using inputstreams
  2. The addon playing back the same channel when not using inputstreams
  3. A recording playing back of the same channel

https://gist.github.com/phunkyfish/887e6e7924b074e2e77adebd4f0b4fb4

This issue is directly related to #208 and may also be related to #195 (although this could be an extended use case of #208).

Thanks to @hudokkow for borrowing an Enimga2 stb and providing the logs.

@phunkyfish
Copy link
Member Author

@peak3d when you have some time could you possibly take a look? Due to recordings working correctly hoping this is something minor to fix.

@peak3d
Copy link

peak3d commented May 6, 2019

@phunkyfish will be most likely @ksooo who has more expereince with this inputstream addon.
If possible, pls. disable the EPG service in the addon to make it easier to read through the logs.

@phunkyfish
Copy link
Member Author

@hudokkow, I have disabled any addon initiated EPG updates on the branches you used to gather the logs. Should mean nothing extra that is EPG related after first minute or so of the log.

If you get a chance to capture the logs again that would be great and they should be a bit cleaner.

@hudokkow
Copy link
Contributor

hudokkow commented May 6, 2019

I'll try to do it tonight.

@phunkyfish
Copy link
Member Author

I actually managed to clean the EPG logging from the logs to make them more readable:

https://gist.github.com/phunkyfish/c6e267e57a703d0e44c4e97432415c02

@phunkyfish
Copy link
Member Author

Most obvious things I see is for inputstreams you see this with only data for a single program number.

2019-05-05 19:33:34.971 T:140566427858688   DEBUG: CInputStreamPVRChannel - OpenPVRStream - opened channel stream pvr://channels/tv/All channels/pvr.vuplus_1.pvr
2019-05-05 19:33:34.971 T:140566427858688  NOTICE: Creating Demuxer
2019-05-05 19:33:34.974 T:140566427858688   DEBUG: Open - probing detected format [mpegts]
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]: Input #0, mpegts, from 'pvr://channels/tv/All channels/pvr.vuplus_1.pvr':
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Duration: N/A, bitrate: N/A
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 4
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 13
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 19
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 20
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 24
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 301
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 303
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 304
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 305
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 306
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 309
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 312
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 313
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 315
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 316
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 317
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 318
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 870
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 880
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 881
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 882
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 883
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 884
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 885
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 886
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 887
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 888
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:     Stream #0:0[0x161]: Video: mpeg2video ([2][0][0][0] / 0x0002), none, 90k tbn
2019-05-05 19:33:34.982 T:140566427858688    INFO: ffmpeg[7FD82BFFF700]:   Program 889
2019-05-05 19:33:34.982 T:140566427858688   DEBUG: CDVDDemuxFFmpeg::AddStream ID: 0

And with no input streams you see each and every program: https://gist.github.com/phunkyfish/08f0d879925b990daa921c0d044453d3

Recording playback behaves similarly to using no inputstreams.

@hudokkow
Copy link
Contributor

hudokkow commented May 6, 2019

Cool, saves me from doing it again tonight.
btw, for clarity the correct PID - or whatever it's called - is encoded in the URL. Taking http://192.168.133.77:8001/1:0:1:370:26:36:CE40000:0:0:0 URL as reference, the correct PID is 880. (370 hex)

@phunkyfish
Copy link
Member Author

Correct, and the addon stores this value per channel. It just doesn’t use it for anything.

@hudokkow
Copy link
Contributor

hudokkow commented May 6, 2019

Yeah, saw the code after publishing above comment. 👍

@phunkyfish phunkyfish added kodi pvr Raised issue likely in Kodi PVR not addon kodi issue Issue likely in kodi and not the addon labels May 13, 2019
@phunkyfish
Copy link
Member Author

So the entry point when not using inputstreams is (which works correctly):

PVR_ERROR GetChannelStreamProperties(const PVR_CHANNEL* channel, PVR_NAMED_VALUE* properties, unsigned int* iPropertiesCount);

But only a single property is set here, the stream URL:

  strncpy(properties[0].strName, PVR_STREAM_PROPERTY_STREAMURL, sizeof(properties[0].strName) - 1);
  strncpy(properties[0].strValue, strStreamURL.c_str(), sizeof(properties[0].strValue) - 1);
  *iPropertiesCount = 1;

Whereas when using inputstreams the entry point is:

bool OpenLiveStream(const PVR_CHANNEL &channel)

Neither explicitly sets the PID, and I'm not seeing in the xbmc codebase (which I'm not that familiar with), what is done differently. I'm a bit stumped.

@hudokkow
Copy link
Contributor

@ksooo, any idea? ^^

@phunkyfish
Copy link
Member Author

Or even some pointers on the best place to start looking? It’s not easy to discern where in kodi core the entry points are.

There must be logic somewhere that chooses the PID and it must differ between the 2 paths.

Will keep digging in the meantime.

phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 27, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 27, 2019
@phunkyfish
Copy link
Member Author

Ok, after 24 hours of sifting through the codebase I realised that the facility to make this work already exists :( Plus, it can all be done from the addon.

@hudokkow are you still able to test? Have created two PR's one for Leia (#230) and one for matrix (#229).

phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 27, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 27, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 27, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 27, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 28, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue May 28, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue Jun 6, 2019
phunkyfish added a commit to phunkyfish/pvr.vuplus that referenced this issue Jun 6, 2019
@phunkyfish
Copy link
Member Author

PR for kodi combined with a change to the addon can fix this. Just waiting for feedback on the above PR for kodi.

It will mean waiting for kodi 18.3 (assuming the PR gets merged).

@phunkyfish
Copy link
Member Author

Closing, please see #237 for solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kodi issue Issue likely in kodi and not the addon kodi pvr Raised issue likely in Kodi PVR not addon
Projects
None yet
Development

No branches or pull requests

3 participants