Now that you've followed Nova's script to save and record a demo file, here's how to generate a nice AVI file.
Download and install the K-Lite codec pack:
K-Lite CodecThis will install a bunch of codecs for decoding/encoding most video files you find on the internet.
Fire up the game you recorded the demo for and bring up the developer console. Console commands are in bold
startmovie moviename aviWhere moviename is the name of the resulting AVI file you want to create (don't add the .avi extension it will add it for you.)
And avi (note the spaces between moviename and avi
This will pop up a window asking what kind of encoding you want. Chose the MPEG-4 encoding.
playdemo demonameWhere demoname is what you previously recorded.
Now the demo will play back (with NO sound) and look really choppy and crappy. This is normal.
When it's done, stop the movie
endmovieThe resulting AVI file should be in the install directory of the game.
For L4D it's C:\Program Files\Steam\SteamApps\common\Left 4 Dead\
TF2 would be C:\Program Files\Steam\SteamApps\yourname\TF2 (I think)
You should end up with a nice compact (relatively speaking) MPEG4 AVI file of the demo.