Discussion about new PVR API to pass stream infos to Kodi
#16
(2017-08-10, 23:30)rbuehlma Wrote: I have created a PR with this proposed interface:

https://github.com/xbmc/xbmc/pull/12654

Thanks. I will comment on github.
Reply
#17
Now that we soon have the new API for the playback URL (https://github.com/xbmc/xbmc/pull/12660)

What do you think about including something like this in the API:

https://github.com/xbmc/xbmc/pull/10363/...938ee2c7fc
This would allow the addon to decide whether a show can be recorded (even it is already in the past).
Its not related to the playback but maybe if we include it now, an API version bump less will be required.

Afterwards, from Zattoo perspective, timeshift would be the last required feature (will now try to implement that as recordings).
Reply
#18
This is what came out of this discussion:

https://github.com/xbmc/xbmc/pull/12660

I will merge this PR the next day(s).
Reply
#19
Merged.
Reply
#20
I'm currently trying to implement the new GetChannelStreamProperties() for pvr.mediaportal.tvserver addon and I'm facing some problems.
It seems that GetChannelStreamProperties() is called before OpenLiveStream()
This is a bit annoying since I know the RTSP url only after the call to OpenLiveStream(). The MediaPortal TV server returns the URL after tuning.
I tried to work around this by tuning already in the GetChannelStreamProperties() function but this results in another problem when doing a channel switch.
On a channel switch, the only call the addon receives is GetChannelStreamProperties() if I return the same URL as for the previous channel.
The problem is that for a channel switch, I have to stop the RTSP stream, tune a new channel and restart streaming. The URL is in most cases the same: e.g. rtsp://127.0.0.1/stream4.0 but I cannot predict it.
During the call to GetChannelStreamProperties(), the existing channel is still playing in Kodi, so stopping the stream and starting a new one results in a playback failure and no new channel playback.

In the old situation, the OpenLiveStream() call was deliberately called before the GetLiveStreamURL() function to address this.

Is there a reason why the GetChannelStreamProperties() function is called before the OpenLiveStream() call?
Developer of the MediaPortal PVR addon and retired developer of the Argus-TV PVR-addon.
http://www.scintilla.utwente.nl/~marcelg/xbmc
Reply
#21
(2017-08-21, 23:07)margro Wrote: I'm currently trying to implement the new GetChannelStreamProperties() for pvr.mediaportal.tvserver addon and I'm facing some problems.
It seems that GetChannelStreamProperties() is called before OpenLiveStream()
This is a bit annoying since I know the RTSP url only after the call to OpenLiveStream(). The MediaPortal TV server returns the URL after tuning.
I tried to work around this by tuning already in the GetChannelStreamProperties() function but this results in another problem when doing a channel switch.
On a channel switch, the only call the addon receives is GetChannelStreamProperties() if I return the same URL as for the previous channel.
The problem is that for a channel switch, I have to stop the RTSP stream, tune a new channel and restart streaming. The URL is in most cases the same: e.g. rtsp://127.0.0.1/stream4.0 but I cannot predict it.
During the call to GetChannelStreamProperties(), the existing channel is still playing in Kodi, so stopping the stream and starting a new one results in a playback failure and no new channel playback.

In the old situation, the OpenLiveStream() call was deliberately called before the GetLiveStreamURL() function to address this.

Is there a reason why the GetChannelStreamProperties() function is called before the OpenLiveStream() call?

If I understood the concept right, OpenLiveStream should not be called if GetChannelStreamProperties returns a "streamurl" that can be handled (!) by Kodi.

If you pass an URL to Kodi, it's 100% up to Kodi's player to handle the stream denoted by the URL - no OpenLiveStream for the add-on etc at all. The add-on is simply not involved in the playback. If this behaves different for you, something goes wrong on either Kodi (stream not playable) or add-on side, cannot tell without more information.

The stream URL is the identity of the stream. That's why passing the same url to Kodi result in no channel switch. Kodi "thinks" it's already playing the stream, thus nothing happens. You need to supply a different url for the different channels.
Reply
#22
Different URL for different channels is not possible for MediaPortal. It is the TV Server backend that determines the URL. The PVR addon is just passing this information to Kodi in the new GetChannelStreamProperties() function.

My challenge is tuning a new channel in the GetChannelStreamProperties() function. A switch to a new channel calls GetChannelStreamProperties() before stopping the playback of the existing stream.
When I stop the rtsp stream at the backend side and restart it for the new channel, the Kodi video player detects that the rtsp stream is gone and it stops playback. It does not start the playback of the URL returned by the GetChannelStreamProperties() function. This did work fine before when the of functions were still in place.

If I skip the stop/start rtsp stream and just tune the new channel and return the (same) URL, Kodi continues the playback of the existing stream but I cannot force the player to jump to the end of the stream, so it continues playback of the old channel upto the time the channel actually switches. Kodi does some buffering for the RTSP playback (5-10 sec) which means that a channel switch can easily take 10-15 sec. This is much slower that stopping and restarting the stream as done before in Krypton.

So, I'm not sure yet what the best way is to fix this...
Developer of the MediaPortal PVR addon and retired developer of the Argus-TV PVR-addon.
http://www.scintilla.utwente.nl/~marcelg/xbmc
Reply
#23
Does it work if you add some dummy values to the URL?
<rtsp-url>?channel=some_channel_identifyer

I expect that the backend will ignore these values but Kodi will recognize them as a new URL.
Reply
#24
(2017-08-22, 18:38)rbuehlma Wrote: Does it work if you add some dummy values to the URL?
<rtsp-url>?channel=some_channel_identifyer

I expect that the backend will ignore these values but Kodi will recognize them as a new URL.
 No, this hack does not work either. So, the result is still that the new GetChannelStreamProperties() does not accept the same URL after a channel switch. MediaPortal only changes the URL on a channel switch when needed (e.g. when switching to a different tuner). Even completely stopping and restarting the stream will most of the times still return the same URL (but tuned to a different channel).
Developer of the MediaPortal PVR addon and retired developer of the Argus-TV PVR-addon.
http://www.scintilla.utwente.nl/~marcelg/xbmc
Reply

Logout Mark Read Team Forum Stats Members Help
Discussion about new PVR API to pass stream infos to Kodi0