dvbcut-user  

Re: [DVBCUT-user] Ready for a stable release / interested in new capabilities ?

Michael Riepe
Thu, 08 Jan 2009 07:44:42 -0800

Hi!

Ralph Glasstetter wrote:

> I also had in mind implementing a black frame detection for "Auto cut 
> points", 
> but that was far too slow with the used imageprovider. Maybe it could be 
> implemented more effectively on the mpeg level during indexing somehow... 
> don't know... however, not every commercial begins with a black frame and not 
> every black frame starts a commercial.

True, but black frames still make good chapter indicators.

Besides that, detecting black frames can be quite fast if you use a
heuristical approach.

First, there rarely is a single black frame - there usually are several
in a row. Therefore, it might be sufficient to consider only I frames
(which greatly reduces the amount of work), or maybe I and P frames
(still much less work than a full scan).

Second, use an intelligent method for detecting black screens. Decoding
the frame and looking at every pixel hardly counts as such. Instead,
look at the encoded data, and disregard the chroma (U/V) channels. All
you need to know is the intensity, and that's in the Y channel.

Another trick to speed things up is to look only at certain areas of the
screen - e.g. a line of macroblocks somewhere in the middle. If it's
completely black, the rest of the screen probably is as well (you can
verify that in a second step if you want).

Actually, looking at three macroblocks might be sufficient for a quick
scan - one on the left, one on the right and one in the middle of the
screen. Add their luminosities, and if the result is below a certain
(configurable) threshold, the frame is probably black.

You don't even have to decode the macroblocks. In MPEG video, one of the
coefficients directly corresponds to the average luminosity of the MB.

-- 
Michael "Tired" Riepe <mich...@mr511.de>
X-Tired: Each morning I get up I die a little

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
DVBCUT-user mailing list
DVBCUT-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dvbcut-user