[Solved] Pluto TV on Myth
Posted: Fri Jul 13, 2018 1:10 am
Hi all,
Fairly recent "noobie", so please forgive me if this has been asked before (can't find it though...)
My setup is a celeron 3150 (4 cores, 4 threads) 4G RAM, 64G flash and 1TB HDD. Flash is mounted RO and holds all the code, HDD holds recordings, config files that might need to change etc. So it's more an appliance than a HTPC, meaning the WAF/GAF is a high bar. I have an individual tuner for each multiplex in my area ( 5 muxes, about 37 channels all up), with a mumudvb instance for each one, streaming to http unicast on the loopback adaptor. This is all good, other than the known 28/fixes issue with IPTV stream FE channel change crashing the BE, but I have found the patch for this, and am happy to attempt a build on patched sources, or even install 29 if I must.
Now the background is done...
I have a Pluto TV account I am using on a Roku - all fine and dandy.
I want this to be available as a "standard" channel in MythTV backend, so view/record/epg etc etc just like anything else I get (FTA).
EPG part is done - this is no particular problem for me, just a little fiddly because of several things about the Pluto EPG, such as bad start/stop times in the listings (so need to keep a running start/stop time list and add duration etc etc - nasty, but more tedious than hard). I even added external EPG data where Pluto points to a HLS m3u(8) at a third party server (eg RT USA) and just lists "Live program" in every timeslot. So that is fixed (although I may need to modify for start/stop correct times due to the odd timezone they use)
Problem is this: not all "channels" on Pluto TV are "endless" m3u(8) playlists - some are (like RT USA), but most are playlists for an individual show, together with a list of streams for the ads and when to show them. So you can't just point at a single m38(u), you need to download the EPG, find the playlist corresponding to the show on the channel you want to watch, and start THAT. Then, when that ends, you have to "rinse and repeat" so the next program on the channel starts at the time the EPG says it should - perhaps needing to add "filler" content.
This will need to be a daemon I think - listen on network for "channel change" commands (send by record_start/stop external scripts of MythTV), start/stop VLC instances as appropriate, update the playlist when a vlc instance hits end of stream, maybe add some "fill in" streams to cover for the ads and the timing issues that introduces etc.
I am NOT using VLM to do this because it doesn't play nice with https m3u(8) stream uris. So I am starting an instance of vlc when a channel is "tuned", sending a unicast http mpeg/ts stream to a loopback network port (based on channel number, so m3u for Myth is static), keeping a count of how many "listeners" want the channel and stopping the vlc streamer when the last "listener" goes away (recording-start/stop event scripts). I have tested this works and it does, so just the "channel management" or "stream management" bit to do.
Two reasons for the post:
1) does this already exist? (no point in re-inventing the wheel)
2) is anyone else interested in this, especially as a dev and/or tester?
I can do this on my own (and will), but it will take a while to get right, so any helpers/testers would be appreciated.
I would also be very happy to hear of something similar that I can re-jig to suit, or any ideas on how to manage the "channels" - it seems like a bit of a headache to get set-up, but I am determined to get it working. As above, the basics are there, and I can get the streams, just need to make it all transparent to the (l)user.
Tips?
Help?
Anyone? Bueller...
Fairly recent "noobie", so please forgive me if this has been asked before (can't find it though...)
My setup is a celeron 3150 (4 cores, 4 threads) 4G RAM, 64G flash and 1TB HDD. Flash is mounted RO and holds all the code, HDD holds recordings, config files that might need to change etc. So it's more an appliance than a HTPC, meaning the WAF/GAF is a high bar. I have an individual tuner for each multiplex in my area ( 5 muxes, about 37 channels all up), with a mumudvb instance for each one, streaming to http unicast on the loopback adaptor. This is all good, other than the known 28/fixes issue with IPTV stream FE channel change crashing the BE, but I have found the patch for this, and am happy to attempt a build on patched sources, or even install 29 if I must.
Now the background is done...
I have a Pluto TV account I am using on a Roku - all fine and dandy.
I want this to be available as a "standard" channel in MythTV backend, so view/record/epg etc etc just like anything else I get (FTA).
EPG part is done - this is no particular problem for me, just a little fiddly because of several things about the Pluto EPG, such as bad start/stop times in the listings (so need to keep a running start/stop time list and add duration etc etc - nasty, but more tedious than hard). I even added external EPG data where Pluto points to a HLS m3u(8) at a third party server (eg RT USA) and just lists "Live program" in every timeslot. So that is fixed (although I may need to modify for start/stop correct times due to the odd timezone they use)
Problem is this: not all "channels" on Pluto TV are "endless" m3u(8) playlists - some are (like RT USA), but most are playlists for an individual show, together with a list of streams for the ads and when to show them. So you can't just point at a single m38(u), you need to download the EPG, find the playlist corresponding to the show on the channel you want to watch, and start THAT. Then, when that ends, you have to "rinse and repeat" so the next program on the channel starts at the time the EPG says it should - perhaps needing to add "filler" content.
This will need to be a daemon I think - listen on network for "channel change" commands (send by record_start/stop external scripts of MythTV), start/stop VLC instances as appropriate, update the playlist when a vlc instance hits end of stream, maybe add some "fill in" streams to cover for the ads and the timing issues that introduces etc.
I am NOT using VLM to do this because it doesn't play nice with https m3u(8) stream uris. So I am starting an instance of vlc when a channel is "tuned", sending a unicast http mpeg/ts stream to a loopback network port (based on channel number, so m3u for Myth is static), keeping a count of how many "listeners" want the channel and stopping the vlc streamer when the last "listener" goes away (recording-start/stop event scripts). I have tested this works and it does, so just the "channel management" or "stream management" bit to do.
Two reasons for the post:
1) does this already exist? (no point in re-inventing the wheel)
2) is anyone else interested in this, especially as a dev and/or tester?
I can do this on my own (and will), but it will take a while to get right, so any helpers/testers would be appreciated.
I would also be very happy to hear of something similar that I can re-jig to suit, or any ideas on how to manage the "channels" - it seems like a bit of a headache to get set-up, but I am determined to get it working. As above, the basics are there, and I can get the streams, just need to make it all transparent to the (l)user.
Tips?
Help?
Anyone? Bueller...