Log in

View Full Version : How to insert blended frames, using duplicate frames as reference point?


Alcacia
1st June 2004, 22:31
I have a piece of video (AVI) with a very clear pattern of frames:

1-2-3-4-5-6-7-8-10-11-12-12-
1-2-3-4-5-6-7-8-10-11-12-12-
...and so on.

Every 12th frame is a duplicate, and there is a skipped frame 4 frames before each duplicate.

I realize it is very easy to get rid of the duplicate frames with Decimate(). But I would also like to insert a blended frame 4 frames before each duplicate. Is there any way to accomplish this with AviSynth?

I also realize that if this were an absolutely strict pattern, then I could accomplish both goals (dupe removal and blend insertion) using SelectEvery(). But I would rather use a command that will detect and reference the duplicate frames, in case the pattern isn't strict.

Any ideas?

scharfis_brain
2nd June 2004, 06:12
ideas? yes.

but a scripted solution is only possible with an unprocessed sample.
max 10 MB

Alcacia
2nd June 2004, 17:02
Hi, well, i'd love to get a little more info about your ideas on this one. I can't figure out what the best way is to send you a sample. There doesn't seem to be any file attachment feature in the PM function here on the doom boards. Would you need the sample to elaborate a bit on your ideas?

scharfis_brain
2nd June 2004, 23:47
I have some ideas flying around in my head, but cannot explain them exactly without testing and scripting this myself.

the problem is: I can easily detect the dupe using some conditionals, but INSERTING and DELETING one frame with a distance of four frames is difficult to handle with avisynth's conditionals.

the way to go would be:

detect the dupe. replace its predecessor with its predecessor.
do this four times. (this shifts those 4 frames into future by one frame)
when we reached the drop, we have made some space to fill with an interpolated frame (either blending or better: motion compensation)

If anyone has a easier way to do that, ideas are welcome :)

you can send the sample on different way to me:
ICQ, IRC, Mail

PM me, which one you do prefer.