[mythtv-users] command line to create a recording?

Stephen Worthington stephen_agent at jsw.gen.nz
Sat Mar 11 17:37:04 UTC 2023


On Sat, 11 Mar 2023 11:58:23 -0500, you wrote:

>I want to treat captured stream videos as recordings, with a seek table 
>and commercials flagged. I'm using the trick posted earlier of taking an 
>unwanted recording, renaming the video with its filename, and then apply 
>mythcommflag.
>
>I have that trivially scripted, except for generating an unwanted 
>recording. Right now I just use the gui to start recording something and 
>then stop it a few seconds later.
>
>I would like to generate the unwanted recording file from the script.
>
>Is there anything around to do that?
>
>Even better would be to directly register the video as a recording. Any 
>help on the mysql commands? I don't know what tables have to be modified.

You do not want to alter the database directly as creating a recording
is complex and has lots of business logic in the code to prevent
screwing up the database.  So you want to get mythbackend to create a
real recording for you.  To do that, you can use the Services API to
create recordings and then stop them a few seconds later:

https://www.mythtv.org/wiki/Services_API
https://www.mythtv.org/wiki/DVR_Service#AddRecordSchedule
https://www.mythtv.org/wiki/DVR_Service#StopRecording

Just create a manual recording by calling GetRecordSchedule for the
Default template rule, change the chanid to a valid channel and set
the starttime, endtime and title (use say "Dummy") and call
AddRecordSchedule.  Let the recording start and run for a few seconds,
then call StopRecording.  I have some Python code for starting a
manual recording on my web server:

http://www.jsw.gen.nz/mythtv/start-recording.py


More information about the mythtv-users mailing list