Log in

View Full Version : how to discard "blurred" frames automatically?


_ck_
15th July 2006, 16:15
I noticed that quite a few filters for avisynth/virtualdub detect "blurry" frames (ie. frames with high motion). Most filters in this area are used to detect/deinterlace video.

But instead, I'd like to DISCARD (delete) any frame with motion or high motion (over a certain amount?) and leave me with the low motion or still frames.

Is there ANY way to accomplish this in an automated way?

Thanks for any help/ideas!

Zarxrax
18th July 2006, 02:10
Well, avisynth has some sort of functions that can determine the motion in a frame, and I guess you could use that, but I highly doubt it would work anywhere near as well as what it sounds like you want.

Why on earth would you want to do this though?

Daodan
18th July 2006, 11:11
I don't think you want to discard them...ar you'll have desync in this case. All I can think of is for you to replace them with a similar one that you like. For this use freezeframe() (manually, I don't know of an automated version).(still, this will probably lead to some jerkiness).

_ck_
18th July 2006, 14:31
No I definitely do want do discard them, this is to help sort through thousands of frames that are worthy for stills. Audio won't even be an issue ;)

It occured to me that any frame with a high amount of area that needs to be deinterlaced will most likely not be suitable for stills. High interlace = typically lots of motion = blurry in a still.

As an avisynth newbie (but not a programming newbie) can someone give me a general framework of code that would do this? I can't seem to find the function related to detecting/determining motion...

hanfrunz
18th July 2006, 21:52
you could separate the fields with separatefields(). Then use a resizer to get the correct resolution. So you don't have any deinterlacing artefacts.


separatefileds()
lanczosresize(width,2*height)

foxyshadis
18th July 2006, 22:36
Unless you selecteven/selectodd, there'll be constant vertical jitter unless you bob properly, or manually compensate for the field shift.

_ck_
19th July 2006, 06:56
you could separate the fields with separatefields(). Then use a resizer to get the correct resolution. So you don't have any deinterlacing artefacts.


You are missing my point entirely.

I just want to use the detection of frames that have large areas of de-interlace required to discard them. If you look at any "smart" deinterlace filter with a preview mode to show the areas that need deinterlace, they are the parts in high motion.

A virtually still image has almost no areas needing deinterlace, those are the ones i want to keep because the subject matter will typically be in perfect focus and unblurred (not in motion).

I'll see if I can post some examples...

hanfrunz
19th July 2006, 08:07
ahh okay i see you want frames without motionblur, and detect the motion by using deinterlace-motion-detection-methods. You could use the conditionalfilter() to compare to frames or fields. If the difference is high you have motion if it is low you have less.

_ck_
28th July 2006, 06:34
Ah thanks for pointing me in the right direction...

Mug Funky
31st July 2006, 10:51
i had a script that would write an image file when it encountered a completely not interlaced frame (this was to reassemble progressive credits from a stupid converted master that disney gave us)

i lost the script, and in your case it'd output tens of thousands of pictures anyway.

but it can be done :)