Guide: How to export footage from a Source game

netrex

Spy
Joined
Mar 27, 2005
Messages
318
Reaction score
0
For this tutorial you will need
  • Either:
    - Half-Life 2,
    - Half-Life 2: Deathmatch, or
    - Counter-Strike: Source
    according to what game you want footage from.

  • VirtualDub. This is the best none-linear editing program out there. No contest. And it's free!

    You can get that here: VirtualDub.org > sourceforge.net. Get the version suited for you.

  • Hyffyuv. A very good lossless codec. Explanation follows further down in this post.

    To install Huffyuv, download the one under 1.3.1 with DLL as link, an unzip it. Then right-click the huffyuv.inf file and select Install. Then all should be ok to use it and it should be listed as a codec in your list of installed coded in VirtualDub.


Ok, lets get started on how to do this. It might seem a bit much, but it's really simple. Remember: This is how you get the best quality footage of a Source game. Fraps will work, but it's not as high quality as this, as this is full quality. Better than how it looks when you play it, cause it gives you the framerate you want, not only what you can run smoothly in realtime, so if the demo is smooth, the footage will be just as smooth as you want it to be, be it normal motion or slow motion.

Also, in your graphics settings. Remember to set antialias and anisotropic filtering to full before exporting the footage. It doesn't matter if it's choppy when you play or when you export with these settings on full, cause the footage will be smooth no matter what as long as the demo is smooth. Also turn all your settings up full to make the game look as good as it can.


First, you need the console: (this works for all Source games you have in your list AFAIK.)
  • Open Play games in Steam. Right click on the game, click Properties. Click on Launch options. No, here you can enter different stuff. To get console, add -console.

    I also have resolution and Hz there. To set resolution add -w 1024 -h 768 for both height and width of your picture. To add Hz, add -refresh 120 (be sure to set a Hz your monitor can handle.).
Now when you start your game, you should have console in the menu. Do not close it, or you will have to restart the game to get it back. I still haven't figured out how to get it working like it does in all the other games I play just by pushing the tilde button. If you know how, please let me know ;).


Now you have your console. This lets you record demos while playing. It's the demos you export footage from. It's not done while you play, cause that mean it will export screenshots at the given framerate while you play which will make playing the game a very painful experience ;)

How to record a demo:
  • To record a demo, you type record demoname in console. So if I type record ravenholm I will record a demo named ravenholm. To stop recording, simply type in stop in console. You can also bind this to a button by entering bind key stop into your autoexec.cfg file. Change key with whatever key you want to bind it to.

    When you are recording demos (in HL2, HL2DM or CS:S at least) it will stop recording and start on a new demo automatically when the map changes. This means that when playing HL2DM or CS:S it will start a new demo when the map changes, and in HL2 it mean it will start a new demo after you have seen the LOADING text in the middle of your monitor when it loads the next part you are coming to. The new demo will have a _X after it and before it will have the same name as you entered in when you started recording.

    So if you started recording with record ravenholm when you started playing, the first demo will be named ravenholm.dem, then after you have seen the loading screen, the next demo that will be created automatically will be named ravenholm_2 and so on until you type stop or hit the button you have bound stop to.

Ok, now you have your demos. Now you need to watch them and find the stuff you want to use in whatever movie you are creating.

How to watch demos:
  • For this you can use either console to start and stop them. Or the easier way, the built-in demo player.

    You can get the demo player up by either enter demoui in console, or just hit the keys Shift + F2 (this combo will also close it for you if needed).

    Then you just click Load... and browse to your desired demo, and click Open. Don't mind looking for the demos. It will open directly in the folder where they are created. But some demos won't play with the demo player. The reason is it has some characters the demo player can't handle for whatever reason (bad coding I would guess). To play these, just type in playdemo "demoname" in console. If you try it without "" around it it still won't play.

    A little note: if you start demos from console, you just type playdemo and you can use your up and down arrow keys to scroll through a list of all the demos you have in the original folder. Autocomplete is nice :).

    In the demo player you can easily slow things down, up or pause by the click of a button, so I advice you to use that instead of binds (which I won't go through here, but use the find function in console to search for them, it's not hard).

    Now, watch your demos, have the demo player open while doing so, and note what the Tick value is when the stuff you want to use starts, cause the demo player lets you jump to the tick you want in a demo. Don't mind the time, it's not useful for this, cause you just have to fastforward to find the time. With the tick you just enter it in the field next to the Goto: buttn and press Goto: and it will get there as fast as possible.

Now you know what stuff you want in the demos, now you just need to get all the footage out.

How to export footage:
  • There are a few binds that are handy when you want to export footage. So instead of typing them all in via your console every time you do it, I suggest you put them in your autoexec.cfg or another config file and execute it every time you are gonna export footage.

    To execute a config file via console, simply enter in exec config.cfg. Of course, change the name config.cfg to the name of the config file you created. There is also autocomplete here, so just type exec and use your up or down arrows to scroll through the different config files available. Or you can type in the start of the file name and you will see it listed and then just push the Tab key to autocomplete it.

    To put it all in a config file, just create a file named whatever.cfg and save it in the config folder of your game.

    for HL2, the folder is: Steam\SteamApps\username or e-mail\half-life 2\hl2\cfg

    for HL2DM it's: Steam\SteamApps\username or e-mail\half-life 2 deathmatch\hl2mp\cfg

    and for CS:S it's: Steam\SteamApps\username or e-mail\counter-strike source\cstrike\cfg

    The variables you use to export footage is host_framerate which sets the framerate and the startmovie which starts the export and sets the name of the files you export. The names will be name0000.tga and name.wav. That's right. It export the audio also. And the audio is perfectly synched when you put the TGA screenshots together to a video clip at the same framerate as you put in with host_framerate. That is very hand and a really good job by Valve to put in :)

    So, here are the bind I use for exporting normal footage. I have three default speeds. Normal motion (normal speed, 30 FPS), slow motion (a third of the speed, 90 FPS), and finally even slower motion (a sixth of the speed, 180 FPS).
    Code:
    bind "ins" "host_framerate 30;wait;startmovie 30"
    bind "home" "host_framerate 90;wait;startmovie 90"
    bind "pgup" "host_framerate 180;wait;startmovie 180"
    bind "pgdn" "endmovie;host_framerate 0;demotimescale 1"
    With these binds I start exporting by pushing either the Insert, the Home or the Page Up key. And I stop exporting with the Page Down key. I use these for all the games I work with, so I always know what does what etc..

    Now that you have exported your footage, you can find it in the Steam\SteamApps\username or e-mail\half-life 2\hl2 folder for HL2, the Steam\SteamApps\username or e-mail\half-life 2 deathmatch\hl2mp for HL2DM or the Steam\SteamApps\username or e-mail\counter-strike source\cstrike for CS:S.

    Now a little tip to let you know how to work a bit faster if you have the diskspace enough:

    • Make a folder named footage in the same folder as the footage is in, and in the footage folder, make a folder where the name is the Tick value of the footage you just exported. Then move all the footage from that tick value in to that folder, then go export the next part. Now you will export all the footage you have space for and move it to their respective folders within the footage folder. Then when all that is done, you turn them into AVI files in one go instead of doing every time you have exported something. Here is a screenshot of how I meant for you to sort it:

      sorted.footage.folders.jpg


      As you can see I have (30) and (90) behind the footage at tick 10.000. This is to let my self know that one is normal motion and one is slow motion. These folder names will also be the names I will use for the AVI files I make out of these screenshots and WAV files.


Now you have your footage exported, now you need to put it together to AVI files so you can edit it in you desired video editing program.

How to make AVI files of the exported footage:
  • Ok, for this you need VirtualDub (check the top on where to get it.)

    • As you know by now, the exported footage is a sequence of TGA images and a WAV file. Open VirtualDub (VD), then click File > Open video file... (or just press Ctrl + O) and browse to the first folder where you have the image sequence you want to turn into an AVI. Select the first image, then click Open. Now you see VD will scan for all the images in that sequence and then you can see it as a video file.

      Now you have to se the framerate that VD will save the AVI file with. Go Video > Frame Rate... (or press Ctrl + R). In the Frame Rate window you select the second option in the list (Change to _____ frames per second) and type in the value you entered in to host_framerate. If this is slow motion, then add the frame rate you will have in your finished movie. I normally use 30 here. But use the value you feel is best for you (24 and 29.97(NTSC) is also often used).

    • Now, to add the Audio, go to Audio > WAV Audio..., then browse to the folder where the footage you are gonna make an AVI out of and select teh .wav file that is there. Note: If this is slow motion, don't do this yet, then you have to change the speed of the sound file first so it has the same speed as the video, meaning it must be longer. I'll get to this later down.

    • Now you have to select the codec to encode it with. But, this is footage you are gonna use to edit a movie with, don't compress it at all, or if you want to, don't compress it with a lossy codec like XviD or DivX, but use Huffyuv. Huffyuv is a fast lossless codec. Think of it as WinRAR or Zip for AVI. It makes it smaller, but you loose no data. This codec is also very fast to work with, so you can check your footage after etc. usually without any choppyness (unless it's very high resolution of course).

      To select the codec of your choice, click Video > Compression... (or press Ctrl + P). Now you see a list of all the video codecs you have installed. Here select either (Uncompressed RGB/YCbCr) or Hyffyuv if you have that installed (check the top of this post, it's listed with a link and I advice you to use it as it's good and saves space). Now, just click OK and move to the next step.

    • So, now all that remains is to save the AVI file. Click File > Save as AVI... (or press F7). Now, browse to where you want to save it (probably in a folder where you have all the other completed footage). But don't click Save yet.

      Remember, you have probably folders with more footage that you are gonna make into AVI's now, so we put this in a work queue and make VD do it all in one go when you have specified what it should do with all the footage, not just this clip.

      To put it into the work queue, check the box at the bottom of the save window with the text Don't run this job now; Add it to job control so I can run it in batch mode and then click save. Now just do the same procedure with all the rest of the footage.

    • Ok, so now you have all your footage in the work queue ready to be converted into AVI files which you then can use to edit your movie.

      In VD, go to File > Job control... (or press F4). Now you see a list of all the jobs you have added to the list. Just select the first job and click Start and it will process all the jobs in the listed order :)


Then that is done. Now all that remains is to fix the WAV files for the slow motion clips.

How to make audio slow motion:
  • The theory of this is simple, so is the practice of it, but here it is: Exported audio is normal motion always. So to make it fit slow motion, slow it down as much as the slow motion is.

    So if your movie has 30FPS as normal motion, and your slow motion is exported at 180FPS, which gives 1/3rd of normal motion, you need to make the audio three times as long (meaning you have to slow it down so it's three times as long. This is called resampling in a lot of audio editing software, cause that's what you do basically).

    If all you have is Microsoft Sound Recorder (which I believe comes with all Windows versions and is found in the Accessories > Entertainment folder in your Start menu, or simply Windows Key + R and type in sndrec32 and hit Enter). Then your slow motion options is limited. Cause all MS Sound Recorder can do is make the sound half the speed or twice the speed, so you only get slow motion at half the speed of normal motion, or half of that again, 1/4th of normal motion and so on. I'm gonna assume you only have this software though as most of you will have that available.

    So if you have slow motion footage exported with either 60, 120 or 240FPS (1/2 speed, 1/4 speed or 1/8 speed), then slow the original WAV file down either 1, 2 or 3 times to get the correct length and it should fit perfectly still. Just save it and then do the procedure as above with thise new resampled sound and you should have your high quality slow motion footage ready for editing :D


Ok, I think that's it. I won't go into editing as that's not what I meant to do, only to show you how to get high quality footage out of your Source game. I might add screenshots here and there later to show things if needed, or edit stuff if something is very unclear or plain wrong (I doubt anything is wrong though), or even add something if I overlooked something. So don't hesitate to post whatever you are wondering about that has to do with this part of moviemaking :) I'll probably clean it up a lot at a later time also..
 
Sticky now please, mods! Excellent fkn guide.
 
Excellent guide netrex, really. :D

And thanks for posting it in my thread for the people who needed the help.
 
Thanks guys =) Hope works well. Been meaning to write something like this for a long time, not only for Source games, so it was about time now =)
 
I still haven't figured out how to get it working like it does in all the other games I play just by pushing the tilde button. If you know how, please let me know .


in options-keyboard under advanced you can check two boxes - fast weapon switch (dont know what this is) and enable developer console or something like that. check the latter, press ~ and jesus loves you.
 
Cyn said:
in options-keyboard under advanced you can check two boxes - fast weapon switch (dont know what this is) and enable developer console or something like that. check the latter, press ~ and jesus loves you.
I've done that. Have had it on since day one. Doesn't work.

Fast switch is so you can switch directly to the weapon without scrolling through the next/previous buttons or the weapons groups menu thingy.

Binds like:
Code:
bind "2"		"use weapon_slam"		// The S.L.A.M.
bind "3"		"slot1"				// Crowbar as Rebel and Stunstick as Combine
bind "g"		"slot5"				// Grenade .. and S.L.A.M., then RPG, but selects the others first
bind "mwheeldown"	"use weapon_crossbow"		// Crossbow
bind "mwheelup"	"use weapon_357"		// .357 Magnum
bind "q"		"use weapon_pistol"		// 9MM Pistol
bind "r"		"use weapon_physcannon"		// Gravity Gun
bind "t"		"use weapon_rpg"		// RPG
bind "v"		"use weapon_ar2"		// Pulse-Rifle
bind "w"		"use weapon_smg1"		// Submachine Gun
bind "x"		"use weapon_shotgun"		// Shotgun
In CS and CS:S you switch directly to the weapon in the group you have bound the button to.. ermh, if you get what I mean ;) try it, it's much faster and much more efficient.
 
Yeah, I've been doing that since day one by editing my cfg. how does having that box checked change anything? can you do it directly in hl2dm without using notepad?
 
Cyn said:
Yeah, I've been doing that since day one by editing my cfg. how does having that box checked change anything? can you do it directly in hl2dm without using notepad?
Like you said to me, how does having a box checked change anything? ;) Only it doesn't work. Oh, I didn't tell you to check off fastswitch in the menu. I just told you what it was since you asked ;)
 
netrex said:
Like you said to me, how does having a box checked change anything? ;) Only it doesn't work.
How about bind the console to a button. try "bind p cmd" or "bind p console" I think its the first one.
- Gordon
 
Hm. I tested it, but no go :/ I still just have it in the menu, not in the game like in other games. But I'm used to it now, so it's really not a problem. Only annoying thing is that I keep pushing Esc to get to the console in other games since I'm so used to it in HL2DM =)
 
netrex said:
Hm. I tested it, but no go :/ I still just have it in the menu, not in the game like in other games. But I'm used to it now, so it's really not a problem. Only annoying thing is that I keep pushing Esc to get to the console in other games since I'm so used to it in HL2DM =)
I just checked and it is toggle_console. Sorry, my mistake. So "Bind P toggle_console"
- Gordon
 
No, it's toggleconsole, then one that's by default bound to the tilde key. If I bind it to another key it brings me to the console in the menu, about the same as Esc does, only it makes the console the top window in the menu also. But if I bind it to the tilde key it doesn't work, so I'll just stick to Esc as I'm used to it and it's about the same ;)
 
This is a similar guide, but a very good one with pictures, and setup info for vittual dub. Also A kick ass program for adding an audio track, transistions, effects, and timeline editing is call "Video Edit Magic 4". It Rocks! anyway here is the tut..... http://webpages.charter.net/tknott/other/hl2-movie.pdf
hl2-movie.pdf (application/pdf Object)
 
I got online specifically to go looking for this information. Excellent guide!! ...and a valuable contribution Netrex. Thank you.

This really needs to be Stickied.

Like now...



...or soon after.

*taps moderator on the shoulder*

Hey, I'm talkin' to you.

*ducks and runs*

*peeks out from behind fake plant and points to this thread*



Anyway, stickied. :thumbs:
 
Thanks =) I'm gonna clean it up and expand it a bit very soon though.
 
^^

Hey i was just hopeing maybe someone could help me with a problem. Whenever i open virt dub and but the tga file 0000 in Its Still slow motion :frown:
 
Hey I'm using this to export demo footage from TF2 and the video file turned out to be 12.7GB for a 2 minute video. How can I keep the method with a lower filesize without compressing it beyond recognition?
 
Back
Top