[mythtv-users] Real time commflagging of 1080i material from hdpvr

Chris Pinkham cpinkham at bc2va.org
Tue Apr 27 17:38:13 UTC 2010

* On Tue Apr 27, 2010 at 10:18:41AM -0700, Kevin Ross wrote:
> I don't think the commflagger is multithreaded, so going from a dual core @
> 2.7 GHz to a quad core @ 2.8 GHz won't give you much improvement.

You are correct.  Adding multi-threading support was one of the goals
of the Summer Of Code project way back when, but nothing ever came of
it.  I have some ideas if anyone is interested in picking up the
gauntlet, but right now I have other places I'm focused on so I haven't
touched the flagger in literally years except for bugfixes.

> BTW, I have a Phenom (at only 2.3 GHz), and commflagging of my HD-PVR
> recordings (1080i) takes quite a while, just like on your setup.

The flagger does have some code in it to try to optimize things so
that 1920x1080 doesn't take 27 times longer than 320x240 video
(ie, 2073600 pixels vs 76800).  For instance, the blank frame detection
short-circuits when it finds non-blank data.  The scene change code
doesn't look at every pixel, it uses a variable sized grid of points
in the frame.  It looks like I only change the grid spacing from every
8 pixels to every 10 pixels when going from 1280x720 to 1920x1080.
If you want to try a test, you could edit 2 lines in the code and see
what kind of speedup you can get on 1080 material.

Edit mythtv/programs/ClassicCommDetector.cpp and search for the following:

    if ((width * height) > 1000000)
        horizSpacing = 10;
        vertSpacing = 10;
    else if ((width * height) > 800000)
        horizSpacing = 8;
        vertSpacing = 8;

Try changing the two 10's up there to 12 or 16.  That should speed up
detection a little.  That whole section of logic could probably be
cleaned up a bit to be hand-tuned to standard video sizes.  Patches
are welcome if they give good results. :)


More information about the mythtv-users mailing list