Record the demo you want.
Disconnect from the server
Go to options and select windowed mode.
open the console and type sv_cheats 1
then type host_framerate 30
(cl_drawhud 0 removed the HUD if you want.)
Now type in startmovie moviename avi (the moviename can be whatever you want it to be)
It might freeze for a second or two then a little menu will pop up. Scroll down to xvid codec and select it.
In the console type playdemo demoname.
When you are done recording type stopmovie or endmovie in the console.
(note: you Can play the demo first, and get to the point you wish to record THEN type startmovie moviename avi to start recording from there.)
You must type endmovie in the console when you are done recording for this to work. Now, when you are done open your tf2 folder where demo's are stored and there should be an avi file there.
(If you do not have the xvid codec in the list you must download the codecs for it here:
http://www.xvidmovies.com/codec/
Otherwise your video will be several gigabytes, or it will look really terrible.
EDIT: When you start to actually record, the demo will seem extremely laggy. This is normal, so don't worry about it. It may appear very laggy but once you end the movie and view the actual .avi file, it plays at a very high framerate and does not lag due to the host_framerate command.