[mythtv-users] V32 issued with mythexternrecorder and youtube-dl

Peter Bennett pb.mythtv at gmail.com
Sun Mar 27 13:42:24 UTC 2022


On 3/27/22 02:37, OpenMedia Support wrote:
> Just upgraded from Ubuntu 18.04 -> 20.04 and MythTV V31 -> V32
>
> I had a nicely working external recorder working with our local FTA
> channels, and even documented the process for others to use under
>
>   -https://github.com/steven-ellis/mypvr-nz-iptv
>
> I'm using
>   -
> https://github.com/steven-ellis/mypvr-nz-iptv/blob/main/external/youtube-dl-nz.conf
>   -
> https://github.com/steven-ellis/mypvr-nz-iptv/blob/main/external/youtube-dl-nz-channels.conf
>
> With the upgrade to V32 the youtube-dl command just exits almost
> immediately and I can't debug any reasonable reason why.
>
>
> If I run youtube-dl on the command line and pipe the output to mpv
> playback works
>
> mythfe at mythtv:/tmp$ /usr/bin/youtube-dl -q -o - --hls-use-mpegts
> --external-downloader-args "-hide_banner -nostats -loglevel panic -re"
> "https://i.mjh.nz/nz/tv.9.m3u8"  | mpv - --vo=x11
> [file] Reading from stdin...
> WARNING: Could not send HEAD request to
> https://d2ce82tpc3p734.cloudfront.net/v1/master/b1f4432f8f95be9e629d97baabfed15b8cacd1f8/TVNZ_1/master.m3u8:
> HTTP Error 404: Not Found
>   (+) Video --vid=1 (h264 1280x720 25.000fps)
>   (+) Audio --aid=1 (aac 2ch 48000Hz)
> [vo/x11] Warning: this legacy VO has bad performance. Consider fixing your
> graphics drivers, or not forcing the x11 VO.
> ALSA lib conf.c:5187:(snd_config_expand) Unknown parameters
> CARD=Generic,DEV=0
> ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM
> hdmi:CARD=Generic,DEV=0
> [ao/alsa] Playback open error: Invalid argument
> [ao] Failed to initialize audio driver 'alsa'
> [ao] This audio driver/device was forced with the --audio-device option.
> [ao] Try unsetting it.
> Could not open/initialize audio device -> no sound.
> Audio: no audio
> VO: [x11] 1280x720 yuv420p
> [vo/x11] Shared memory not supported
> [vo/x11] Reverting to normal Xlib
> [vo/x11] Shared memory not supported
> [vo/x11] Reverting to normal Xlib
> V: 00:00:00 / 00:00:00 (2%) Cache: 0.6s/162KB
> [vo/x11] Shared memory not supported
> [vo/x11] Reverting to normal Xlib
> [vo/x11] Shared memory not supported
> [vo/x11] Reverting to normal Xlib
> V: 00:00:02 / 00:00:02 (82%) Cache: 0.3s/99KB
>
>
> Exiting... (Quit)
> ERROR: ffmpeg exited with code 1
>
>
> If I try to debug the external recorder I can see it tries to start
> youtube-dl but it appears to exit immediately
>
> mythfe at mythtv:/tmp$ /usr/bin/mythexternrecorder -v all:debug   --conf
> /usr/local/share/myPVR/iptv/youtube-dl-nz.conf
> 2022-03-27 19:33:42.088353 C  mythexternrecorder version: fixes/32
> [v32.0+fixes.202203250633.f69ce764b7~ubuntu20.04.1]www.mythtv.org
> 2022-03-27 19:33:42.088377 C  Qt version: compile: 5.12.8, runtime: 5.12.8
> 2022-03-27 19:33:42.088411 I  Ubuntu 20.04.4 LTS (x86_64)
> 2022-03-27 19:33:42.088414 N  Enabled verbose msgs: all
> 2022-03-27 19:33:42.088423 N  Setting Log Level to LOG_INFO
> 2022-03-27 19:33:42.098880 I  : Buffer: Ready for data.
> 2022-03-27 19:33:42.098904 I  Added logging to the console
> 2022-03-27 19:33:42.099003 I  : Command parser ready.
> 2022-03-27 19:33:42.099285 I   Channels in
> '/usr/local/share/myPVR/iptv/youtube-dl-nz-channels.conf', Tuner: '',
> Scanner: ''
> 1:APIVersion:2
> 1:OK:2
> 2022-03-27 19:33:47.157093 I  : Processing '1:APIVersion:2' --> '1:OK:2'
> 	2:Version?
> 	2:OK:1.0
> 2022-03-27 19:33:54.954597 I  : Processing '	2:Version?' --> '	2:OK:1.0'
> 4:HasTuner?
> 4:OK:Yes
> 2022-03-27 19:33:59.734855 I  : Processing 'HasTuner' --> '4:OK:Yes'
> 8:LoadChannels
> 8:OK:28
> 2022-03-27 19:34:05.520257 I  : Processing 'LoadChannels' --> '8:OK:28'
> 9:FirstChannel
> 9:OK:201,TVNZ 1,TVNZ 1,tv.9,tvone.png
> 2022-03-27 19:34:09.175082 I  youtube-dl "" "" "" "" : NextChannel
> Name:'TVNZ 1',Callsign:'TVNZ 1',xmltvid:tv.9,Icon:tvone.png
> 2022-03-27 19:34:09.175104 I  : Processing 'FirstChannel' -->
> '9:OK:201,TVNZ 1,TVNZ 1,tv.9,tvone.png'
> 10:TuneChannel:201
> 10:OK:Tuned to 201
> 2022-03-27 19:34:14.972243 I  youtube-dl"https://i.mjh.nz/nz/tv.9.m3u8"
> "201" "TVNZ 1" "TVNZ 1" : Processing 'TuneChannel' --> '10:OK:Tuned to
> 201'
> :13:TuneStatus
> 13:ERR:Unrecognized command 'TuneStatus     '
> 2022-03-27 19:34:21.159414 I  youtube-dl"https://i.mjh.nz/nz/tv.9.m3u8"
> "201" "TVNZ 1" "TVNZ 1" : Processing ':13:TuneStatus     ' -->
> '13:ERR:Unrecognized command 'TuneStatus     ''
> 14:TuneStatus?
> 14:OK:Tuned to
> 2022-03-27 19:34:31.949952 I  youtube-dl"https://i.mjh.nz/nz/tv.9.m3u8"
> "201" "TVNZ 1" "TVNZ 1" : Tuned
> 2022-03-27 19:34:31.949985 I  youtube-dl"https://i.mjh.nz/nz/tv.9.m3u8"
> "201" "TVNZ 1" "TVNZ 1" : Processing 'TuneChannel' --> '14:OK:Tuned to '
> 	15:StartStreaming
> 	15:ERR:No channel has been tuned
> 2022-03-27 19:34:38.895756 E  youtube-dl"https://i.mjh.nz/nz/tv.9.m3u8"
> "201" "TVNZ 1" "TVNZ 1" : No channel has been tuned
> 2022-03-27 19:34:38.895779 I  youtube-dl"https://i.mjh.nz/nz/tv.9.m3u8"
> "201" "TVNZ 1" "TVNZ 1" : Processing 'StartStreaming' --> '	15:ERR:No
> channel has been tuned'
> 10:TuneChannel:201
> 10:OK:Tuned to 201
> 2022-03-27 19:34:44.378092 I  youtube-dl"https://i.mjh.nz/nz/tv.9.m3u8"
> "201" "TVNZ 1" "TVNZ 1" : Processing 'TuneChannel' --> '10:OK:Tuned to
> 201'
> 15:StartStreaming
> 15:OK:Streaming Started
> 2022-03-27 19:34:48.598888 I  (pid 10459) youtube-dl
> "https://i.mjh.nz/nz/tv.9.m3u8"  "201" "TVNZ 1" "TVNZ 1" : Starting process
> '/usr/bin/youtube-dl' args: '-q -o - --hls-use-mpegts
> --external-downloader-args "-hide_banner -nostats -loglevel panic -re"
> "https://i.mjh.nz/nz/tv.9.m3u8"'
> 2022-03-27 19:34:48.649591 I  (pid 10459) youtube-dl
> "https://i.mjh.nz/nz/tv.9.m3u8"  "201" "TVNZ 1" "TVNZ 1" : Started process
> '/usr/bin/youtube-dl' PID 10459
> 2022-03-27 19:34:48.649639 I  (pid 10459) youtube-dl
> "https://i.mjh.nz/nz/tv.9.m3u8"  "201" "TVNZ 1" "TVNZ 1" : Processing
> 'StartStreaming' --> '15:OK:Streaming Started'
>
>
> Checking for processes there is no PID 10459
>
> Any tips on additional debugging steps.

I have scripts for an external recorder that are working fine. 
(https://github.com/bennettpeter/MythTV-LeanCapture).

If youtube-dl is outputting an error message you may not see it, the 
error output may be getting lost. For my external recorder I use shell 
scripts for all of the commands. The error output is redirected to a file.

I don't know if a redirect on the command line in the conf file will 
work. You could try that:

command="/usr/bin/youtube-dl --hls-use-mpegts --external-downloader-args 
\"-hide_banner -nostats -loglevel panic -re\" -o - \"%URL%\" 
2>>/tmp/youtube-dl.log"

Alternatively create a shell script that calls the command with the 
redirect of stderr

Also in the shell script you may want to log the return code from youtube-dl

Peter


e

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20220327/7991663b/attachment.htm>


More information about the mythtv-users mailing list