View Full Version : Advanced Dup Script
Atamido
13th July 2003, 18:04
I was trying to figure out a way that you could prevent false positives on duplicate frame detection with Donald Grafts Dup filter. (http://shelob.mordor.net/dgraft/dup/dupnew.html) In very low motion (esp CGI) scenes, it could detect duplicate frames. In these cases, duplicating the frames would cause a slight jerkiness to the video.
I thought that if you could specify a range of frames to compare, and set the threshold for those, then you could get a more accurate detection.
For example, a CGI video clip that has a combination of still scenes and slow motion zoom scenes. If you could set a range of about 10 frames, and set a higher threshold. Then it would compare a frame, and the frame 10 frames later to see if it could detect a duplicate. If it could, then replace all frames inbetween as duplicates. Then do the same thing for 9 frames, but with a slightly lower threshold. And continue on until you were testing two consecutive frames at a very low threshold.
Originally I thought this would need to be done inside of the filter, kind of like a temporal smoother. But, it occurred to me that with a powerful scripting utility such as AVISynth, there is probably a way to do it through scripting.
I was wondering if someone could show me an example script of how this could be done?
bilu
13th July 2003, 18:31
Does Donald's MultiDecimate filter work for your needs?
Bilu
FredThompson
13th July 2003, 20:25
I've just about given up on Dup because the potential for unwanted duplication is quite large. Unless you're intimately familiar with your source material, chances are it will do something you don't want. The only time I use it is after filtering and selectively in areas I know are static, or nearly so, like credits.
I thought it would be safe on live-action stuff because there's lots of change between scenes. However, it detects dups on scenes where everything is static except moving lips. Yuck. Same is true with animation. We're so sensitive to motion in that part of a face that we see those mistakes quickly.
It also doesn't seem to detect motion if the items are the same chroma but different luma. Lots of false positives, even with a sensitivity of 1.
The idea of gaining a little bit of bandwidth and noise reduction by using dup is great but be careful when and how you use it.
Atamido
14th July 2003, 06:02
Originally posted by bilu
Does Donald's MultiDecimate filter work for your needs? Correct me if I am wrong, but this is a filter for dropping extra frames and changing the framerate. I need something that will detect a duplicate frame and duplicate it exactly so that it could be removed by a simple DirectShow filter without changing the framerate of the video, but creating a variable framerate video.
@FredThompson: Thanks for the comments. You are probably correct, but I think that my idea may be able to compensate for this. I would like to try it out on a test CGI video to see how effective it is.
If anyone can think of how to accomplish this detection over multiple frames as mentioned in the first post, please post it.
FredThompson
14th July 2003, 07:13
I can't imagine the headaches you'll have with variable framerate video. Is this a practical exercise or something academic.
I've asked Donald about making some updates to Dup right after I discovered the luma challenge. He said it will be a while before he's back into that filter.
Personally, I'd love a block-based version. You know, instead of a full-screen compare it works on a user-definable block. This might be real nice for camcorder shots with a static background. Then again, analog noise might be a real challenge.
I guess if you have pure CGI and it's not too complex, think of an AutoCAD animation, Dup could be real helpful.
Atamido
14th July 2003, 18:55
Originally posted by FredThompson
I can't imagine the headaches you'll have with variable framerate video. Is this a practical exercise or something academic. Through some amount of irony, VirtualDubMod handles it fine. It detects when there is a "missing" frame during import and creates a dropframe internally. But yes, variable framerate will create issues on older systems. (It has already been discussed why AVISynth won't support it, but I can't wait for MKVSynth to be developed)
Its a little bit of both. It will be tested to see if its practical. First on my generated test clip, and then on something larger like "Monster's Inc". If it is practical, it will be used. If not, it will be used as an academic example.
bilu
14th July 2003, 21:04
Originally posted by Pamel
Through some amount of irony, VirtualDubMod handles it fine. It detects when there is a "missing" frame during import and creates a dropframe internally. But yes, variable framerate will create issues on older systems. (It has already been discussed why AVISynth won't support it, but I can't wait for MKVSynth to be developed)
If you know why Avisynth won't support it, then you know it can't be an AVS script or plugin. You're just looking for a concept-function, right?
Bilu
Atamido
14th July 2003, 22:14
I need the Dup filter in AVISynth to identify duplicate frames and make the frames completely identicaly. That source can then be fed into something else that can support variable framerate. Dropping out a perfectly identical frame is easy, identifying an identicaly frame with artifacts is a lot harder. So yes, AVISynth is perfectly capable of what I'm looking for AVISynth to do.
This is not exactly on subject but close.
I have a capture problem sometimes where
about once per second I get two exact duplicate
frames in place of one. Unfortunately, the audio
is not duplicated and so the video gets out of
sync. Vdub reports the second duplicate as a Drop frame
Does anybody know how to make either Vdub or Avisynth
delete the extra (dropped) frames ?
I have a horible method where I make Avisynth compare
every pair of frames and log the difference to a file.
I then use UNIX sort and AWK to generate another AviSynth
script with a DeleteFrame() for all log entrys with zero
difference. This can generate a script with 10,000 lines !
It's slow. Need a better way.
cheap-red-wine
20th July 2003, 04:40
MultiDecimate().
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.