<div dir="ltr"><div dir="ltr">On Sat, Nov 26, 2022 at 8:35 AM Jan Ceuleers <<a href="mailto:jan.ceuleers@gmail.com">jan.ceuleers@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 23/11/2022 19:19, John P Poet wrote:<br>
> You could write a custom "external recorder" for mythtv, but the<br>
> included `mythexternrecorder` application might be able to do what you<br>
> want. It uses configuration files to tell it  how to obtain a valid<br>
> transport stream and that is fed into mythbackend.<br>
> <a href="https://www.mythtv.org/wiki/ExternalRecorder#Using_the_.22Generic.22_External_Recorder" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/ExternalRecorder#Using_the_.22Generic.22_External_Recorder</a> <<a href="https://www.mythtv.org/wiki/ExternalRecorder#Using_the_.22Generic.22_External_Recorder" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/ExternalRecorder#Using_the_.22Generic.22_External_Recorder</a>><br>
> <a href="https://www.mythtv.org/wiki/Example_Configuration_files" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/Example_Configuration_files</a><br>
> <<a href="https://www.mythtv.org/wiki/Example_Configuration_files" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/Example_Configuration_files</a>><br>
> <br>
> I can aid you in crafting up a conf file if you need it.<br>
<br>
I tried setting this up myself, resulting in the following (extracted<br>
from the backend log):<br>
<br>
Nov 26 16:39:30 hobbiton mythbackend: mythbackend[23328]: I<br>
TVRecEventtv_rec.cpp:1648 (HandlePendingRecordings) TVRec[1]:<br>
ASK_RECORDING 1 29 0 0<br>
Nov 26 16:40:00 hobbiton mythbackend: mythbackend[23328]: I TVRecEvent<br>
tv_rec.cpp:1077 (HandleStateChange) TVRec[1]: Changing from<br>
RecordingOnly to None<br>
Nov 26 16:40:00 hobbiton mythbackend: mythbackend[23328]: I TVRecEvent<br>
tv_rec.cpp:1077 (HandleStateChange) TVRec[1]: Changing from None to<br>
RecordingOnly<br>
Nov 26 16:40:00 hobbiton mythbackend: mythbackend[23328]: I TVRecEvent<br>
tv_rec.cpp:3600 (TuningFrequency) TVRec[1]: TuningFrequency<br>
Nov 26 16:40:00 hobbiton mythbackend: mythbackend[23328]: E TVRecEvent<br>
tv_rec.cpp:3891 (TuningSignalCheck) TVRec[1]: TuningSignalCheck:<br>
SignalMonitor failed<br>
Nov 26 16:40:00 hobbiton mythbackend: mythbackend[23328]: I CoreContext<br>
scheduler.cpp:717 (UpdateRecStatus) Updating status for "FIFA WK voetbal<br>
2022":"Groep D: Frankrijk - Denemarken" on cardid [1] (Pending =><br>
Recorder Failed)<br>
<br>
So I wonder what it is that makes the TuningSignalCheck fail. The<br>
recording is shown as in progress in mythweb, but with a zero-byte size.<br>
<br>
MythTV version info:<br>
MythTV Version : v32.0+fixes.202211251949.2af1c2064e~ubuntu20.04.1<br>
MythTV Branch : fixes/32<br>
Network Protocol : 91<br>
Library API : 32.20200101-1<br>
QT Version : 5.12.8<br>
Options compiled in:<br>
 linux profile use_hidesyms using_alsa using_oss using_pulse<br>
using_pulseoutput using_backend using_bindings_perl<br>
using_bindings_python using_bindings_php using_dvb using_firewire<br>
using_frontend using_hdhomerun using_satip using_vbox using_ceton<br>
using_joystick_menu using_libcec using_libcrypto using_gnutls<br>
using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg<br>
using_opengl using_egl using_qtwebkit using_qtscript using_qtdbus<br>
using_taglib using_v4l2 using_v4l2prime using_x11 using_system_libbluray<br>
using_systemd_notify using_systemd_journal using_drm using_bindings_perl<br>
using_bindings_python using_bindings_php using_freetype2<br>
using_mythtranscode using_opengl using_egl using_drm using_vaapi<br>
using_nvdec using_vdpau using_ffmpeg_threads using_mheg using_libass<br>
using_libxml2 using_libmp3lame<br>
<br>
Running on Ubuntu 20.04; MythTV was installed from the ppa.<br>
<br>
The configuration file I set up for the external recorder is as follows:<br>
<br>
mythtv@hobbiton:~$ cat mythexternrecorder1.conf<br>
[RECORDER]<br>
command="/usr/bin/ffmpeg -hide_banner -nostats -loglevel panic -i<br>
udp://<a href="http://192.168.1.44:5004" rel="noreferrer" target="_blank">192.168.1.44:5004</a> -vcodec copy -codec:a aac -b:a 128k -f mpegts<br>
pipe:1"<br>
cleanup="/home/mythtv/stop_streaming <a href="http://hdmicap1.xperim.be" rel="noreferrer" target="_blank">hdmicap1.xperim.be</a>"<br>
desc=hdmicap1 %CHANNUM% %CHANNAME% %CALLSIGN%<br>
<br>
[TUNER]<br>
channels=/home/mythtv/hdmicap_channels.conf<br>
command="/home/mythtv/tuner_command <a href="http://hdmicap1.xperim.be" rel="noreferrer" target="_blank">hdmicap1.xperim.be</a> %CHANNUM%"<br>
newepisodecommand="/home/mythtv/tuner_command <a href="http://hdmicap1.xperim.be" rel="noreferrer" target="_blank">hdmicap1.xperim.be</a> %CHANNUM%"<br>
timeout=20000<br>
<br>
If I run the RECORDER/command manually I do see garbage on the screen,<br>
so ffmpeg is indeed producing output.<br>
<br>
The script called from TUNER/command does the following:<br>
<br>
mythtv@hobbiton:~$ cat tuner_command<br>
#!/bin/bash<br>
#<br>
# $1: FQDN of the streaming device<br>
# $2: channel number<br>
<br>
### Turn the STB on<br>
<br>
### Wait for video lock<br>
<br>
### Tune the STB to the required channel<br>
<br>
### Start streaming<br>
/home/mythtv/start_streaming $1<br>
<br>
<br>
As you can see there are still placeholders (e.g. the signal is assumed<br>
already to be present, and the STB is assumed already to be set to the<br>
correct channel). The start_streaming script is as follows, and this<br>
works (otherwise the above ffmpeg test would not have produced output):<br>
<br>
mythtv@hobbiton:~$ cat start_streaming<br>
#!/bin/bash<br>
myIPaddr=$(hostname -I)<br>
sourceIPaddr="$(host -t A ${1} | awk '/has.*address/{print $NF; exit}')"<br>
URL="http://$sourceIPaddr/dev/info.cgi?action=streaminfo&rtp=on&multicast=on&mcastaddr=$myIPaddr"<br>
curl --silent --output /dev/null $URL<br>
<br>
<br>
<br>
<br>
Cheers, Jan<br>
_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a><br>
<a href="http://lists.mythtv.org/mailman/listinfo/mythtv-users" rel="noreferrer" target="_blank">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<a href="http://wiki.mythtv.org/Mailing_List_etiquette" rel="noreferrer" target="_blank">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
MythTV Forums: <a href="https://forum.mythtv.org" rel="noreferrer" target="_blank">https://forum.mythtv.org</a></blockquote><div><br></div><div><br></div><div>Try:</div><div>`/usr/bin/ffmpeg -hide_banner -nostats -loglevel panic -i udp://<a href="http://192.168.1.44:5004" rel="noreferrer" target="_blank">192.168.1.44:5004</a> -vcodec copy -codec:a aac -b:a 128k -f mpegts pipe:1 > tst.ts`</div><div>from the command line. After a minute, then run</div><div>`mediainfo tst.ts`</div><div>And let us know what that reports.</div><div><br></div><div>There should also be a mythexternrecorder.`date`.`pid`.log file from starting up the recording in myth. That might be helpful. Which reminds me -- check permissions on the various scripts to make sure your mythtv user can run them and create the log files.</div><div><br></div><div>John</div><div><br></div><div><br></div><div>John<br></div></div></div>