Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
3rd August 2006, 20:40 | #1 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
Deshaker in AviSynth, preroll parameter
Once again I'm trying to use Deshaker (the great Virtualdub-filter) in AviSynth.
I still have two problems: 1) pass1 works only when "video output" is set to "none". When using "motion vectors" it crashes (access violation). Well, after I found the reason, this is no big problem anymore. Strange, because here it seems it worked in the other case. 2) pass2 doesn't work (access violation) with the setting "use future frames" > 0. I tried different values for the "preroll" parameter in the LoadVirtualdubplugin function - no effect. It even seems as if this argument is completely ignored. Has someone else tried this? |
3rd August 2006, 22:47 | #3 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
Yes, please post your avs and I'll look into it. I never really use Deshaker from AviSynth so I may very well have missed something.
Btw, if you find bugs in Deshaker, email them directly to me instead. I don't want the whole world to see how crappy my software is! |
4th August 2006, 07:47 | #4 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
@guth: I will do so if I actually find any bugs. This looked like AviSynth-related to me.
Here is the script: Code:
LoadVirtualDubPlugin ("C:\Programme\VirtualDubAVS\plugins\deshaker.vdf", "deshaker", preroll=0) #version 1.9 Version.ConvertToRgb32.Trim(0,100).BilinearResize(352,288) #testvideo #pass1, no motion vectors --> works #deshaker("8|1|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|0|1|2|5|40|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|0|0|30|30|0|100|0|0|1|0|0") #pass1, motion vectors --> Avisynth read error: Avisynth: caught an access violation at 0x.... attempting to read from 0x00000000 #deshaker("8|1|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|1|1|2|5|40|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|0|0|30|30|0|100|0|0|1|0|0") #pass2, 0 future frames --> works #deshaker("8|2|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|1|1|2|5|40|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|1|1|30|0|0|100|0|0|1|0|0") #pass2, 2 future frames --> Avisynth read error: Avisynth: caught an access violation at 0x.... attempting to read from 0x00000000 deshaker("8|2|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|1|1|2|5|40|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|1|1|30|2|0|100|0|0|1|0|0") - many other combinations of parameters worked flawlessly (of course, I commented out all but the tested of the four case above...) |
4th August 2006, 11:01 | #5 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
A VirtualDub filter has the option to output graphics on the output video using a "device context" that is sent to the filter from VirtualDub. This allows the filter to draw text and stuff using functions built into Windows. But this device context doesn't seem to be valid when using AviSynth. I think I can check for this and not output any text or motion vectors when using AviSynth. It will be fixed in the next version to be released in a week or so.
But you will probably still want to get that preroll to do what we want. In the AviSynth manual it sounds as though it would do what we want, but I can't see that it does anything. Does anybody know what it's supposed to do? |
4th August 2006, 12:10 | #6 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
Then the crashes in pass2 do not come from the use of future frames but from the warning output ?
Maybe it then works with the preroll as supposed to: At requested frame n the VD-Filter is called min(n, preroll) times with the frames n-preroll, n-preroll+1 and so on. There is no delay introduced depending on preroll, only the possible delay from the VD-filter (in our case the future frames) comes through. Shouldn't it be possible to disable the device context from AviSynth? I found the following code in plugins.cpp which looks like the place in question: Code:
if (src_needs_hdc || dst_needs_hdc) { // throw AvisynthError("VirtualdubFilterProxy: HDC not supported"); vbSrc.hdc = vbDst.hdc = vbLast.hdc = GetDC(NULL); } |
4th August 2006, 13:44 | #7 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
Right, both crashes were due to this device context thing.
I never saw that explanation of preroll. That's exactly how it works actually, but I still don't see how to use it properly. We want to start processing at frame x, where x is the number of future frames you have set. If you use preroll=x, AviSynth will call Deshaker with frames 0 to x for frame x, which is fine. But how do you make AviSynth start processing at frame x. The Trim function won't do, because that throws away the frames completely and we still need them in the preroll thing. But I'm no AviSynth expert, there's probably a way to do it. The code you found doesn't make sense to me. I do tell VirtualDub that I need hdc for the destination, but that would mean that it is set to GetDC(NULL), which should never fail. And the hdc I get is NULL when using AviSynth. And setting hdc to GetDC(NULL) seems very weird. It wouldn't work if it really did that anyway. I don't know what you mean by disabling the device context, but this is no big problem really. I just check if hdc is NULL and don't use it if it is. Which means no motion vectors or info texts of any kind. |
12th August 2006, 15:54 | #10 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
thanks guth,
will try and compare with depan
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
Thread Tools | Search this Thread |
Display Modes | |
|
|