• SrcDemo² - Render smoother Source engine movies, faster.
    276 replies, posted
([url=http://forums.steampowered.com/forums/showthread.php?p=25171193]Cross-posted from the Steam forums[/url]) [url=http://srcdemo2.googlecode.com/][img]http://srcdemo2.googlecode.com/git/img/logo.png[/img][/url] [b]Obligatory screenshot:[/b] [img]http://srcdemo2.googlecode.com/git/img/screenshot.png[/img] [b]What does it do?[/b] SrcDemo² lets you render smoother movies, faster. [b]Smoother[/b], how? By using frame blending. Frame-blending is not a new technique. It involves rendering a movie at a very high framerate, then blending those frames together into a lower framerate. This gives the final video a smoother feel. However, these frame are quite large in file size, and if you want something very smooth, you would thus require a lot of disk space in order to store all those frames. This is where SrcDemo² comes in. [b]Faster[/b], how? SrcDemo² creates a [b]virtual filesystem[/b] that sits within the game's directory. When the game tries to write image files to it, those images get caught [b]before they get written to disk[/b]. Instead, they are kept in memory. After a sufficient amount of images has been caught, they are blended together, and one single frame is written to the disk, in another directory of your choice, in the image format of your choice. This not only allows you to [b]render movies a lot faster[/b] (since frames are not written to disk, and the disk is slow), but also smoother, because you can [b]set the framerate as crazy-high as you want[/b] and the disk storage needed will not change! [b]Example movies:[/b] * [url=https://www.youtube.com/watch?v=dzFIj4v4wqU]Example in Portal[/url] (Blendrate: 25; Shutter angle: 360 degrees) * [url=https://www.youtube.com/watch?v=sNknEsrZOo4]Example in TF2[/url] (Blendrate: 75 for Scout and Medic segments, 45 for the rest; Shutter angle: 180 degrees) * [url=https://www.youtube.com/watch?v=wcHVeOrq2H4]Example in Garry's Mod[/url] * [url=https://www.youtube.com/watch?v=DRj5b8M-qM0]Example in Portal 2[/url] (Blendrate: 9; Shutter angle: 360 degrees) (Ignore the screen playing the Animal King movie too quickly... Source Recorder bug which makes the playback of those movies ignore host_framerate) * [b]Without[/b] frame blending: [url=https://www.youtube.com/watch?v=eFhQQY1sO3E]Equivalent video in Portal 2 without frame blending[/url] [i]Disclaimer: Those were made with [url=http://forums.steampowered.com/forums/showthread.php?t=2108259]SrcDemo[/url], not SrcDemo². However, both tools do exactly the same thing, only the latter does it much faster.[/i] [b]Installation:[/b] [b]Linux[/b] There is a [url=https://aur.archlinux.org/packages/srcdemo2-git]PKGBUILD available[/url] and an [url=https://build.opensuse.org/package/show?package=srcdemo2&project=home%3Ai-ghost%3Asrcdemo2]openSUSE build service entry[/url]. The openSUSE entry is unsupported as I am not the one taking care of it. [b]OS X[/b] The OS X version only works on the command-line. It is [url=https://code.google.com/p/srcdemo2/downloads/detail?name=SrcDemo2.dmg]downloadable here[/url]. It requires a working FUSE implementation ([url=http://fuse4x.org/]Fuse4x[/url], [url=http://osxfuse.github.com/]OSXFUSE[/url], or [url=https://code.google.com/p/macfuse/]MacFUSE[/url]). To use, run the following command: [code]/Applications/SrcDemo².app/Contents/MacOS/srcdemo2 --srcdemo-cmd[/code] [b]Windows[/b] SrcDemo² comes with an automated installer, but relies on two external components. Here is everything you need: * A [url=http://java.com/en/download/manual.jsp][b]32-bit Java runtime environment[/b][/url] (even if you are on a 64-bit machine). * The [url=http://dokan-dev.net/en/download/][b]Dokan library[/b][/url] (version 0.6). The library is only available as a 32-bit interface, hence the 32-bit Java runtime requirement. SrcDemo² does work (and was developed on) 64-bit Windows, however. * [url=http://code.google.com/p/srcdemo2/downloads/list][b]SrcDemo² itself[/b][/url]. [b]How to use:[/b] * Download and install all of the above. * Open SrcDemo². * Select the folder in which you will tell the game to save frames. [b]It must be empty[/b]. It is suggested to create a folder named "srcdemo" inside the game's folder, just for this purpose. * Select the folder in which you want the final, .png frames to be saved. This can be anywhere on your computer, including other partitions, but [b]must not be the same folder[/b] as the previous one. * Select your recording parameters: - [b]Final videos FPS[/b]: The framerate of the video you want to create in the end. [i]Hint: If you want to upload it to YouTube, leave this as 30 fps.[/i] - [b]Motion blur blend rate[/b]: The number of raw frames from the game that will be blended inside each final frame. This can be as high as you want, but going beyond 50 yields very little improvement. - [b]Simulated shutter angle[/b]: Simulates the [url=http://en.wikipedia.org/wiki/Rotary_disc_shutter]rotary disc shutter[/url] of cameras. Usual cameras have a 180-degrees shutter, which means that the film is exposed during 50% of the total frame time, and missing 50% of the action. [i]Hint: Recommended values are from [b]180[/b] (for a cinematic feel) to [b]360[/b] (for butter-smooth-ness to a point that may be considered too much by some people)[/i]. This has no impact on performance. - [b]Effective recording FPS[/b]: This is not configurable; this is the framerate that you will have to tell the game to render at. It is the product of the final video framerate and the motion blur blend rate. * Press "Activate" and wait a few seconds. This will create the virtual filesystem in the folder you have selected at the beginning. * Open your game, run your graphics config, etc. * Type [b]host_framerate [i]n[/i][/b], where [i]n[/i] is the number given as "Effective recording FPS" by the application. * Start the movie: [b]startmovie srcdemo/someprefix_[/b]. Make sure that this will make the game output frames inside the folder you selected at the beginning, and don't forget to put a prefix, for your convenience. * Start the demo file or whatever you want so that frames are produced: [b]playdemo somefile[/b]. * Grab popcorn. * When it is done, end the movie: [b]endmovie[/b]. [i]If you don't do this, the .wav file will be corrupt.[/i] * You should now have all the final frames (as .png files) in the folder you selected in the second step, as well as the .wav file. [b]Open-source[/b] SrcDemo² is fully open-source and distributed under the [url=http://www.opensource.org/licenses/bsd-license.php]2-Clause BSD License[/url]. The source code is available [url=http://code.google.com/p/srcdemo2/source/browse/#svn%2Ftrunk%2Fsrc%2Fnet%2Fsrcdemo]on Google Code[/url]. [b]Credits[/b] * Mythee, for the icon/logo artwork I would love to see videos you can create with this tool! It would also be nice to [b]tag videos you upload on YouTube with the tag "srcdemo2"[/b]. Thanks!
Woah. Nice work.
This is sure going to be useful, it saves me from doing frame blending manually, Thanks
Holy shit definitely using this
WindPower. I don't say this enough. I love you.
Wow, great job. Very useful
I've installed Dokan but it says Dokan is not installed. Do I need to restart the computer after installing Dokan before using this? 3000th post
[QUOTE=t h e;32362834]I've installed Dokan but it says Dokan is not installed. Do I need to restart the computer after installing Dokan before using this?[/QUOTE]Possibly... I didn't need to restart personally. Make sure you get version 0.6, the other versions will not work. Thanks everyone else too~
May I ask what you use to compile the frames and sounds? [editline]18th September 2011[/editline] And then save it as, for maximum quality?
[QUOTE=Smashman;32363097]May I ask what you use to compile the frames and sounds? [editline]18th September 2011[/editline] And then save it as, for maximum quality?[/QUOTE]For the sample videos above, I used [url=http://www.fakkelbrigade.eu/chris/configs/]Chris' max quality config[/url] merged with my own [url=http://theportalwiki.com/wiki/File:Portal_2_walkthrough_config.cfg]Portal wiki walkthrough config[/url]. I then put back together the frames with Vegas 9, and exported with the [url=http://sourceforge.net/projects/x264vfw/]x264 encoder in lossless mode[/url] (make sure you check "Zero latency", or else crap will happen), and 48 kHz PCM audio. There is a bug in Source Recorder that causes the .wav file produced when rendering at high framerates to be severely out of sync with the video. This is not SrcDemo's fault, but you can work around it by re-rendering your demo at a more reasonable framerate (40~60) and using the .wav file from there with the frames from SrcDemo. Also, [url=http://forums.steampowered.com/forums/showpost.php?p=25178738&postcount=12]someone on the steam forums[/url] created [url=http://www.youtube.com/watch?v=hCtq6UPZ93Q]a sample video on Counter-Strike: Source[/url].
Awesome tool, I'll be using as soon as I get some Source game video to render. Thanks.
Def going to be using this, great job WindPower!
Been waiting for something like this for L4D2. Can't wait to try this.
Just tested it out, and I gotta say the difference is astounding. Only downside is that it takes a helluva lot longer to record, about 2-3x longer; but in the end it's worth it.
[QUOTE=ApocHedgie;32365984]Just tested it out, and I gotta say the difference is astounding. Only downside is that it takes a helluva lot longer to record, about 2-3x longer; but in the end it's worth it.[/QUOTE]Thanks! I do feel I need to clarify a point here though: The render will take a lot of time. It will be slow. However, it will be much faster than the time it would take to render the same demo (with the same level of smoothness) without this tool, because not all the frames are written to disk; hence the word "faster" up there in the title. Obviously, compared to a regular, non-smooth render, this will be slower.
I am getting Dokan is not installed even tho it is. I'm on Windows 7 64bit and yes i have java 32bit
[quote]SrcDemo² creates a virtual filesystem that sits within the game's directory. When the game tries to write image files to it, those images get caught before they get written to disk. Instead, they are kept in memory. After a sufficient amount of images has been caught, they are blended together, and one single frame is written to the disk, in another directory of your choice.[/quote] I LOVE YOU. [quote][final frames are written as png][/quote] HAVE MY BABIES
[QUOTE=ory25;32399260]I am getting Dokan is not installed even tho it is. I'm on Windows 7 64bit and yes i have java 32bit[/QUOTE]Did you reboot? [editline]20th September 2011[/editline] [QUOTE=Max of S2D;32399425]I LOVE YOU. HAVE MY BABIES[/QUOTE]Thank you kind sir :3 I gladly accept your offer.
Alright, so I played with it for a little while, and here are two things I noticed: • I think the tool doesn't like capturing frames from the same directory twice. It just won't detect the TGAs being recorded there again (yet the folder was empty and no problems were reported) • You can't "de-activate" to go select another directory without restarting. Is this by design?
[QUOTE=Max of S2D;32400142]Alright, so I played with it for a little while, and here are two things I noticed: • I think the tool doesn't like capturing frames from the same directory twice. It just won't detect the TGAs being recorded there again (yet the folder was empty and no problems were reported) • You can't "de-activate" to go select another directory without restarting. Is this by design?[/QUOTE]1. Make sure you don't have two instances running at the same time (and check the process list); make sure there's no two instances trying to have the same folder mounted! Additionally, the "Activate" and "Exit" buttons take a few seconds to do their job, so make sure you're not too quick to start recording or to remount. You can check in Explorer if the folder is mounted properly by looking at the size column (it should say something impossibly huge), or the icon of the folder on certain versions of Windows 7. You can also just try saving a text file in it with Notepad and check if it gets written to the other folder. Also quite importantly, don't use the same prefix for image files in the same run (i.e don't do startmovie srcdemo/something_ and then startmovie srcdemo/something_ again). It might work, but it'll probably get confused. However, you should be able to do multiple renders without restarting, if you give them different prefixes. You should even be able to do parallel renders, if you somehow have two Source engine games running at the same time. I don't recommend that though... 2. I wanted the "Exit" button to actually be a "Deactivate" button, I really did, and at the last moment when I actually implemented it, I saw the following message: "This version of the Dokan library can only mount directories once." Which means that the while it is possible to unmount something, it is not possible to re-mount anything later, which would make it silly to have a "Deactivate" button if it forced you to restart right after. So to be able to re-mount something, the whole program has to be restarted. It's sad, but that's how it is :( It pisses me off too. Sorry... Thanks for all the feedback everyone. I am currently working on adding a "debug mode" so that I can get a better idea of what is going wrong in certain cases.
yes i did i even tried to reinstall still no luck
[QUOTE=WindPower;32400558]2. I wanted the "Exit" button to actually be a "Deactivate" button, I really did, and at the last moment when I actually implemented it, I saw the following message: "This version of the Dokan library can only mount directories once." Which means that the while it is possible to unmount something, it is not possible to re-mount anything later, which would make it silly to have a "Deactivate" button if it forced you to restart right after. So to be able to re-mount something, the whole program has to be restarted. It's sad, but that's how it is :( It pisses me off too. Sorry...[/QUOTE] I'm thinking you could probably make the program write a batch file so it relaunches itself in a matter of seconds :p The only other thing this would possibly need is motion estimation methods to smooth out the blur even more, but yeah
I honestly think frame blending is terrible. It just blurs everything up.
[QUOTE=dvondrake;32402707]I honestly think frame blending is terrible. It just blurs everything up.[/QUOTE] frame blending is the best method for motion blur, what it only "blurs everything up" (no it doesn't) when you set the framerate too high and render out to a really low FPS video and will this program actually work with L4D and L4D2 seeing how host_framerate is locked/missing?
[QUOTE=Odellus;32403632]frame blending is the best method for motion blur, what it only "blurs everything up" (no it doesn't) when you set the framerate too high and render out to a really low FPS video and will this program actually work with L4D and L4D2 seeing how host_framerate is locked/missing?[/QUOTE] Left 4 Dead will not work with Source Recorder, as you stated; In l4d1 there is no Host_framerate command and in l4d2 the command IS existent, but the client recording system will not properly display zombie positions in anything higher than 240 FPS.(they jump around) Obligatory content. [media]http://www.youtube.com/watch?v=J6QjZxaVx_A[/media] [media]http://www.youtube.com/watch?v=Si9lPIBRmt0[/media]
Indeed, it probably won't work with Left 4 Dead / Left 4 Dead 2. It'll work if they fix it... Anyway, I released a new build today. You can download it from [url]http://code.google.com/p/srcdemo2/downloads/list[/url] as usual. Changes include: - A "Deactivate" button which will restart the application (Thanks Max of S2D) - A new debug mode (ory25: This will not fix your problem, but at least it'll provide more info, so please try it out) - Tighter thread synchronization around byte buffers when saving images (this will make things slightly slower but more stable) - A bounded PNG saving queue which should fix memory/CPU issues when rendering with low blending rates - Changed default blend rate from 25 to 32 to match SFM - Will attempt to detect if something is already mounted in the mountpoint, and if there is, will attempt to unmount before mounting itself (might fix Max of S2D's issues, not sure) - Increased max output framerate to 600 and max blendrate to 1000, for the really, really, really crazy out there - Proper singular/plural forms on numerical text fields Uninstalling the old version before installing is recommended, because the startup menu has changed from "SrcDemo2" to "SrcDemo²", so if you don't uninstall the previous version, you'll have two startup menu entries. Sorry about that; hopefully this won't be necessary in the future. Known bugs: - Can cause a BSOD if you specify a path with [url=http://en.wikipedia.org/wiki/NTFS_symbolic_link]NTFS symlinks[/url] in it as mountpoint (will be fixed soon hopefully) Upcoming features: - Audio only mode where all frames will simply be ignored; useful when you want to re-render the demo but only want the audio, as it will be much faster if all frames are completely dropped - Video only mode; this is useful when you render with high blendrates and know that Source Recorder is going to produce an out-of-sync .wav file; might as well ignore that .wav file right from the start to save the significant audio disk I/O [QUOTE=Max of S2D;32400615]The only other thing this would possibly need is motion estimation methods to smooth out the blur even more, but yeah[/QUOTE]This, however, will not be implemented. There already is [url=http://slowmovideo.granjow.net/]software to do this[/url], if you really want to, but: - It is very, very slow - Compared to simply increasing the blendrate, the result is of poorer quality and takes much, much longer - It would probably take so much time on slow computers that Source Recorder may give up (if it can't finish saving a .tga after a certain timeout, it will cancel the render) - To be realistically fast enough, it would need to be computed on the graphics card, which is already quite busy rendering the frames of the game tl;dr: Increasing the blendrate will provide better results, and will provide them faster; motion estimation is best left to postprocessing. Thanks for the suggestion anyway, I appreciate that.
[QUOTE=WindPower;32405315]Indeed, it probably won't work with Left 4 Dead / Left 4 Dead 2. It'll work if they fix it...[/QUOTE] They wont fix it because its not a problem for them, its just the way Source is optimized in L4D to handle the amount of zombies and their display. Tl;Td - Its not going to be fixed because its designed that way.
Amazing need to test this out.
Idea for another feature, too, which could possibly be interesting: something which displays how many TGAs are getting processed per second. Kind of like a framerate counter. Could even be useful in certain cases, like knowing which quality/speed ratio to take. Also, I made a 2 minute test video! :D [media]http://www.youtube.com/watch?v=wcHVeOrq2H4[/media]
I made another one with a blend rate of 64. Don't bother with that much since 32 is fine [media]http://www.youtube.com/watch?v=hHB28SDEego[/media] Odd glitch about half way through. I should also change the firing sound as well
Sorry, you need to Log In to post a reply to this thread.