Hey guys since there seems to be a lot more new PC players here, I thought I'd post this so everyone can share their games if they'd llike to. This is a how-to for PC players to record their games to avi files for watching or for uploading to youtube. I'd like to see more PC players uploading and sharing their videos, I'm sure there's plenty of entertaining games to be seen.

The first step in recording the game sessions to video is to first record the game session as a demo, then convert the demo into an avi using the built in features of the Source engine. The easiest way and the way described in this tutorial will make use of the Xvid coded. Xvid can be downloaded for free, just google 'xvid'.

The first step is to record the game as a demo. This can be done using the console command 'record' as you begin play to begin recording the game as a demo. Example: 'record L4D' will record to file L4D.dem. As the maps progress, it will continue to use a new number for each map, so after the map load, it will begin L4D2.dem, L4D3.dem, etc. I'm not sure how it handles a map restart.

When you are done with the session, to stop recording, use the console command 'stop'.

Once you have recorded the game, it's time to capture the playback into a video file. The easiest way to do this is with Xvid. From the main menu, you can use the startmovie command to capture a movie beginning from the time the console is closed. Call the command like so: 'startmovie moviefilename avi' where moviefilename is the name of the avi file you wish to create. This will prompt a popup window to appear (if you do not see it, alt-tab out and go back in, the pop-up should appear). In this window, select Xvid for the codec, set it how you like (I use single pass with the quantizer set at ~14). Now that you have chosen your codec, click ok to close the popup.

To start the demo playback, type 'playdemo demoname' into the console where demoname is the name of the demo. Thus, for our example it would be 'playdemo L4D' to start the demo. You will have to play back each .dem file separately, so if the recording goes across multiple maps, you will need to play back and capture each one separately. The .dem files are stored in the \left 4 dead 2\left4dead2\ directory, so you can always see what's available. The demo will play back, mostly likely at a lower framerate running at only about 1/2 - 3/4 speed. When you are satisfied with the demo and wish to stop recording, type 'endmovie' into the console to finish the avi file. You must use the 'endmovie' command, or the avi file will not be created. To stop demo playback, simply type 'stopdemo' into the console. After the endmovie command is run, an avi file will be created in the \left 4 dead 2\ directory for your viewing pleasure.

That's all there is to it. Here are a couple things besides the basics I found useful:
1. Use 'voice_loopback 1' before you start the game if you want to record your own voice as well as your teammates. This decision must be made before you even begin to start the session. If you don't do this before playing, you will not have your voice in the game, only teammates. This does have the nasty side effect of making you listen to everything you say with a slight delay.

2. I've seen it recommended that the command 'host_framerate 30' be used before playing back the demo and capturing it to avi. I believe this stabilizes the framerate so that the movie plays back as evenly as possible and is captured at an even pace. Not entirely sure though.

3. The video files can get quite large very fast. Even with my resolution set at 1280x768, a ten minute demo will turn into a 200-300 megabyte file. Unless you have A LOT of room, you may want to lower the resolution before you play back the demo to prevent the movie from taking gigabytes of HD space.

4. It's very easy to accidentally desync the audio and video. This is why I recommend using the startmovie command before starting playback of the demo. Since it doesn't start recording until the console goes away, you don't need to worry about it capturing the main menu either.

5. There's also a demoui command if you want a user interface with which to manipulate playback of the demo. I haven't done much with it, but you can use it to jump to specific points in time of the demo, as well as fast forward or rewind, or load other demos.

If you find anything that should be edited, let me know. Feel free to ask questions if there's anything you don't understand either.