[MPlayer-dev-eng] [PATCH] -vf combdetect: crude detection of interlaced sources

Christopher Key cjk32 at cam.ac.uk
Mon Aug 2 16:50:30 CEST 2010


Hello,

I have a large (>1000) library of DVDs stored as VIDEO_TS directories,
and want to transcode them to MP4 format for watching on mobile
devices.  I want the entire process to be automatic, and not to require
any manual intervention.  To achieve this, I've created a two pass
process.  The first pass analyses the video and detmine suitable
filtering options, and the second pass does the actual transcoding. 
There are two things that I currently determine during the first pass,
how to crop the video (using cropdetect), and whether the perform any
deinterlacing (which is what the attached patch assists with).

The attached patch adds a video filter, combdetect, that performs very
crude interlacing detection.  If the different in luma between a pixel
and and those above and below it exceeds a certain threshold[1], the the
pixel is deemed to be combed.  If the percentage of pixels on a frame
exceeds a certain value (currently 1%), then the frame is deemed to be
combed.  If the percentages of frames that are combed exceeds a certain
value (currently 5%), then deinterlacing is recommended.  For each
frame, the number and percentage of combed pixels, the number and
percentage of combed frames to date, and the current recommendation are
written to stdout.

As mentioned, this is very crude.  It works well for my library of PAL
dvds, which will either be 24fps film sped to to 25fps, or natively
50f(ields)ps interlaced TV, but isn't designed to analyse NTSC material
that may use 3:2 pulldown etc.  This is why I've named it combdetect,
that's all it does, and it leaves room for a more advanced filter than
can detect a rather broader range of field/frame fiddling techniques. 
Nevertheless, I find this very useful, and suspect that it may be useful
to others with similar aims.

Kind regards,

Christopher Key


[1] Strictly, only if the magnitude of both differences execeed a
certain threshold and both differences have the same sign.  For example,
20 50 20 would match, but 20 50 80 wouldn't.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: comb-detect.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100802/309de62f/attachment-0001.asc>


More information about the MPlayer-dev-eng mailing list