the command is cl_avi(xx) - enter this command into the console, and then play back the demo as normal. It will look a bit weird, but it will put the whole demo into the screenshots folder in base as jpegs.
xx = framerate, so the higher the number, the more screenshots you will get. I normally use 20.
You can use a utility like Bink to rebuild the screenshots into avi files, but remember to clear out the screenshots folder before you play back the demo
Hope this helps.