Mailing List Archive

command line to create a recording?
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.


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
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
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
On 11/03/2023 17:58, Ken Mandelberg wrote:
> 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.

If you'd like to use MythTV to capture the video streams in the first
place, rather than importing already-captured video files as recordings,
then consider using mythexternrecorder.

This is very briefly discussed on the ExternalRecorder page [1],
specifically in the 'Using the "Generic" external recorder' section.

[1]: https://www.mythtv.org/wiki/ExternalRecorder

Once the recording gets going, the recorder command invoked by
mythexternrecorder (and that you can specify in its configuration file)
is expected to output the audio/video stream as an MPEG TS on stdout.

I don't know, and it would be an interesting experiment to try, whether
this method can also be used to feed already-captured TS files to
MythTV, i.e. faster than real-time. In this case the recorder command
specified in the mythexternrecorder configuration file would simply be
"cat <thefileyouwantoimport>".

There are links in the above-mentioned section of the wiki to example
configuration files.

HTH, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
> On Mar 11, 2023, at 11:58 AM, Ken Mandelberg <km@mathcs.emory.edu> 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.
>
>

I went thru this exercise a couple of weeks ago, trying to use a Raspberry Pi as the test backend, and then also with Intel N5095; the raspberry pi didn’t have the horse power to create an mpeg2ts stream from an HDMI video capture device, the Intel N5095, had enough to capture the video, but couldn’t take care of the 8 second lag between video and audio due to the video transcode. You need some horsepower in order to be able to do the above to capture video/audio in sync.

I wound up abandoning the exercise as I didn’t want to put that much power into a 2ndary backend. As little as I use the ability, I decided to just use an underused Mac mini I have to create video using QuickTime Player.

Short story is it can be done using ffmpeg but requires a hefty backend.

Regards!
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
On 3/11/23 11:58, Ken Mandelberg 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.
>
>
>
There is an open source program called comskip that is available via
apt. I am using that to flag commercials. For videos I specify that it
should not use logo detection. My script is here

https://github.com/bennettpeter/mythscripts/blob/master/install/opt/mythtv/bin/comskip.sh

The inifile for videos is here

https://github.com/bennettpeter/mythscripts/blob/master/install/etc/opt/mythtv/all_comskip_peacock.ini

The inifile for recordings is here

https://github.com/bennettpeter/mythscripts/blob/master/install/etc/opt/mythtv/all_comskip_comcast.ini

Peter

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
On Sat, Mar 11, 2023 at 03:52:18PM -0500, Peter Bennett wrote:
> There is an open source program called comskip that is available via apt. I
> am using that to flag commercials. For videos I specify that it should not
> use logo detection. My script is here

Do you use comskip because mythcommflag doesn't work well for you? I
occasionally wonder if we shouldn't switch to comskip since no bobody
really works on mythcommflag anymore. The last time I compared the
two, though, comskip was better in some cases and mythcommflag was in
others. One advantage that mythcommflag still has is real-time
detection.

David
--
David Engel
david@istwok.net
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
On 11/03/2023 21:06, David Engel wrote:
> On Sat, Mar 11, 2023 at 03:52:18PM -0500, Peter Bennett wrote:
>> There is an open source program called comskip that is available via apt. I
>> am using that to flag commercials. For videos I specify that it should not
>> use logo detection. My script is here
>
> Do you use comskip because mythcommflag doesn't work well for you? I
> occasionally wonder if we shouldn't switch to comskip since no bobody
> really works on mythcommflag anymore. The last time I compared the
> two, though, comskip was better in some cases and mythcommflag was in
> others. One advantage that mythcommflag still has is real-time
> detection.
>
> David

I still use mythcommflag --rebuild, not to do automatic flagging but to
rebuild the seektable and re-establish the relationships between byte
position, time into recording and frame number. It also resets the file
size after cuts have been applied.

One thing that puzzles me is that for most files the processing rate
will be several thousand fps, while for other files on the same channel
it will be around a tenth of that. Some aspect of the encoding,
obviously, but I don't know what it is.

John P
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
On 11/03/2023 22:02, John Pilkington wrote:
> On 11/03/2023 21:06, David Engel wrote:
>> On Sat, Mar 11, 2023 at 03:52:18PM -0500, Peter Bennett wrote:
>>> There is an open source program called comskip that is available via apt. I
>>> am using that to flag commercials. For videos I specify that it should not
>>> use logo detection. My script is here
>>
>> Do you use comskip because mythcommflag doesn't work well for you?  I
>> occasionally wonder if we shouldn't switch to comskip since no bobody
>> really works on mythcommflag anymore.  The last time I compared the
>> two, though, comskip was better in some cases and mythcommflag was in
>> others.  One advantage that mythcommflag still has is real-time
>> detection.
>>
>> David
>
> I still use mythcommflag --rebuild, not to do automatic flagging but to rebuild the seektable and
> re-establish the relationships between byte position, time into recording and frame number.  It also
> resets the file size after cuts have been applied.
>
> One thing that puzzles me is that for most files the processing rate will be several thousand fps,
> while for other files on the same channel it will be around a tenth of that.  Some aspect of the
> encoding, obviously, but I don't know what it is.
>
I thought you could use mythutil for that?

--

Mike Perkins


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
On 11/03/2023 22:37, Mike Perkins wrote:
> On 11/03/2023 22:02, John Pilkington wrote:
>> On 11/03/2023 21:06, David Engel wrote:
>>> On Sat, Mar 11, 2023 at 03:52:18PM -0500, Peter Bennett wrote:
>>>> There is an open source program called comskip that is available via
>>>> apt. I
>>>> am using that to flag commercials. For videos I specify that it
>>>> should not
>>>> use logo detection. My script is here
>>>
>>> Do you use comskip because mythcommflag doesn't work well for you?  I
>>> occasionally wonder if we shouldn't switch to comskip since no bobody
>>> really works on mythcommflag anymore.  The last time I compared the
>>> two, though, comskip was better in some cases and mythcommflag was in
>>> others.  One advantage that mythcommflag still has is real-time
>>> detection.
>>>
>>> David
>>
>> I still use mythcommflag --rebuild, not to do automatic flagging but
>> to rebuild the seektable and re-establish the relationships between
>> byte position, time into recording and frame number.  It also resets
>> the file size after cuts have been applied.
>>
>> One thing that puzzles me is that for most files the processing rate
>> will be several thousand fps, while for other files on the same
>> channel it will be around a tenth of that.  Some aspect of the
>> encoding, obviously, but I don't know what it is.
>>
> I thought you could use mythutil for that?

Usually Linux has many ways of doing the same thing. I've been using
mythcommflag --rebuild for years and it was tweaked long ago to
reproduce the seektables created during recording. It ain't broke, just
has this feature...
>

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: command line to create a recording? [ In reply to ]
On 3/11/23 16:06, David Engel wrote:
> On Sat, Mar 11, 2023 at 03:52:18PM -0500, Peter Bennett wrote:
>> There is an open source program called comskip that is available via apt. I
>> am using that to flag commercials. For videos I specify that it should not
>> use logo detection. My script is here
> Do you use comskip because mythcommflag doesn't work well for you? I
> occasionally wonder if we shouldn't switch to comskip since no bobody
> really works on mythcommflag anymore. The last time I compared the
> two, though, comskip was better in some cases and mythcommflag was in
> others. One advantage that mythcommflag still has is real-time
> detection.
>
> David

It was recommended by glen@glenb.net. I did a comparison with
mythcommflag and found that comskip detected more commercials. Also I
run it against videos. I don't know if mythcommflag is supposed to
support videos, but I cannot get it to work. It says filename is blank
and file is not found even when I supply the file name with the --file
option. The infrastructure in the rest of MythTV to support skipping in
videos is present, so I would expect it to work.

The comskip documentation is fair. I do not understand many of the
options. Some of the source code is a little strange.

Peter

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org