[mythtv-users] Feature request: realtime commercial flagging

Chris Pinkham cpinkham at bc2va.org
Wed Feb 18 02:20:29 EST 2004


> I did a search and didn't come up with anything interesting, so hopefully
> this hasn't been covered before.
> 
> I've become quite addicted to the commercial skip function, but it takes a
> long time for my lowly Celeron 466 to flag commercials.  It's less than 10%
> faster than realtime so, for example, a 7:00-7:30 program isn't ready until
> just about 8:00.  It would be nice if the backend could do the commercial
> flagging in realtime while the program is recording.  This would make
> programs watchable immediately after recording.

This is already done if you use the blank-frame detection method and are
using software encoding.  The software encoder checks for blank frames and
records them to the database as it goes so the commercial skip should
work immediately after the recording finishes.  The marks might not be as
accurate as they would be if you waited until after the flagging thread is
complete later, but they will be pretty accurate.

If you are using a hardware-encoder card then you have to wait until
after the recording finishes as well as the flagging thread.  I do have a
note on my TODO list to try to look sometime at giving the user the option
to fire off the commercial detection thread immediately (well almost
immediately) after the recording starts so that detection will finish
shortly after the recording finishes.  This is dependent on a few other
things on my TODO list though, such as the ability to stop the flagging
thread if the recording is deleted while still being flagged.  This would
involve setting up a listener for the flagging thread and sending out an
event from the backend when a recording that is still being flagged is
deleted.  You're welcome to delve in and look at either of these if you
want.

FYI, part of the reason the commercial flagging takes so long is that it
is run as a nice-d process and sleeps a little for every frame it
processes.  I didn't want the commercial flagging thread to cause any
problems with running recordings so it tries to be as nice as possible
(no pun intended) to the other processes on the machine.  If there
was a way for the commercial flagging thread to find out whether there
were any recordings going on on that backend, then it could run
full-throttle while no recordings were going on and perform it's
current nice/sleep method if a recording was happening.

-- 

Chris



More information about the mythtv-users mailing list