AutoCropper plugin (1 Viewer)

jawbroken

Portal Pro
August 13, 2005
706
0
Home Country
Afghanistan Afghanistan
Perhaps keeping a 25 frame moving average and only sampling every n frames would be a good idea? If it is just 25 frames in a row, that is only half a second at 50 frames per second, which seems like it could be fooled by dark/unsuitable frames.
 

ziphnor

Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    The moving average length is going to be a user adjustable parameter(and i actually though it was 1 second since i was expecting the 50 interlaced fps to become 25 progressive frames). But you are right, its probably too short, when we get a working implementation we can test for some good default parameters.

    I do however think that most very dark scenes will be caught by the sanity check on the format, especially black frames with end titles etc. Furthermore the reaction to the moving average needs to be fast for expanding bounds and slow for shrinking bounds. Im not 100% what the best way for doing that is.

    I would like to get the cropping working though, i think ill use a little more time to see if i can figure it out based on tourettes input and some old code i found in the newsgroups.
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    A small victory. I took tourettes advice and tried to negotiate a completely new buffer size with the VMR9. It took some serious refactoring because it was no longer enough to simply inherit from the CTransformFilter base class(because it the base class has some friend access which derived classes dont get). Anyway i managed to dynamically alter the buffer size to 1920x1080(just to try something). This means i can almost certainly get away with reducing the buffer size and copying the relevant parts as tourettes suggested. It also seems its pretty fast, i renegotiated every frame(only for testing, dont worry :) which maybe dropped every other video frame, so a renegotiation once per second to minute should be entirely invisible to the user.

    If this works out the only code that will need to be added to MP is:
    1. Options in Configuration
    2. Insertion into relevant filter graphs if enabled
    3. Access from MP to the filter to set options and turn on/off.

    If i have time in the weekend i will try to get the cropping really working, and then go back to finishing the bounds stabilizer.

    jawbroken:
    Btw, without the sanity checks mentioned earlier the start of Swordfish(flashing logos etc) is a good example of why 25 frames moving average is not enough :)
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    And the renegotiation is only needed if the size of the frame has changed, right? So it will probably be even less than that.

    Yes only when the bounding box needs to be changed, i just wanted to point out that even if it happened as often as once per second its not something that you would notice. I had been worried that it would involve stopping the entire graph or similar, so that the change would seriously annoy anyone watching.
     

    chrholm

    Portal Pro
    June 20, 2005
    64
    2
    46
    Copenhagen
    Home Country
    Denmark Denmark
    Just wanted to let you know that your filter sounds awesome. Now I don't have to explain to my girlfriend why there is so much black space around the image (and get a blank stare from her afterwards). Keep up the good work!
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    Status:
    I managed to get the cropping working in the filter graph, when using VMR9( i was using overlay before) there is no flicker at all when changing the buffer size.

    The moving average technique is okay, but its too sensitive to subtitles coming and going(no surprise). Im thinking that a very simple technique is to only add shrinking bounds to the moving average one of x times they occur, while increases will be added multiple times per occurrence. Combined with a longer moving average the stabilizer should improve.

    Just wanted to let you know that your filter sounds awesome.

    Thanks its nice to know someone cares :)
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Thanks its nice to know someone cares :)

    Hehe, I think lots of people care. Certainly I do.

    But this is a technical discussion (it seems), so don't expect too many (future) users chipping in yet ;-)

    Keep us posted
     

    Users who are viewing this thread

    Top Bottom