Log in

View Full Version : Idea: a Dup Tool?


Ewi
17th April 2003, 08:06
Hi!

I'm sitting here playing around with the Dup threshold. But I can't get the right percentage. There are always some frames that I think should be replaced but are not and some frames, that should not be replaced.

So what about the following idea: A tool that accepts an avs script. Then ads internally a dup(...) with parameters you have specified somewhere plus "debug=true". Now the program captures the debug output (or the user captures it with debugview and saves it to a log file so the program can read it).

<Edit>
Alternative: perhaps a new parameter in Dup like this would do the same trick: "writeSelectionLog=..." and you simply run your avisynth script completly in a way (above realtime) and you would have the same info
</Edit>

Now the purpose of the program: let assume you have 3 successive 'dupped' frames. Now it would be great if the program displays in a left panel the 3 original frames and for comparing in the right panel the dupped frame (once or three times (don't know what's better)).

So you could choose what to do here: do not dup, or keep frame 1,2 or 3 as dupped frame. This choice could be saved to the log file; for example

[1940] Dup: frm 78: Using frm 80
[1940] Dup: frm 79: Using frm 80
[1940] Dup: frm 80: Using frm 80

becomes when discarding the dupped frames

[1940] Dup: frm 78: Using frm 78
[1940] Dup: frm 79: Using frm 79
[1940] Dup: frm 80: Using frm 80

or when keeping frame 2:

[1940] Dup: frm 78: Using frm 79
[1940] Dup: frm 79: Using frm 79
[1940] Dup: frm 80: Using frm 79


After this choice the programm could jump to the next location where a frame was dupped.....

If this is finished and the log file is saved, a new parameter in Dup like "useSelectionLog=c:\...." could completely control dup...

At first I thought I would be good to use the new conditional Stuff for this, but if you choose the frames this way I think it's would a very big AVS script.


So what do you think? For me it would be VERY useful (to do it manually with virtualdub is a pain and after that you can only choose another threshold value because there is no "useSelectionLog=c:\...." parameter), but there always has to be someone who is willing to code it... At the moment donald is in india, isn't he? (IIRC he said that somewhere...).

Don't know if this will ever be implemented but perhaps someone is looking for ideas, and god knows.... This total control would very great....

wotef
17th April 2003, 15:05
i may be thick but i don't have any clue about what you are trying to describe!

looking at this way, if dup dupes frames you don't want duped, then your threshold is just too low

sh0dan
17th April 2003, 15:07
... or you could use blend=true, which will blend all three frames...?

Ewi
17th April 2003, 20:45
Originally posted by wotef
i may be thick but i don't have any clue about what you are trying to describe!

Is my English really that bad? ****.... OK, I'll try again:

If I raise my threshold there are less frames duped but more that should be. If I lower my threshold there are more frames duped but more that shouldn't be. So there's always a compromise and I want more control over this.

So what I tried to describe:
1) Do some kind of 1st pass for dup: Choose a threshold and log what frames a duped (without sending the data to a codec; only to get this information)
2) Manually edit what to do at the duped frames (of course with little effort; as less as possible, hence the my idea about this program)
3) Do the real encode: say dup to use your manually edited log file instead of letting dup choose what frames to dup on its own (what happens normally)

I hope it's a little bit clearer what I mean... I hope so...

Guest
17th April 2003, 21:16
I understand what you are asking for. It just doesn't seem worth the effort to me. But, hey, the source code is available. Have at it!

Ewi
18th April 2003, 13:35
Hi!

At least someone understands me ;-)

Perhaps I will really have a look at the sources. But I hoped someone else could do that because I have many exams and audits in the next months... So this could last very long...

MasterYoshidino
19th April 2003, 07:47
you can try doing the good ol trim trick
a = trim (0,500).Dup(threshold=0.20,show=false,copy=true,maxcopies=230)
b = trim (501,600).Dup(threshold=1.00,show=false,copy=true,maxcopies=230)
c = trim (601,0).Dup(threshold=0.20,show=false,copy=true,maxcopies=230)
return a + b + c

use trim and you can customize a section, such as a still frame or a title screen, to have higher dup strength, and lower dup strengths for low motion scenes such as a very slow pan or a scene where the person is talking but only their mouth is moving (easy to accidently blend if dup is too high)

Guest
19th April 2003, 13:29
Another thing to try. Set the threshold a little on the low side. You'll miss some of the duplicates you want. Then use FreezeFrame() to duplicate those.

Ewi
19th April 2003, 14:30
Different thresholds for different ranges is a good idea. The same for freezeframe. It could take pains to do a whole movie this way but it means more control...

Thank you...