Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7
IPTV Simple Client with archive support
#1
I began working on enabling IPTV Simple Client to support the archive feature some IPTV services provide.
The idea is to allow users select a program from the EPG and play it.
Basically it works like this: IPTV providers have an API for accessing the archive, usually it's a custom URL with a placeholder for one or more timestamps.
The Archive feature also allows us to have 'pseudo-timeshift'. This also allows you to have a timeshift buffer that is as long as the whole archive duration, because nothing is physically stored on your device. This can be days worth of timeshifting.

This requires us to close the stream and reopen it again with a new URL. I've got it working with some modifications to both Kodi and the IPTV Simple Client. But I would like to avoid any Kodi modifications that "bend" it to work with the custom implementation I came up with.
I'm not sure how to properly implement it without writing a complete Demux on IPTV Simple Client's side.
I tried to get it working by using vuplus as a template. I Created a CURL file object with the URL to the channel (it is a m3u8 playlist containing the stream list for the channel), it starts playing the channel, but instead of passing the URL as is, it's extracting one the TS streams and so playback ends after just a few seconds.

I'm looking for suggestions on how to proceed from this point forward.
How can I open the stream correctly with the proper URL passed on to the Demux object?
And is it possible to close the stream and open a new one with a new URL? Wouldn't I need to clear the buffers from the previous stream?
Reply
#2
I’m not familiar with demuxing, can you explain why you use it and why it is required?

If it’s just a URL you are using you should be able to just reload it if you move outside the current buffer as I imagine there is a delay incurred with pseudo timeshift. When this happens you would reset the timeshift buffer.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#3
As suggested maybe a good approach would be to add Timeshift to SimpleIPTV and then further extend that to support archive?

Happy to help with this to give you a good foundation to work from.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#4
Ok, so to simply start a program from EPG, it should be simple enough.
The issue is how do we enable timeshift when it requires to restart the stream with a different URL? We need to stop the stream and start a new one seamlessly for the user.
I couldn't find a way to do that without any modifications to Kodi, or implementing a custom demux.

A custom demux may be required to enable us to do that, take a look at the DVDDemux part of Kodi source, right now Kodi uses DVDDemuxFFmpeg for streaming live tv.

Just to clarify something, I'm not talking about "real" timeshift, where a stream is recorded to the hard drive, allowing you to seek back to the start of the recording.
I'm talking about pseudo-timeshift. When you skip back from "Live", you will open a new URL with the timestamp to the place you want to watch. That way you can "timeshift" days back without problem, and you can skip whole programs back/forward.
Reply
#5
(2018-10-31, 09:53)phunkyfish Wrote: As suggested maybe a good approach would be to add Timeshift to SimpleIPTV and then further extend that to support archive?

Happy to help with this to give you a good foundation to work from.


I think this would be a very good approach.

My take is that once we have timeshift support in pvr.iptvsimple adding the archive stuff is quite easy.
Reply
#6
What is the purpose of ReadLiveStream() function? To pass stream data to Kodi again and again until playing is stopped? I mean Kodi doesn't open some url directly?
Reply
#7
Have you thought about not Kodi opening the url and reading data, but the add-on?

There are three ways for an add-on to serve streams:

1) just hand over a url to Kodi and let Kodi do the rest, including opening the connection, reading data etc. This is what pvr.iptvsimple does today.

2) hand over the raw stream data to Kodi. This is more flexible, but a bit more work on the add-on side. Add-on needs to care about connection handling, data buffering,...

3) implement own demuxer in the add-on and hand over the demuxed streams to Kodi. Most flexible and most complex approach on the add-on side.

For timeshifting, the add-on needs to imlement 2) or 3)

I suggest to implement 2) for pvr.iptvsimple
Reply
#8
Yes, I'm thinking to implement #2.
Reply
#9
(2018-10-31, 10:57)ultraman Wrote: Yes, I'm thinking to implement #2.


Sorry, who are you and where do you want to implement that? You are not Arthur, the author of pvr.iptvarchive, aren't you.
Reply
#10
Method #2 is what I was trying to do, I assume that it's what vuplus is doing.
This doesn't seem to work as expected in several ways:
1. The URL Kodi ends up opening is the actual TS stream rather than the channel m3u8 playlist like the stock iptvsimple does today. When the TS stream ends, playback stops.
2. How do we stop and restart the stream after timeshifting? I tried to clarify what I mean by "timeshift" in post #4
3. Kodi still goes through DVDDemuxFFmpeg, which doesn't call the input stream Seek methods. So we can't do seek.
Reply
#11
We need to sort that out, "hacking" Kodi the way you did to get 1) working is imo not the way to go.
Reply
#12
I'm just one random guy who started all this work Angel

I'm using "Play from EPG" functionality in pvr.iptvsimple for almost a year. And I show it to Arthur (The Coolest) few weeks back who like the functionality. With his skills he added proper seeking of the stream in Kodi. And now we both are looking how to make it better to be accepted to Kodi.

So to conclude: I'm no one.
Reply
#13
(2018-10-31, 11:07)ultraman Wrote: I'm just one random guy who started all this work Angel

I'm using "Play from EPG" functionality in pvr.iptvsimple for almost a year. And I show it to Arthur (The Coolest) few weeks back who like the functionality. With his skills he added proper seeking of the stream in Kodi. And now we both are looking how to make it better to be accepted to Kodi.

So to conclude: I'm no one.


Ah, nice. You are very welcome here. Just wanted to understand whether we're tackling two different projects here or just one.
Reply
#14
@ksooo I agree that the "hack" I made isn't the right way to go. There's no doubt about it. 
It was the only way *I* could think of how to achieve the functionality we wanted. 
As I see it, we either need a custom demuxer or a new API to allow this to work.
Reply
#15
Perfect, that's a good starting point.
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
IPTV Simple Client with archive support2