[mythtv-users] Problems with ExternalRecorder and streamlink

Peter Carlsson maillist.peter at home.se
Sun Jan 31 22:09:43 UTC 2021


On Sat, Jan 30, 2021 at 03:01:02PM -0700, John P Poet wrote:
> On Tue, Jan 26, 2021 at 3:11 PM Peter Carlsson <maillist.peter at home.se>
> wrote:
> 
> > Hello!
> >
> > I had MythTV setup using the ExternalRecorder together with streamlink.
> >
> > Last summer the svtplay plugin for streamlink stopped working and I
> > temporarily stopped using it by changing the recording priority to use
> > another recorder.
> >
> > In streamlink version 1.6.0 (2020-09-22) it was fixed (by Ian Cameron)
> > and I verified in streamlink that it worked but I never took the time to
> > change back the recording priority until recently.
> >
> > But I can not get it to work again. I don't remember to have done
> > anything else specific to the original problem but much has changed
> > since then.
> >
> > MythTV has been upgraded to version 31 and streamlink to version 2.0.0
> > where streamlink has dropped support for Python 2 and Python 3.5 and
> > MythTV added support for Python 3.
> >
> > I use Debian Buster and have both Python 2.7 and 3.7 installed.
> >
> > I tried he following but it just stops at the last line below.
> >
> > mythexternrecorder --conf
> > /home/peter/delat/script/mythtv-svtplay-external-recorder.conf --loglevel
> > debug --verbose all
> > 2021-01-26 22:55:35.201299 C  mythexternrecorder version:  [v31.0]
> > www.mythtv.org
> > 2021-01-26 22:55:35.201337 C  Qt version: compile: 5.11.3, runtime: 5.11.3
> > 2021-01-26 22:55:35.201391 I  Debian GNU/Linux 10 (buster) (i386)
> > 2021-01-26 22:55:35.201394 N  Enabled verbose msgs: all
> > 2021-01-26 22:55:35.201415 N  Setting Log Level to LOG_DEBUG
> > 2021-01-26 22:55:35.212913 I  : Buffer: Ready for data.
> > 2021-01-26 22:55:35.212956 I  Added logging to the console
> > 2021-01-26 22:55:35.212986 I  : Command parser ready.
> > 2021-01-26 22:55:35.213774 D  New Logging Client: ID:  (#1)
> > 2021-01-26 22:55:35.231943 I   Channels in
> > '/home/peter/delat/script/mythtv-svtplay-external-recorder-channels.conf',
> > Tuner: '', Scanner: ''
> > ^C
> >
> > What can I do to debug this problem?
> >
> > Please let me know if I should provide additional information.
> >
> > cat /home/peter/delat/script/mythtv-svtplay-external-recorder.conf
> >
> > [RECORDER]
> > # The recorder command to execute.  %URL% is optional, and
> > # will be replaced with the channel's "URL" as defined in the
> > # [TUNER/channels] (channel conf) configuration file
> > #command="cvlc \"%URL%\" --sout \"#std{mux=ts,access=file,dst=-}\""
> > command="streamlink --player=vlc --stdout \"%URL%\" best"
> >
> > # Used in logging events, %ARG% are replaced from the channel info
> > desc=streamlink \"%URL%\" \"%CHANNUM%\" \"%CHANNAME%\" \"%CALLSIGN%\"
> >
> > [TUNER]
> > # An optional CONF file which provides channel details.  If it does not
> > # exist, then channel changes are not supported.
> > channels=mythtv-svtplay-external-recorder-channels.conf
> >
> > # If [TUNER/command] is provided, it will be executed to "tune" the
> > # channel. A %URL% parameter will be substituted with the "URL" as
> > # defined in the [TUNER/channels] configuration file
> > #command=
> >
> > # Timeout for changing channels in msecs
> > #timeout=
> >
> > [SCANNER]
> > # When MythTV scans for channels, The contents of the [TUNER/channels]
> > # config file are used to populate MythTV's channel information.
> > # If a command is provided here, it will be executed first, so it can
> > # populate the [TUNER/channels] config file
> > #command=/home/myth/bin/scan.sh "%CHANCONF%"
> >
> > # Timeout for scan command in msecs
> > #timeout=60000
> >
> >
> > cat
> > /home/peter/delat/script/mythtv-svtplay-external-recorder-channels.conf
> >
> > [1]
> > NAME=SVT1 HD
> > CALLSIGN=SVT1HD
> > XMLTVID=svt1.svt.se
> > URL="https://www.svtplay.se/kanaler/svt1?start=auto"
> > ICON=/home/mythtv/.mythtv/channels/svt1.svt.se.png
> >
> > [2]
> > NAME=SVT2 HD
> > CALLSIGN=SVT2HD
> > XMLTVID=svt2.svt.se
> > URL="https://www.svtplay.se/kanaler/svt2?start=auto"
> > ICON=/home/mythtv/.mythtv/channels/svt2.svt.se.png
> >
> > [3]
> > NAME=Kunskapskanalen
> > CALLSIGN=Kunskapskanalen
> > XMLTVID=kunskapskanalen.svt.se
> > URL="https://www.svtplay.se/kanaler/kunskapskanalen?start=auto"
> > ICON=/home/mythtv/.mythtv/channels/kunskapskanalen.svt.se.png
> >
> > [4]
> > NAME=Barnkanalen
> > CALLSIGN=Barnkanalen
> > XMLTVID=barnkanalen.svt.se
> > URL="https://www.svtplay.se/kanaler/svtbarn?start=auto"
> > ICON=/home/mythtv/.mythtv/channels/barnkanalen.svt.se.png
> >
> > [5]
> > NAME=SVT24
> > CALLSIGN=SVT24
> > XMLTVID=svt24.svt.se
> > URL="https://www.svtplay.se/kanaler/svt24?start=auto"
> > ICON=/home/mythtv/.mythtv/channels/svt24.svt.se.png
> >
> >
> Hi Peter,
> 
> The behavior you describe is correct. At that point mythexternrecorder is
> expecting to be given commands from mythackend. For example, instead of
> hitting CTRL-C where you did, you could type:
> APIVersion?
> and it should spit out something like
> OK:2
> 
> If you look at https://www.mythtv.org/wiki/ExternalRecorder you can see the
> commands that are allowed. With APIVersion2, the serial number at the
> beginning of each command should be incremented.

Hello John,

Thanks for you answer. I tried to send some commands and they all seems
to work until I try to send TuneStatus? where I would have expected
'9:OK:Tuned to 1' or similar. Am I on the right track and is this
indicating that something is wrong?

It seems that although I add arguments '--loglevel debug --verbose' I
don't get that much help of the output.

I can call streamlink directly and get a stream that I can watch in VLC.

mythexternrecorder --conf /home/peter/delat/script/mythtv-svtplay-external-recorder.conf --loglevel debug --verbose
2021-01-31 22:58:06.872700 C  mythexternrecorder version:  [v31.0] www.mythtv.org
2021-01-31 22:58:06.872720 C  Qt version: compile: 5.11.3, runtime: 5.11.3
2021-01-31 22:58:06.872748 I  Debian GNU/Linux 10 (buster) (x86_64)
2021-01-31 22:58:06.872750 N  Enabled verbose msgs:  general
2021-01-31 22:58:06.872760 N  Setting Log Level to LOG_DEBUG
2021-01-31 22:58:06.883132 I  Added logging to the console
1::HasTuner?
1:OK:Yes
2::LoadChannels
2:OK:5
3::FirstChannel
3:OK:1,SVT1 HD,SVT1HD,svt1.svt.se,/home/mythtv/.mythtv/channels/svt1.svt.se.png
4:NextChannel
4:OK:2,SVT2 HD,SVT2HD,svt2.svt.se,/home/mythtv/.mythtv/channels/svt2.svt.se.png
5:NextChannel
5:OK:3,Kunskapskanalen,Kunskapskanalen,kunskapskanalen.svt.se,/home/mythtv/.mythtv/channels/kunskapskanalen.svt.se.png
6:NextChannel
6:OK:4,Barnkanalen,Barnkanalen,barnkanalen.svt.se,/home/mythtv/.mythtv/channels/barnkanalen.svt.se.png
7:NextChannel
7:OK:5,SVT24,SVT24,svt24.svt.se,/home/mythtv/.mythtv/channels/svt24.svt.se.png
8:TuneChannel:1
8:OK:Tuned to 1
9:TuneStatus?
9:OK:Tuned to

/Peter


More information about the mythtv-users mailing list