[mythtv] Test (crude) patch for commercial skipping

Chris Pinkham cpinkham at bc2va.org
Tue Feb 18 15:18:51 EST 2003


> Actually, I've seen them slipping in 15 second spots quite regularly, often
> promos for network shows, etc., so 30 seconds isn't probably enough
> resolution.

I was thinking of something along the line of this to speed up 'live' scanning:

	1) user hits 'skip' button'
	2) save current position
	3) scan forward up to 62 seconds searching every frame for a blank sequence
		(sequence would be 4 frames or so, marks inter-commercial break)
		- if no blank found, go back to saved position and quit 'skip' mode
	4) (blank found)
	5) save current position (start of first blank found)
	6) jump to 13 seconds from start of blank
	7) scan forward up to 3 seconds looking for another blank
		- if blank found then goto step 5
	8) (no blank found)
	9) jump to 28 seconds from saved position (from step 5)
	10) scan forward up to 3 seconds looking for another blank
		- if blank found then goto step 5
	11) (no blank found)
	12) jump to 43 seconds from saved position (from step 5)
	13) scan forward up to 3 seconds looking for another blank
		- if blank found then goto step 5
	14) (no blank found)
	15) jump to 58 seconds from saved position (from step 5)
	16) scan forward up to 4 seconds looking for another blank
		- if blank found then goto step 5
	17) (no blank found)
	18) no blank found in 62 seconds so jump to saved position and
		quit 'skip' mode

The current patch I posted just picks up and checks a frame at a time 
inside the normal loop in NuppelVideoPlayer::StartPlaying.  I was
planning on breaking the code out into a separate DoCommercialSkip
function and that function would be called if a variable called say
'skip_commercial' was set just like DoFastForward() is called if fftime is
set.

DoCommercialSkip would use one or more algorithms such as blank screen
detection, logo detection, 'little white box' (TM) detection, etc..
The user could turn these detection modes on/off on the Playback
setup screen.

The description/idea above shouldn't be too hard to implement, then can
come some better detection methods and they should just drop right in.

> FWIW, I think we're all *very* interested in this.  Even letting us assign a
> key to start the commercial "skip" detection would be a terrific add-on.

Look back at the message I posted to start this thread and give my
patch a try then.  It's a little slow but was working ok on the shows I
tested it on.  It adds a 'Z' key to try the auto-skip code.

Chris

*****************************************************************************
** Chris Pinkham                  Linux v2.2.18, Sane v1.0.4, Cajun v3.0-8 **
** cpinkham at bc2va.org                          http://www.bc2va.org/chris/ **
*****************************************************************************


More information about the mythtv-dev mailing list