[mythtv-users] commercial skipping recorded shows

Bruce Markey bjm at lvcm.com
Fri May 9 19:57:19 EDT 2003


Chris Pinkham wrote:
>>>>>if i've watched the show 'live' while its being recorded, then the
>>>>>commercial skip sucks, taking 10s of seconds to skip through minutes of
>>
> 
> <snip>
> 
>>what you describe is consistent with the lack of a "seektable".
> 
>  
> <snip again>
> 
>>So it's not the fact that you are watching the recording in
>>progress that's slowing things down, it's the fact that the
>>recording hasn't finished.
> 
> 
> Isaac already responded to this, but I wanted to throw in my $0.02 as
> well.  Since the seektable is available to the frontend while watching
> LiveTV or an in-progress recording, then seeks can happen very fast.

And I responded to Isaac that requesting position information
can be very slow compared to reading in the seektable at the
beginning of playback and some feature are turned off if there
is no seektable in the file.

> The slowdown occurs when you try to use the commercial skip feature
> before a recording is finished since the commercial skip information is
> not saved to the database until the recording completes.  During recording,
> blank frames are detected and a list is kept.  That list gets saved to
> the database immediately after the recording finishes so if you start
> watching right away you can get fairly accurate commercial skips based
> upon just the blank frames.

Didn't it originally write recordedmarkup entries as blanks
were found? I remember that this was a clue that two backends
were recording the same show because the database was throwing
errors whenever it got a duplicate for the same frame in the
same show.

> Then another thread is fired off which
> plays back through the recorded video and does the commercial detection.
> Currently the only method used for detection is blank-frame, so the
> commercial skip list generated by the FlagCommercials thread should
> be equivalent to the skip list that is generated on-the-fly by the player
> if a blank frame list exists but no commercial skip list exists.  I am
> currently tossing around a few ideas on what to proceed with next to
> add some better/additional detection methods to the FlagCommercials
> thread, so that will get better as time goes by.
> 
> The blank frame list that is saved by the recorder is used to allow
> the player to do some fairly accurate commercial skipping before the
> actual commercial skip list is generated by the post-processing
> FlagCommercials thread.
> 
> If no blank frame list or commercial skip list exists for a video,
> then the player has to manually scan frame-by-frame to find blank frames.

But you have been finding the blank frames so it shouldn't need
to rescan....

> This is SLOWWWWWWWWWW and is the pause that is being seen.  I believe
> that I can eliminate this by adding code to allow the frontend to query
> the current blank frame list from the recorder the same way it queries
> the seektable.  This blank frame list could then be used to generate
> a quick commercial skip list to allow nearly instantaneous skipping.

Exactly. The rescan is rediscovering a list of frame numbers 
that appear to be blank. If you already have that list in
memory or the recordedmarkup table that list should be used
when running the code to find the commercial skips. The
exception, of course, is hardware encoding when you don't
mark blanks while recording.
 
> It's on my TODO list which means it's running as a nice-ed background
> process in my brain right now. :)  This should be pretty easy to do, so
> it should be implemented in the near future.

Best wishes. I think this would be a nice improvement.

Chris, I'd been meaning to ask you about something. When
"Automatically Flag Commercials" first appeared, I set this
thinking it was a good thing. However, a backend thread would
be busy for maybe a half hour after a recording finished.
When I looked into it, it appeared that blanks were correctly
being marked during software encoding. However, with Flag
Commercials set, at the end of recording it would delete all
recordedmarkup entries for that show then start re-reading
the file from the beginning to mark (the same ;-) blank
frames over again.

Is this feature intended to mark blanks for hardware encoded
files? If I turn this feature off, commercial skips work just
fine for files that have finished recording. If it is just 
for hardware encoded files, maybe the Setup help text should
explain that. Also, maybe if when it starts it could check to
see if there are entries for that show in recordedmarkup and
decide that re-reading the file is unnecessary. I suspect
this would be useful for people using combinations of ivtv
and bttv cards or Matrox and bttv cards. 

--  bjm








More information about the mythtv-users mailing list