[mythtv-users] Record program's stdout

Stephen Worthington stephen_agent at jsw.gen.nz
Sat Dec 7 12:14:39 UTC 2013


On Fri, 6 Dec 2013 20:12:33 -0800, you wrote:

>I have a couple of internet sources from which I would like to record that
>are not supported by MythTV (one uses Adobe HDS, for example). I do,
>however, have command-line scripts/utilities to dump from these sources. Is
>there any way I can get myth to start such a utility when a recording
>starts, capture its standard output, and then terminate it when finished? I
>would also like to be able to do live TV, or at least be able to watch an
>in-progress recording from these sources.
>
>Thanks.
>
>-- Erik Jensen

Take a look at the ImportRecorder:

  http://code.mythtv.org/doxygen/group__testing.html

There is not a lot of documentation about it, but the basic idea is
that it is a dummy tuner that will take a file you create with scripts
driven from the MythTV events and process it as though the data came
from a tuner.

I have had it working in 0.25 to record FM radio for my mother from a
Hauppauge PVR-150 card, but she now has enough operas recorded to last
her for another year or two, so when it got broken by an update, I
never found the time to try to fix it again.  I did find that the only
way I could get it to work at all well was to create an MPEG file,
either MPEG2 or M2TS.  So since I was recording audio only, I used
avconv to take a picture file and turn that into a low bit rate video
stream to add to the audio I was recording from radio, in order to
make a valid MPEG file.  After doing that, it was possible to play an
in-progress recording, but there were still some odd things happening.
Once a recording completed, they were properly playable and had the
proper jump table indexing to allow you to move around in the
recording.

The scripts I was using are available for download from my web server:

  http://www.jsw.gen.nz/mythtv/event-finished-recording.sh
  http://www.jsw.gen.nz/mythtv/event-start-recording.sh
  http://www.jsw.gen.nz/mythtv/event_test.sh
  http://www.jsw.gen.nz/mythtv/ivtv_audio_fix.sh

But when I last tried them some time ago on 0.26, they were not
working.  As best I can recall, the code that was added to mythbackend
at some point to check if a recording had actually started properly
was not working with the ImportRecorder and it was thinking that the
recording had not started.  So mythbackend was killing the recording
after just a few minutes, when in fact my scripts had created the
recording file and were writing to it happily.  So there may need to
be a bug raised about that, or maybe there is something the script can
do in the database to make the checking code happy.

I just checked the 0.28 pre ImportRecorder documentation:

  http://code.mythtv.org/doxygen/classImportRecorder.html

and it looks as though there has not been any progress on making it
accept non-MPEG files.  But I have not taken a look at the actual
code.

If you have any questions about the scripts, feel free to ask, either
here or off-list if you like.  It would be good to get my scripts
working again, and I may have enough free time over Christmas to have
a go at fixing them, but if you were to discover something before
then, I would like to know about it.


More information about the mythtv-users mailing list