[mythtv-users] IPTV recorder - simultaneous stream recording

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Jun 13 10:22:15 UTC 2018


On Tue, 12 Jun 2018 20:14:14 +0100, you wrote:

>Hi Stephen,
>
>Many thanks for your responses.
>
>I *think* you may have confirmed what seems to be the fundamental issue for
>me in 0.28, which is that chanid in iptv_channel seems to insist on being
>unique, which doesn't seem to be the case for you in 0.29, if I'm
>understanding your set-up correctly?  In other words, you have a number of
>rows with the same chanid but with different URLs in your iptv_channel
>table?  That is what I cannot seem to achieve in 0.28, so if, for example,
>I specify other URLs for the same channel, only the last one specified will
>appear in the url column for a given chanid in iptv_channels, not multiple
>rows of chanid each containing a different URL, if that makes sense?
>
>If that's the case, I may be better off just building 0.29 in Debian stable
>so it works without the hack of using a different sourceid, perhaps, but I
>think your last suggestion might well work in 0.28.
>
>Thanks again.
>
>Ian

I do not think the problem is anything fundamental in 0.28, just that
you are not setting things up the right way.  But as I do not have a
0.28 system to test with any more, I can not say for sure.  What I
have done is to test my suggested method using an Xubuntu 18.04 /
MythTV v29 system I had set up in a virtual machine.  It does work,
but since I do not have any STBs to test with, I have not tested when
using channel change scripts.

This is what I did to test the setup.  I created two new .m3u files:

root at mypvr:/var/www/html# cat source-a.m3u
#EXTM3U

#EXTINF:0,5001 - Chan 1
#EXTMYTHTV:xmltvid=chan1.tv.co.nz
#EXTVLCOPT:program=1001
rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,303,1003,1103,8183

#EXTINF:0,5002 - Chan 2
#EXTMYTHTV:xmltvid=chan2.tv.co.nz
#EXTVLCOPT:program=1190
rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,303,1003,1103,8183

#EXTINF:0,5003 - Chan 3
#EXTMYTHTV:xmltvid=chan3.tv.co.nz
#EXTVLCOPT:program=1013
rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,303,1003,1103,8183


root at mypvr:/var/www/html# cat source-b.m3u
#EXTM3U

#EXTINF:0,5001 - Chan 1
#EXTMYTHTV:xmltvid=chan1.tv.co.nz
#EXTVLCOPT:program=1001
rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,1019,1001,1101

#EXTINF:0,5002 - Chan 2
#EXTMYTHTV:xmltvid=chan2.tv.co.nz
#EXTVLCOPT:program=1190
rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,1019,1001,1101

#EXTINF:0,5003 - Chan 3
#EXTMYTHTV:xmltvid=chan3.tv.co.nz
#EXTVLCOPT:program=1013
rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,1019,1001,1101

I put the .m3u files on my internal web server where the virtual
Xubuntu PC could access them.  On the virtual PC, I created two new
IPTV tuners, and two new video sources ("STB A" and "STB B").  The I
used "Input connections" to link one new IPTV tuner to each new video
source, and on each source scanned for channels using the matching
source-[ab].m3u file.  That created three new channels, with channel
numbers 5001-5003, but set them up so that they were on both the STB A
and STB B video sources:

MariaDB [mythconverg]> select
chanid,channum,freqid,sourceid,callsign,name,xmltvid,mplexid,serviceid,iptvid
from channel where sourceid!=1;
+--------+---------+--------+----------+----------+--------+----------------+---------+-----------+--------+
| chanid | channum | freqid | sourceid | callsign | name   | xmltvid        | mplexid | serviceid | iptvid |
+--------+---------+--------+----------+----------+--------+----------------+---------+-----------+--------+
|   7001 | 5001    | NULL   |        2 | Chan 1   | Chan 1 | chan1.tv.co.nz |    NULL |      1001 |   NULL |
|   7002 | 5002    | NULL   |        2 | Chan 2   | Chan 2 | chan2.tv.co.nz |    NULL |      1190 |   NULL |
|   7003 | 5003    | NULL   |        2 | Chan 3   | Chan 3 | chan3.tv.co.nz |    NULL |      1013 |   NULL |
|   8001 | 5001    | NULL   |        3 | Chan 1   | Chan 1 | chan1.tv.co.nz |    NULL |      1001 |   NULL |
|   8002 | 5002    | NULL   |        3 | Chan 2   | Chan 2 | chan2.tv.co.nz |    NULL |      1190 |   NULL |
|   8003 | 5003    | NULL   |        3 | Chan 3   | Chan 3 | chan3.tv.co.nz |    NULL |      1013 |   NULL |
+--------+---------+--------+----------+----------+--------+----------------+---------+-----------+--------+
6 rows in set (0.01 sec)

MariaDB [mythconverg]> select * from iptv_channel where chanid>=6000;
+--------+--------+-------------------------------------------------------------------------------------------------------------------------------------+------+---------+
| iptvid | chanid | url                                                                                                                                 | type | bitrate |
+--------+--------+-------------------------------------------------------------------------------------------------------------------------------------+------+---------+
|    110 |   7001 | rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,303,1003,1103,8183 | data |       0 |
|    111 |   7002 | rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,303,1003,1103,8183 | data |       0 |
|    112 |   7003 | rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,303,1003,1103,8183 | data |       0 |
|    113 |   8001 | rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,1019,1001,1101     | data |       0 |
|    114 |   8002 | rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,1019,1001,1101     | data |       0 |
|    115 |   8003 | rtsp://satip.jsw.gen.nz:554/?src=1&freq=12608&msys=dvbs&plts=off&fec=34&pol=h&ro=0.35&sr=22500&mtype=qpsk&pids=0,1019,1001,1101     | data |       0 |
+--------+--------+-------------------------------------------------------------------------------------------------------------------------------------+------+---------+
6 rows in set (0.00 sec)

Then from mythfrontend, I could change to channels 5001, 5002 or 5003
and they would play from the STB A source.  Using M(enu) > Switch
Source I could switch to the STB B source and the same channel number
continued to play from there, but as it was using the URL for the STB
B source, the actual channel it played was the on the STB B URLs.

So I have two sources, each with the same 3 channels.  Within each
source, all the channels are using same URLs (representing the URLs
you would be using for accessing your HDMI converters).  Each of the
channels (same channel number and name) is available on two different
chanid values, from two different sources.  With the addition of
channel change scripts, that should work for two STBs connected via
HDMI to network converter boxes.

So the key thing you need to do is to create a video source per STB,
and only one IPTV tuner for each STB, connected to that STB's video
source.  Each video source needs a separate .m3u file.  Create one
first, using the URL for the HDMI converter attached to the first STB.
Then copy that file, and keep all the same data for the channels,
except the URLs.  Change all the URLs in the second copy to the URL
for the HDMI converter attached to the second STB.


More information about the mythtv-users mailing list