.kkapture 0.01 - demo capturing made easy (hopefully)
category: code [glöplog]
29,97 FPS
k, i'll check.
Okay, no glitches if only the WAV is rendered. Good to know, so if I have problems there I can create the soundfile seperatly. :-)
A tip for those with a similar problem as I have: You can accelerate the rendering of the soundfile by setting the FPS to a low value because kkapture plays the demo at the set FPS if no videostream is created.
kkapture 1.00 (yes, that's a 1 in front of the decimal point!) coming up soon.
good news: lots of problems fixed. my tests so far indicate that this one really is pretty much rock solid, and i've added some features that should really make a difference. notably, kkapture can now deal with processes that spawn other processes. i can now finally kkapture borg!
bad news: right now, borg.exe seems to think that the proper response to being kkaptured is this:
and so on - yes, it actually tries to delete every file and directory on the disk. trying to work out WHY it does this. meanwhile, BOO HISS to the alambik coders; whatever the cause, this is NOT acceptable application behavior :). and a good thing i debug kkapture on a separate machine that has no important data on it whatsoever - lost a couple of savegames and a windows installation, that's it.
good news: lots of problems fixed. my tests so far indicate that this one really is pretty much rock solid, and i've added some features that should really make a difference. notably, kkapture can now deal with processes that spawn other processes. i can now finally kkapture borg!
bad news: right now, borg.exe seems to think that the proper response to being kkaptured is this:
Code:
sys: DeleteFileW("/pagefile.sys")
sys: DeleteFileW("/Program Files/Common Files/Microsoft Shared/ink/Alphabet.xml")
sys: DeleteFileW("/Program Files/Common Files/Microsoft Shared/ink/ar-SA/tipresx.dll.mui")
sys: RemoveDirectoryW("/Program Files/Common Files/Microsoft Shared/ink/ar-SA")
sys: DeleteFileW("/Program Files/Common Files/Microsoft Shared/ink/bg-BG/tipresx.dll.mui")
sys: RemoveDirectoryW("/Program Files/Common Files/Microsoft Shared/ink/bg-BG")
sys: DeleteFileW("/Program Files/Common Files/Microsoft Shared/ink/chslm.lex.bin")
sys: DeleteFileW("/Program Files/Common Files/Microsoft Shared/ink/chslm.wdic2.bin")
sys: DeleteFileW("/Program Files/Common Files/Microsoft Shared/ink/chtlm.lex.bin")
and so on - yes, it actually tries to delete every file and directory on the disk. trying to work out WHY it does this. meanwhile, BOO HISS to the alambik coders; whatever the cause, this is NOT acceptable application behavior :). and a good thing i debug kkapture on a separate machine that has no important data on it whatsoever - lost a couple of savegames and a windows installation, that's it.
wtf :)
Woot!
what...the...hell!
It's called borg. If you mess with it, it messes with you...
..resistance is futile!
okay, found it. turns out alambik wasn't doing anything evil, i hereby wish to formally retract my earlier comment. :)
i think from now on i'll refer to this one as "the stack smashing bug from hell".
what happens is that alambik first depacks a bunch of files into a temp directory, runs the player (waiting for it to exit), then deletes the temp files (and the temp directory) again. it does this by calling CreateProcess, then WaitForSingleObject to wait for it to finish, then doing something like this:
looks ok to you? yeah, to me too. except due to the bug i just fixed, the start of tempDir got overwritten - with a 0 byte. _findfirst("/*") and then delete all of it recursively? uh oh.
so, how did my stupid stack-smashing code look? stupid fixed-size c string buffers without length checking? using memset to clear a local array with the wrong size? too-clever-by-half pointer kung-fu?
[x] none of the above. here's the diff:
congratulations, you're officially one of the most unpleasant calling convention mismatches EVER.
in other news: some more testing and then kkapture 1.00 :)
i think from now on i'll refer to this one as "the stack smashing bug from hell".
what happens is that alambik first depacks a bunch of files into a temp directory, runs the player (waiting for it to exit), then deletes the temp files (and the temp directory) again. it does this by calling CreateProcess, then WaitForSingleObject to wait for it to finish, then doing something like this:
Code:
recursiveClean(tempDir);
// ...
static void recursiveClean(const char *curDir)
{
char buffer[_MAX_PATH];
struct _finddata_t info;
sprintf(buffer,"%s/*",curDir);
intptr_t handle = _findfirst(buffer,&info);
if(handle != -1)
{
do
{
if(info.name[0] == '.')
continue;
sprintf(buffer,"%s/%s",curDir,info.name);
if(info.attrib & _A_SUBDIR)
recursiveClean(buffer);
else
remove(buffer);
}
while(_findnext(handle,&info) == 0);
_findclose(handle);
}
_rmdir(curDir);
}
looks ok to you? yeah, to me too. except due to the bug i just fixed, the start of tempDir got overwritten - with a 0 byte. _findfirst("/*") and then delete all of it recursively? uh oh.
so, how did my stupid stack-smashing code look? stupid fixed-size c string buffers without length checking? using memset to clear a local array with the wrong size? too-clever-by-half pointer kung-fu?
[x] none of the above. here's the diff:
Code:
-static BOOL Mine_CreateProcess(LPCTSTR appName,LPTSTR cmdLine,LPSECURITY_ATTRIBUTES processAttr,
+static BOOL __stdcall Mine_CreateProcess(LPCTSTR appName,LPTSTR cmdLine,LPSECURITY_ATTRIBUTES processAttr,
congratulations, you're officially one of the most unpleasant calling convention mismatches EVER.
in other news: some more testing and then kkapture 1.00 :)
One more good example why software should not try to delete a whole directory.
__stdcall is the new rm -f /
ryg: out of curiosity, can the new kkapture handle Blackout 9L? Would be nice to have a video version of it as the windowing & video/audio playback & timing routines are rather interesting in Droid's vj software (which blackout uses).
pommak: perhaps it would be easier for droid to make a video dump from the sources, then?
kkapture 1.00 released. woo-hoo!
enjoy. and tell me if you find bugs :)
pommak: if it uses weird timing code, it's probably easier to just plug in the standalone AVI writer code than to use kkapture. i'm not going to add any weird workarounds to the timing code, it's intricate enough as it is.
enjoy. and tell me if you find bugs :)
pommak: if it uses weird timing code, it's probably easier to just plug in the standalone AVI writer code than to use kkapture. i'm not going to add any weird workarounds to the timing code, it's intricate enough as it is.
You da man!
I'm gonna try "Fall equals winter" now, as usual... :)
I'm gonna try "Fall equals winter" now, as usual... :)
Hmmm. Not working. I get an hourglass cursor on a white screen and my desktop background in the avi file...
Checked the GDI function.
Checked the GDI function.
Please please please make it a option to turn off [or adjust the threshold!] of the "application is hammering timer calls, advancing time" feature. A lot of recent demos are loosing 50% of their frames from this. They work fine in 0.09.
ryg, kkapture is totally awesome but still fails on http://pouet.net/prod.php?which=3301 ... not sure what's going on but whatever I do it just hangs.
micksam: oops. will make this configurable.
Oh also, kkapture totally doesn't hook http://pouet.net/prod.php?which=54606 - Absolutely no clue why, sound still plays through and everything :)
thanks vor 1.0! it now works with java stuff :D
micksam7: I assume the problems with PC-04 are related to .net, because I heard other .net demos aren't working, too.
By the way, I didn't have any trouble kkapturing "agenda" with v1.0.
By the way, I didn't have any trouble kkapturing "agenda" with v1.0.