[mythtv-users] convoluted questiom

James Linder jam at tigger.ws
Mon Dec 27 02:49:18 UTC 2021

> On 27 Dec 2021, at 10:35 am, Stephen Worthington <stephen_agent at jsw.gen.nz> wrote:
> On Mon, 27 Dec 2021 07:36:20 +0800, you wrote:
>>>> I want to take a camera
>>>> a) stream it
>>>> b) preview at will
>>>> c) record at will
>>>> mythtv is perfect except I do not want any GUI, only programatic invocation.
>>>> I’ve not studied the API eg I find StopRecording but no StartRevording, can anyone offer advice?
>>>> I implimented the requirement with gstreamer. Unlike mythtv-users and mythtv-dev lists their list is populated by soals seeking answers and a few really knowledgeable people. Unless you can pique their interest, you are on your own.
>>> Zoneminder ( https://www.mythtv.org/wiki/MythZoneMinder ) and the mythtv pluginfor zoneminder are a possibility for what you are inquiring about. You didn’t mention what kind of camera, but zone minder will work with both network cameras as well as attached cameras to the zoneminder server.
>> First thanks to you and to Barry, it very refreshing to have someone take an interest in your question.
>> I tried to keep my question terse and relevant, but more explanation is warranted:
>> In Australia commercial divers are required to wear a head cam and record their work.
>> A year or so ago a fishing trawler sank off Broom.
>> Since there may have been bodies on board when recovered (there weren't) the police accompanied the recovery and took the very poor video. (no doubt on a phone)
>> We make DVRs. Divers describe themselves as underwater laborers and so the GUI is simple, certainly not
>> u-beaut as mythtv.
>> http://tigger.ws/downloads/DVR.avi <http://tigger.ws/downloads/DVR.avi>
>> In the clip you can see the recorder box.
>> We are implementing HD recording using Sensoray 2263 capture from a 1080p AHD camera.
>> Mythtv answers all my needs. A customer of the dive company may want to watch, imagine a hull inspection on an oil tanker. So
>> The divemaster needs watch what is happening and record what is happening while their customer watches a stream.
>> All is complicated by (life dependant) chemistry of breathing gas (partial pressure of oxygen) (nitrogen being narcotic at about. 70m) (helium at pressure being a very good conductor of heat so warming water is needed) (as little as neccessory helium is used because of cost (so called tri-mix oxygen-nitrogen-helium))
>> Voice is distorted by helium.
>> mythtv ticks nearly all the boxes, but I need to control it via the api not via the gui.
>> As a 20 year mythtv user it is a obvious choice likewise any project you care to name is unlikely to address all my needs.
>>> I'm not sure of what you mean by "programatic invocation"
>> means interaction with mythtv is via program API not via GUI in any way.
>>> If the same recording displays fine under Linux and Windows then it should also be fine with MacOS.  Perhaps a bad install of the Mac VLC, outdated codec.  (WAG)
>> The whole mac paradigsm of "doan toucha da buttons" means the buffering-latency is hard to configure: mac plays good videos <smile> eg mythtv recordings just fine but my goal is to create not-broken recordings.
>> What tool can I use.to measure, listen<scitch>ing is<scritch> easy
>> James 
> I just had a quick look at the Services API and it appears that there
> is no API to start a recording in the manner that you do for Live TV,
> where it starts immediately and continues until you stop it.  What is
> needed is a call to GetRecordSchedule using the option that gets the
> template rule that you want to use (eg 'Default'), then modify that to
> set up a new recording rule, and call AddRecordSchedule to add it to
> the schedule.  Then at the scheduled time, it will start recording. My
> experience with manually starting and stopping scheduled recordings is
> that if the starttime in the recording rule is in the past, and the
> endtime is in the future, the recording can be restarted.  So I would
> hope that setting the starttime to a little in the past and calling
> AddRecordSchedule would immediately start recording.  But I would need
> to test that.  If not, then a ReactivateRecording call would be needed
> to get it to start recording.  All of which is a bit complicated for
> what you want, but it looks doable.
> However, the Sensoray 2263 is not likely to have MythTV support as a
> capture device unless it has Linux V4L drivers.  The web page I found
> says Linux is supported, but whether that means V4L support I am not
> sure.  I suspect not.  So supporting it would likely mean also writing
> an External Recorder program to interface between the Sensoray 2263
> API and MythTV.  Something like what MythHDRecorder does with Silicon
> Dust HDHR devices:
> https://www.mythtv.org/wiki/Mythhdhrrecorder
> That is a bit more work, but again likely doable.

Stephen Thanks. The 2263 does have v4l2 support and does indeed work.
Klaas answering a different question used ffmpeg in copy mode which shows the errors clearly (thanks Klaas)

  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
      creation_time   : 2021-12-13T05:44:36.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
frame=   83 fps= 80 q=30.0 size=     256kB time=00:00:03.30 bitrate= 634.3kbits/s dup=8
frame=  113 fps= 73 q=30.0 size=     768kB time=00:00:04.33 bitrate=1452.9kbits/s dup=8
frame=  135 fps= 65 q=30.0 size=    1024kB time=00:00:05.12 bitrate=1638.5kbits/s dup=8
frame=  168 fps= 65 q=30.0 size=    1280kB time=00:00:06.37 bitrate=1643.9kbits/s dup=8
frame=  191 fps= 62 q=30.0 size=    1536kB time=00:00:07.14 bitrate=1760.7kbits/s dup=8
frame=  222 fps= 62 q=30.0 size=    1792kB time=00:00:08.42 bitrate=1742.1kbits/s dup=8
frame=  243 fps= 58 q=30.0 size=    2048kB time=00:00:09.19 bitrate=1824.7kbits/s dup=8
frame=  275 fps= 59 q=30.0 size=    2560kB time=00:00:10.21 bitrate=2052.3kbits/s dup=8
frame=  295 fps= 57 q=30.0 size=    2816kB time=00:00:10.98 bitrate=2099.7kbits/s dup=8
frame=  326 fps= 57 q=30.0 size=    3328kB time=00:00:12.26 bitrate=2222.6kbits/s dup=8
frame=  344 fps= 55 q=30.0 size=    3584kB time=00:00:12.80 bitrate=2293.8kbits/s dup=8
frame=  377 fps= 55 q=30.0 size=    4096kB time=00:00:14.05 bitrate=2386.8kbits/s dup=8
frame=  401 fps= 55 q=30.0 size=    4352kB time=00:00:14.84 bitrate=2401.1kbits/s dup=8
frame=  428 fps= 54 q=30.0 size=    4864kB time=00:00:15.87 bitrate=2510.5kbits/s dup=8
frame=  449 fps= 54 q=30.0 size=    5120kB time=00:00:16.61 bitrate=2523.9kbits/s dup=8

Thanks all for ideas, some head scratching to be done.

More information about the mythtv-users mailing list