View Single Post
Old 12-07-2008, 07:46 PM   #1
CaLeB-
Whitest Kid You Know
Beta Tester
 
CaLeB-'s Avatar
 
Join Date: Mar 2007
Posts Rated Helpful 6 Times
Using Demos & Source Recorder

Let's make this simple. You want to record footage from a source game. Cool; no problem. We're going to be using Fortress Forever as an example.

Summing this up: You're going to be capturing frames using built-in commands from the Source engine. After that, you have to compile them into an AVI with a compressor, so then it can be used for movies and such.


Advantages with demos over live capturing:

1. You know when to start recording.

2. Using the Source Recorder technique, you can max out your graphics and preferred FPS without experiencing performance loss in your captured footage.

3. You can go back and recapture your clips anytime you want to. This leaves great potential for remastering your videos via graphics, screen resolution, and FPS, in the future. (This is entirely possible with third-party mods by archiving their versions' installers.) Here are some examples.




I. Requirements

A Source Game - I don't know why you're here if you don't have one yet.

VirtualDub - Required to make an AVI out of your recorded frames.

Lagarith Lossless Video Codec - It explains itself. You're going to need this if you're planning to have high-quality lossless video.

Large Hard-Drive - Depending on your screen resolution and desired FPS (frames per second), you're going to need quite a few gigabytes of space free in order to process your uncompressed frames into an AVI.



II. Activating/Opening Console

Join your server/game, and open up your console (~). If the ~ key does not respond, then your console hasn't been activated yet (which, by default, isn't). Open up your game menu and go to:

Options > Keyboard > Advanced > Check "Enable Developer Console (~) > Apply"



III. Recording/Stopping/Playing A Demo

Demos are files that record your gameplay and every action you and anything/one else takes. That means it doesn't just record what you see; it records whatever area you're in. (The whole map's activity normally isn't captured due to map optimizations.) Demos are useful for playback, and that's where you'll later on record actual footage into frames. It's not difficult; trust me.

Recording Demos:
The command is simple. To start recording a demo, get in-game and follow the command below (insert name with anything you like) into your console (~):
Code:
record name
Now you're recording. In some cases in third-party mods (such as Fortress Forever & Garry's Mod 9), when you start recording, everything freezes up as if you're lagging out. This is a common bug, which usually happens when there are a lot of people in the server or you've been in the server for awhile. So if you're in a multiplayer game, start recording as soon as you connect to avoid this problem. If you do encounter this issue, just type retry in your console to rejoin the game immediately. You should then be able to record normally.

So since you're recording, this is when you do whatever you do. Gaming, filming for a video, etc.

Stopping Demos:
Whenever you're done, make sure to type stop into the console, in order to stop the demo from recording any more. It is suggested to split your demos every few minutes to avoid long loading times. (Although, I do not recommend doing this on third-party mods on a multiplayer server, since it'll likely cause the previously-stated bug.)

Playing Back Demos:
In order to playback a demo, you can't be in game (or else it'll take you out of game anyway). Demos will only work for that game you've recorded it in. Third-party mods have a tendency of causing older demos to break if you've manually updated the game. (For example: v1.0 demos probably won't work on v1.1.) This sometimes happens in Valve games, when there are major engine updates.

Here's the simple command to put into your console to watch your demo, replacing name with the name you've recorded your demo with:
Code:
playdemo name
If you would like to fast-forward through your demo, there is another way of viewing it. Go back to the main menu (out of the demo/game). Open up your console (~) and type in the following command:
Code:
demoui
A panel will pop up, showing some options such as demo speed with some buttons on the bottom like Drive & Smoother. Basic stuff, but don't worry about Smoother (that's a whole 'nother level). Click Load and find your demo.

Now, once you open your demo, it will start up automatically. Once it's loaded and playing, you're able to pause, fast-forward, slow down, etc. You can even click on the button Drive. When you've done so, hold down your left-click anywhere and use the WASD keys to navigate. X and Y also make you go upwards & downwards. Like I said, it records everything around your current location. Click Drive again to go back to your original first-person view.

Most maps are optimized, and you won't be able to see players from another room, even if you use Drive to go over there.

So, there you have it: the basics of a demo. Click Stop anytime to stop your demo, or type stop in the console.



IV. Capturing Your Frames

The reason I've explained the basics of a demo is because it is always recommended to record in a demo, not live. Consider demo files to be like the RAW files of real life footage, since you can adjust your graphics, screen resolution, and recording preferences anytime in the future (as long as your game version remains the same). Since you now know how to operate a demo, we'll go along to what you've been waiting for: exporting footage from a demo.

Now, there are certain ways you can record a demo. You can record it in any frames per second. But, the basics are 30 frames (normal speed), 60 frames (half the speed), & 120 frames (1/4th of normal speed). Recording with any amount of frames can either be used for higher FPS or slow motion. Either way isn't difficult to do.

Configuring Binds
Let's start off with some commands. Open up notepad and copy these into the file.
Code:
bind "ins" "host_framerate 30; wait; startmovie 30"
bind "home" "host_framerate 60; wait; startmovie 60"
bind "pgup" "host_framerate 120; wait; startmovie 120"
bind "end" "endmovie; host_framerate 0; demotimescale 1"
Go to File > Save as... . Change Save as type: to "All Files". Then, name your file as Record.cfg to:


[Go to (drive):\Program Files\Steam\SteamApps\(account name)]

(Choose what game you're using.)

Half-Life 2: half-life 2\hl2\cfg
Half-Life 2 Deathmatch: half-life 2 deathmatch\hl2mp\cfg
Counter-Strike Source: counter-strike source\cstrike\cfg
Garry's Mod: garry's mod\garrysmod\cfg
Team Fortress 2: team fortress 2\tf\cfg
Fortress Forever: SteamApps\SourceMods\FortressForever\cfg


But what do these commands exactly do? Host_framerate, by default, is 0. Ins, Home, and Pgup will all be set as keys that record. Each one has a different frame rate. Ins (note how it says host_framerate 30) will record at 30 FPS. Home will record at 60 FPS, and Pgup will record at 120 FPS. End will end any capturing.

Since I'm using Fortress Forever as an example, I have saved my file to SourceMods\FortressForever\cfg\. Go back to Fortress Forever and type in your console:
Code:
exec Record.cfg
This will set up your binds to your Ins, Home, and Pgup for recording and End to end recording. People who have smaller hard drives are recommended to use Ins (30 fps) with 1280x720 resolution or lower.

Capturing Footage:
Time to capture your footage. Load up your demo. Make sure your audio settings are configured to 2 Speakers at Options > Audio > Speaker Configuration, because recording with 5.1 audio does not work. Whenever you want, close the demoui panel and start recording with Ins or your necessary key. It'll most likely be choppy; this is normal. Press End to stop recording whenever during the demo playback. There will be a pause, and it will delay, depending on how many times you've captured footage in one game session. (The more times you've exported footage, the longer it'll take to respond again.)



V. Compiling Your Frames
Now you've finished capturing footage from a demo. So, where did those frames go? Go back to your desktop and load up VirtualDub.

File > Open Video File...

Depending on your game, your frames will be found there.

Half-Life 2: (account name)\half-life 2\hl2
Half-Life 2 Deathmatch: (account name)\half-life 2 deathmatch\hl2mp
Counter-Strike Source: (account name)\counter-strike source\cstrike
Garry's Mod: (account name)\garry's mod\garrysmod
Team Fortress 2: (account name)\team fortress 2\tf
Fortress Forever: SourceMods\FortressForever

Open the first frame (300000.tga if you used Ins, 600000.tga if you used Home, or 1200000.tga if you used Pgup). VirtualDub will then properly load all the frames. You'll then have to open up the audio file by going to:

Audio > WAV Audio... > Open 30.wav (or 60.wav/120.wav)

If you've used 60 or 120 fps to record your video and you'd like to have it real-time and synced with the audio, go to Video > Frame Rate, check the second option, and insert the proper frame rate here.

Once you've loaded your frames and audio, go to Video > Compression... and find Lagarith Lossless Codec that you've downloaded earlier and click OK. This is for people who want a high-quality lossless AVI. If you have a small hard drive, you'll have to sacrifice quality and choose a more lossful compressor, such as XVID. (You can also try recording in smaller resolutions or with lower FPS.) Even though you'll experience some quality loss, some disk space will be spared.

Now you got your video frames, audio, compressor, and it's finally time to export it into an AVI. Go to File > Save as AVI... and save it wherever you like.

You're done. Be sure to delete all the frames in your game folder afterward!
__________________
Oh, man... More armor for the win, yeah?

Last edited by CaLeB-; 08-17-2012 at 01:26 PM.
CaLeB- is offline   Reply With Quote


1 members found this post helpful.