On Tue, 2004-05-25 at 17:58 +0200, Ronald Bultje wrote:
> 
> The issue here is that mjpegtools doesn't provide any way of doing this.
> You'll have to dive into libjpeg internals yourself to get this done. It's
> not that hard, but it's icky, if you know what I mean.

Yeah, and way over my head.  I don't really know anything about actual
JPEG compression.

> * you originally proposed to use the top few lines: in 16:9 movies
> broadcasted over 4:3 TV, those are always black.

Right.  But since the algorithm is to find black frames by eliminating
those that are determined to not be black, this should still work.  More
time will be spend on 16:9 broadcasts, but still better than decoding
whole frames every frame.

> * TV broadcast artifacts can make things 99% black instead of 100% black,
> so you'll need tresholds.

Right.  I had such with my mplayer filter.

> * Movie trailers

In TV commercials?  My purpose is for marking (and eliminating) ads on
television broadcasts.

> often end up in blackness as well, so be sure to not
> fetch those ones.

But wouldn't the end of the movie trailer be the end of the commercial
and thus still a valid to detect black frame?

> So the libjpeg internals are not that hard. You can take an example from
> the code in lavtools/jpegutils.[ch] and use that as a base for decoding
> only part of the image. I think there's a for() loop somewhere that goes
> over each line and decodes it, so that should be easy to do only once
> instead of <height> times. :).

Indeed, I think I found all of this shortly after posting my original
message.  Now I just have to find the time.  :-)

b.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to