View Full Version : Stabbo - Video Stabilization Filter (deshaker Alternative)
raffriff42
3rd October 2014, 05:47
http://forums.virtualdub.org/index.php?act=ST&f=7&t=23048 Hi everyone,
I'd like to present my VirtualDub video stabilization filter - Stabbo.
I've started its development in some commercial project but because of some weird reasons it was left unclaimed. After resignation I've decided to redevelop it as my own enthusiastic project.
Here are processing examples:
http://youtu.be/O6FlP0XIi_M
http://youtu.be/bDXoyTXhMvk
NB. Source videos can be found in examples descriptions.
Download link: http://sourceforge.net/projects/stabbo/
Pros:
- Real-time. Single pass processing.
- Fast. On my home Intel i5 it processes HD video in real-time.
- Wide search. Good results on extreme video (GoPro like).
Cons:
- Delay. Adds some delay (usually 6 frames) to the video stream.
- 32bit only. I've build it on Visual Studio Express.
I hope it will be useful.
P.S. I'm going to improve this project so I'm looking forward for your ideas.:D
lordsmurf
22nd March 2015, 17:29
I can't get this to work.
VirtualDub 1.9.x and 1.10.x fail to see it in the /plugins or /plugins32 folders.
b2kguga
19th July 2016, 15:26
Great work, but canīt you release the source ? I would like to take a look to see how to improve it.
shekh
19th July 2016, 16:53
The author is not here, I asked a bunch of questions like that on forums.virtualdub.org but got no reply.
shekh
19th July 2016, 17:01
Btw if you are serious about contributing code, take a look at libvidstab.
b2kguga
25th July 2016, 05:01
Thanks, iīll take a look at it
Is this one, right ? https://github.com/rbrito/pkg-libvidstab
But...it is only for linux ? How can i compile it under WinXp and VisualStudio ?
shekh
25th July 2016, 10:45
I took it from this link: https://github.com/georgmartius/vid.stab
Do you know how to write programs in c/c++? How VD plugin works? You will need to connect the library with the plugin api to get it doing something.
To compile the library you just compile every c file from src folder. It does not need too much configuration.
b2kguga
25th July 2016, 16:32
It seems to be the same source. Iīll take a look later and see if i can be able to compile it.
Iīm not used to C++ (personally, i donīt like it. I prefer assembly (with RosAsm) or even plain C), but once compiled it is possible to port it.
Currently, iīm rebuilding Logoaway in order to make it a bit more stable and also study how vdub api actually works before trying to work on a stabilizer plugin.
The only problem iīm finding while compiling vdub filters is that the resultant file is huge. For example, when compiling VirtualdubFilterModuleInit2 function, it inserts a full library, instead simply the pointers to the vdub functions.
Example, the calls to the functions uses pointers to the FilterFunctions, and it is easier to make them in the short version such as:
; c_call is a macro for cdecl calling convention functions
mov ecx D@FilterFunctions
C_call D$ecx+FilterFunctions.addFilterDis D@FilterModule, FilterDefinition, Size_Of_FilterDefinition
But, when compiling them on ViualStudio, the compilers inserts a full library for the call to AddFilter Api. Tipycally, the function is called VDXVideoFilterModuleInit2 which internally leads to several other calls to VDXGetVideoFilterDefinition, memset etc etc.
All of this is unecessary, since we can simply make a indirect call to the FilterFunction pointers and use FilterDefinition as a global variable (a structure, in fact)
The same thing happens for the others Apis. donīt know how to configure VisualStudio to compile it on the shortest form as above.
shekh
25th July 2016, 16:54
"it inserts a full library"
I dont understand what library are you talking about.
This is example of a trivial filter plugin
https://sourceforge.net/projects/vdfiltermod/files/plugins/rgb%20scale/version%201/
compiled binary is 60K
b2kguga
25th July 2016, 17:46
The library is the VDub Apis itself.
I presume it is only a subject of configuration on VisualStudio, since on yours example (rgb.vdf) the apis are called correctly as a indirect call to cdecl functions. Example...the disassembly listing of yours is simply this:
.text:10001200 VirtualdubFilterModuleInit2 proc near
.text:10001200
.text:10001200 arg_0 = dword ptr 4
.text:10001200 arg_4 = dword ptr 8
.text:10001200 arg_8 = dword ptr 0Ch
.text:10001200 arg_C = dword ptr 10h
.text:10001200
.text:10001200 mov eax, [esp+arg_0]
.text:10001204 mov ecx, [esp+arg_4]
.text:10001208 mov edx, [ecx]
.text:1000120A push 7Ch
.text:1000120C push offset unk_1000E028
.text:10001211 push eax
.text:10001212 call edx
.text:10001214 mov eax, [esp+0Ch+arg_8]
.text:10001218 mov ecx, [esp+0Ch+arg_C]
.text:1000121C mov dword ptr [eax], 11h
.text:10001222 add esp, 0Ch
.text:10001225 mov dword ptr [ecx], 9
.text:1000122B xor eax, eax
.text:1000122D retn
.text:1000122D VirtualdubFilterModuleInit2 endp
The problem is that when compiling some others plugins they make the indirect call as a call to a internal Vdub Api (library). So, the "call edx" is replaced as call FunctionXXXX etc etc
Stabbo, for example, used the internal Vdub library, so the "call edx" is replaced as "call FunctionXXX"
Iīll give a try compiling the vid.stab and see if it works as expected. (Like in yours, i mean)
shekh
25th July 2016, 18:03
There is no Vdub Api library, all you need for api is a couple of headers and supplemental cpp files (optional in fact). For example VideoFilter.cpp helps to wrap plugin as c++ class, but it is possible to use plain c api as well.
vid.stab is prepared to work as ffmpeg filter but to make it work as VD filter you have to write some extra code.
b2kguga
25th July 2016, 19:47
I donīt understand why you say there is no library in Vdub. I compiled VDPluginSDK-1.1 and checked the example SampleVideoFilter and this is the assembly result.
.text:10003370 public _VirtualdubFilterModuleInit2
.text:10003370
.text:10003370 fm = dword ptr 8
.text:10003370 ff = dword ptr 0Ch
.text:10003370 vdfd_ver = dword ptr 10h
.text:10003370 vdfd_compat = dword ptr 14h
.text:10003370
.text:10003370 push ebp
.text:10003371 mov ebp, esp
.text:10003373 push 9 ; ver_compat_target
.text:10003375 mov eax, [ebp+vdfd_compat]
.text:10003378 push eax ; vdfd_compat
.text:10003379 mov ecx, [ebp+vdfd_ver]
.text:1000337C push ecx ; vdfd_ver
.text:1000337D mov edx, [ebp+ff]
.text:10003380 push edx ; ff
.text:10003381 mov eax, [ebp+fm]
.text:10003384 push eax ; fm
.text:10003385 call ?VDXVideoFilterModuleInit2@@YAHPAUVDXFilterModule@@PBUVDXFilterFunctions@@AAH2H@Z
.text:1000338A add esp, 14h
.text:1000338D pop ebp
.text:1000338E retn
.text:1000338E _VirtualdubFilterModuleInit2 endp
It is calling to __cdecl VDXVideoFilterModuleInit2 library
I uploaded it here: http://www.midiashared.com/1N5I
The assembly output listing is the same as in stabbo and some others plugins. It seems to be a VisualStudio6 configuration, but i donīpt know how to make it compiles as in yours.
The above function is found here: VideoFilterEntry.cpp
shekh
25th July 2016, 20:22
You can think of it as a library but in fact it is just a couple of headers.
And btw I dont read all these asm dumps, I dont expect anything interesting there.
If the function is called via thunk it is probably debug build, or something else nobody cares about.
b2kguga
26th July 2016, 03:19
Thanks
Iīm finishing my implementation of the logo remover and will try the stabilizer after reading more about Vdub Api reference.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.