[mythtv-users] IPTV recorder - simultaneous stream recording

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Jun 12 17:10:03 UTC 2018

On Tue, 12 Jun 2018 16:00:07 +0100, you wrote:

>I have asked this question in a couple of IRC channels for mythtv and was
>advised to ask my question here.
>Does anybody familiar with the IPTV recorder code know if the (seemingly)
>broken behaviour in 0.28 has been changed in 0.29?
>Specifically, under 0.28, if I set up an IPTV recorder, it works for only 1
>simultaneous recording, even if I set up multiple encoders.  It doesn't
>help to set-up multiple IPTV recorders either, because the chanid in
>iptv_channel is apparently derived from the string concatenation of
>"sourceid"."channelnum", so even if I can make the URLs different, it
>doesn't seem to help me solve this problem because the last URL for a given
>chanid gets entered into iptv_channel table for a given chanid in the DB.
>If it is sorted in 0.29 then I'll compile from a deb-src of 0.29 for my
>Debian stable system.

I am not sure I understand your problem, but I can tell you what I do
have working in v29.  I have an 8-tuner DVB-S2 card, with 7 of the
tuners being run by minisatip.  The other tuner is used for EPG
grabbing by external software.  Minisatip turns the DVB-S2 tuners into
SAT>IP network tuners.  MythTV does not (yet) understand SAT>IP
protocol, but it does handle the underlying RTSP protocol used by
SAT>IP.  So MythTV can not scan SAT>IP tuners, but can record from
them if it is provided with RTSP URLs it understands.

In MythTV, I have 5 IPTV tuners set up, all in one source, named
"minisatip".  Each of those IPTV tuners is set up for 2 multirec
tuners, which allows them to do overlapping of recordings on one
channel.  The multirec capability is not used in IPTV tuners except
for that special case, so setting the number of multirec tuners higher
than 2 does nothing for IPTV tuners.  For that source, I have 110 IPTV
channels defined, each of which is an RTSP URL like these:


The URLs were originally loaded into MythTV from a .m3u file that I
created using some Python, based on external scanning of the channels
done using the Windows based DVBViewer software which does have full
SAT>IP support.  Each URL is unique, as it will either have a
different "freq=" or different "pids=" section.  When the .m3u is
loaded, it creates a channel table row and an iptv_channel table row
for each channel.  There is one chanid per unique URL.  The channel
table iptvid field is NULL for each channel - the connection between
the channel row in the channel table and it corresponding iptv_channel
table row is done using the chanid value in both tables.

Notice that the first and third URLs above are for channels on the
same multiplex (they have the same frequency of 12608).  If I record
both of those channels at once, they will record on two different IPTV
tuners in MythTV, but minisatip is intelligent enough to know that it
only needs one DVB-S2 tuner for both SAT>IP streams, so when the
second channel starts recording, minisatip just adds the streams
specified in the PIDs section to those it is already extracting from
the same DVB-S2 tuner it is already using, but puts them in a
different RTSP connection back to MythTV.

If I record two programmes back to back on the first channel above,
MythTV will use the first multirec tuner of its pair on the IPTV tuner
it selects, and record the first programme.  When the second programme
starts recording, in the overlap period caused by the post roll on the
first programme and the pre roll on the second programme, MythTV will
see that it already has the URL for that channel running on an IPTV
tuner, and will use the second multirec tuner of the pair to record
the overlapping programme.  It does not start a second RTSP connection
to minisatip, but instead just takes a copy of the data already
arriving on the first multirec tuner and sends it to the second
multirec tuner to also be recorded there.  When the first programme
finishes recording, the first multirec tuner shuts down, but the
incoming RTSP steam continues as it is still being used by the second
multirec tuner.

Since I have 5 IPTV tuners defined for the minisatip source, I can
record up to 10 different programmes at once on up to 5 different
channels at once.  That all works well.

More information about the mythtv-users mailing list