Want to create automatic converter from demo files to videos

DXX Rebirth Descent I/II for modern systems, maintains the look and feel of the original. Home Page

Moderator: zico

Post Reply
User avatar
AlexanderBorisov
DBB Ace
DBB Ace
Posts: 319
Joined: Thu Apr 20, 2017 11:57 am

Want to create automatic converter from demo files to videos

Post by AlexanderBorisov »

Excuse me for cross posting, but I just want to get attention from people working with Rebirth code base on the subject.
And probably you know about other's attempts in this direction, too.
Basically I want to make a kind of Rebirth "plugin" (in fact, a function) that will play the demo into the video file instead of the screen. I need this because I have a lot of Descent 2 demos to convert (maybe 100 hours worth), and obviously converting them with (F)CRAPS :) or similar software one-by-one will be very long and tedious process. Another possible benefits are, such a plugin won't block my computer during recording (as it can be run as low priority task) and can be potentially much faster (no need to show frames at 30 FPS, can di it at 200 FPS fro example).
How do you think, is it worth trying? From the brief look, I've run into the following problems, greatly appreciate if you could help me with some of them.
1) Compiling Rebirth under Windows environment. I've read the instructions in the project folder (INSTALL.txt) , still it seems that they are for people who already have their environment set up and have all necessary dependencies.
I installed SCons 3.0 and Python 2.7 but running SCons,gives syntax error in SConstruct file, line 17
print "%s: %s" % (program.program_message_prefix, msg). And I have a feeling, that paths to compiler, linker and scons.bat are not set up correctly by scons installer, too.
2) Is there a way to create and use VS project for compiling Rebirth?
3) Could not find where rendering and demo playing functions are located. The project seems to have no documentation, and file names are not self explaining, too. Maybe if I had VS project it would not be a big issue.
4) Can you point me to the right direction WRT to writing sound into the video and syncing it with video frames (which API to use, some code examples). For example smth like creating a window from a soundtrack and a static picture. Also about how to convert Rebirth sound format to anything that could be written to the video.

I am an experienced software engineer (and have no problems understanding other's code), but had very little experience with video codecs, and NO experience with audio (except using Beep function on my old ZX-spectrum 25 years ago :) ). Mostly was working with various math, machine learning algorithms, low level optimization and stuff like this. Of course did basic GUI and know OpenGL well enough.
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16125
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Re: Want to create automatic converter from demo files to videos

Post by Krom »

Seems to me it would be easier to automate the process of demo playback using a more basic scripting tool like autohotkey to fire off keystrokes and just use nvidia or amd's built in video capture to record a whole stream of demos overnight. Then just carve up the resulting file into the individual demos after the fact with a simple video splitting tool. Could be done on just about any computer with a video card from the last couple of generations.
User avatar
AlexanderBorisov
DBB Ace
DBB Ace
Posts: 319
Joined: Thu Apr 20, 2017 11:57 am

Re: Want to create automatic converter from demo files to videos

Post by AlexanderBorisov »

Thank you, a good idea, I didn't realize everything can be done with a fixed set of keystrokes, but how I would detect that a demo ended and you can start the next one? Of course you can just wait for a fixed period of time, but some demos are really long ones (one hour), others are just 5 minutes, this will be really inefficient, and I will run out of HD space. I am thinking about using another tool that will detect if nothing changes on the screen for some period of time (demo ended) but not sure it is possible to integrate with keystroke player easily. Of course I can write my own keystroke player (did this a long time ago), but think there should be an easier solution.

About built in video recording, I have a laptop with Intel integrated graphics (HD graphics 4000) and some old desktop with windows XP, with AMD Radeon HD 6500 card.Do you think any of these will work? And what about sound recording? I need the sound too.
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16125
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Re: Want to create automatic converter from demo files to videos

Post by Krom »

Grab updated drivers for the Radeon system and they should come with ReLive, which lets the video card capture the output itself (audio is included), the compression should be reasonable so even 50-100 GB of hard drive space should be enough to last for a couple solid days of recording (and a 1 TB USB external drive worth weeks of recording can be had on amazon or newegg for like $40, definitely worth less than the amount of time you would have spent otherwise).

As for automating the process, I'm pretty sure from what I've read autohotkey can do some pretty insane stuff like read contents from the screen and send mouse clicks for aim bots and the like, you probably have the programming chops to deal with all that. Otherwise it shouldn't be that hard to do a quick hack and slash job in the source code to make the game loop through all the demo files in order instead of just playing one. The main point is you just want to avoid coding for stuff that you could just pull off the shelf.
User avatar
AlexanderBorisov
DBB Ace
DBB Ace
Posts: 319
Joined: Thu Apr 20, 2017 11:57 am

Re: Want to create automatic converter from demo files to videos

Post by AlexanderBorisov »

Thanks again! Will try it all, and I think it is still worth building Rebirth on Windows, at least for "quick hacks" like this, obviously it should be easy, probably I just use the wrong version of Python or SCons. Still will greatly appreciate if someone could comment on this (better yet, update INSTALL.txt to include the full instruction on how to build it on Windows).
BTW does this built-in video capture allows to capture the game window only instead of full-screen?
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16125
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Re: Want to create automatic converter from demo files to videos

Post by Krom »

AlexanderBorisov wrote:BTW does this built-in video capture allows to capture the game window only instead of full-screen?
I don't have an AMD card to check, but I'm pretty sure its a full desktop/full screen or nothing kind of deal unfortunately. Nvidia share/shadowplay has the same limitation (the GPU encoder can only grab the completed frame straight out of the buffers), so any attempt to capture from a window is going to capture the whole desktop too.
Post Reply