jkingok / node-ffmpeg-mpegts-proxy

Simple proxy for leveraging ffmpeg to convert any source URL into MPEG-TS over HTTP
GNU General Public License v2.0
5 stars 1 forks source link

Help please with lineup.json #1

Open bjzy opened 7 years ago

bjzy commented 7 years ago

Hello - Thank you very much for your fork. I am attempting to get my IPTV streams into PlexDVR.

I am doing something incorrect and am hoping you could provide some suggestions.

I have configured my sources.json file as follows but I'm a bit lost about creating the lineup.json file. It looks like you're using a lineup.sh to do it dynamic? I was hoping to try it with just a few channels at first to gain a better understanding of how it works.

Thank-you

bjzy@IPTVPlexTestVM:~/node-ffmpeg-mpegts-proxy$ cat sources.json
[
    {
        "name": "ESPNEWS",
        "provider": "IPTV",
        "url": "/auto/v1",
        "source": "http://myip.tv:9100/view/ch01q1.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9OC8yMi8yMDE3IDI6MdGVzPTI0MCZpZD12aWV3bXMtMTUzNTk==="
    },
    {
        "name": "ESPN",
        "provider": "IPTV",
        "url": "/auto/v2",
        "source": "http://myip.tv:9100/view/ch02q1.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9OC8yMi8yMDE3IDI6MdGVzPTI0MCZpZD12aWV3bXMtMTUzNTk==="
    },
    {
        "name": "ESPN2",
        "provider": "IPTV",
        "url": "/auto/v3",
        "source": "http://myip.tv:9100/view/ch03q1.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9OC8yMi8yMDE3IDI6MdGVzPTI0MCZpZD12aWV3bXMtMTUzNTk==="
    },
    {
        "mime": "application/json",
        "script": "./discover.sh",
        "url": "/discover.json"
    },
    {
        "mime": "application/json",
        "script": "./lineup.sh",
        "url": "/lineup.json"
    },
    {
        "mime": "text/plain",
        "file": "/dev/null",
        "url": "/lineup.post"
    },
    {
        "mime": "application/json",
        "file": "lineup_status.json",
        "url": "/lineup_status.json"
    },
    {
        "mime": "text/html",
        "file": "guide.html",
        "prescript": "./guide.py",
        "url": "/guide.html"
    }
]
screen shot 2017-08-21 at 9 53 58 pm
bjzy@IPTVPlexTestVM:~/node-ffmpeg-mpegts-proxy$ sudo nodejs node-ffmpeg-mpegts-proxy.js -s sources.json
[sudo] password for bjzy:
2017-08-22T04:50:03.130Z - info: Loaded 8 sources
2017-08-22T04:50:03.139Z - info: Server listening on ports 80 and 5004
2017-08-22T04:53:31.500Z - debug: Got request for /discover.json from ::ffff:192.168.30.225
2017-08-22T04:53:31.510Z - debug:
2017-08-22T04:53:31.513Z - debug: Got request for /lineup_status.json from ::ffff:192.168.30.225
2017-08-22T04:53:31.515Z - debug: Got request for /discover.json from ::ffff:192.168.30.225
2017-08-22T04:53:31.520Z - debug:
2017-08-22T04:53:31.521Z - debug: Got request for /lineup_status.json from ::ffff:192.168.30.225
2017-08-22T04:53:36.801Z - debug: Got request for /lineup.json from ::ffff:192.168.30.225
2017-08-22T04:53:36.805Z - debug: ./lineup.sh: Host: 192.168.30.225

2017-08-22T04:53:54.876Z - debug: Got request for /lineup.post?scan=start&source=Antenna from ::ffff:192.168.30.225
2017-08-22T04:53:54.879Z - debug: Got request for /discover.json from ::ffff:192.168.30.225
2017-08-22T04:53:54.884Z - debug:
2017-08-22T04:53:54.886Z - debug: Got request for /lineup_status.json from ::ffff:192.168.30.225
jkingok commented 7 years ago

Hi, and sorry for missing your email I got buried and I didn't see it until now.

If you didn't solve this already, and for the benefit of everyone else, here's an explanation. You're right, I had a "lineup.sh" script which is customising my lineup according to the Host header sent by Plex, this was because I was trying to run separate DVRs in different program guide regions.

However most people, including you, don't need to bother with that. In that case you just use a file parameter instead of a script.

As it happens on my server (and I think it might be changes at the online broadcasters, or possibly Plex not being as tolerant) I'm not getting many successful recordings lately, because the streams take MUCH longer to start streaming data into Plex than a real HDHomeRun would and I think it gives up. So this may not be very useful.

jkingok commented 7 years ago

Oh I see the main problem is there is no example lineup.json in the repository at all. So... there's now a lineup.json.in that runs with lineup.sh but obviously you need to insert your channel names. Or replace the HOST section with the IP address of your server, save it as lineup.json instead, and change script to file and lineup.sh to lineup.json in the sources.json file as I was suggesting above.`

bjzy commented 7 years ago

Thanks a lot for getting back to me. This info will certainly help! I'll report back here once I've had some time to get back into this. I'm presently piping my IPTV through TVHeadend -> TVHProxy -> PlexDVR. It works well enough, but I'd like to see if I can get away without TVH.

vorghahn commented 6 years ago

It's working with the above changes. Though the json files etc won't return. The bit that's working for me is the actually streaming which is the main thing.

I've trying to imitate the piping affect in python3 but have had zero luck, do you know if it's possible? I've got everything else working in python and Plex will map it etc and try to play the channels but of course they'll fail.

I'm using FFMPEG too btw.

Edit: got it working so nvm!