Rules Latest Posts
Search
Search Forums
Advanced Search
The Team Fortress 2 Fort

The Team Fortress 2 Fort

« Previous1234Next »
RSS Feed
 
 
0

STICKY: How to create videos with tf2 demos

#  Aug 19, 2008 at 2:07 PM
Joined:
6 Years 6 Months
Post Count:
2708
 DurbanPoison
Loading
DurbanPoison
 
    There are a number of ways to create videos out of in game demo footage.  Some people use Fraps to record it into a video file.  I find that this is not the most effective way to do it.  Fraps records and outputs a video file, like an AVI or something...  however the compression it uses makes things blurry, and scrambled, espescially if you want to go in and edit down the footage, then try and re-compress it it will look like total crap. 

    Instead of using fraps to make the video, I prefer to export the footage directly through TF2, onto my hard drive using the console command startmovie.  What startmovie does, is once you play a demo, or exit the console, it begins to create a series of tga (image) files and a wav (audio) file of your demo.

All this info is based on my experience, and these 2 sites:

http://developer.valvesoftware.com/wiki/Demo_Video_Creation
http://developer.valvesoftware.com/wiki/Demo_Recording_Tools#Demo_console_commands

I highly recommend you take a look at them, but for convenience, I have written down the essentials.


  1. Before you make the movie, though, be sure your resolution is set to something at or below 800 x 600.  Each 800x600 file you produce takes up 1 meg of hardrive space or more.  So in the end, you'll have thousands of these image files which can add up to many gigabytes of data.
      • The best way to play back and record demos is in windowed mode.  To set up your game to play in windowed mode, and at the resolution of 720 hd standard resolution, type this into the Launch options of tf2. 
        • -novid -applaunch 440 -window -width 1280 -height 720

  • **You can choose any width and height you want, but this is just what I use (720 HD).



    1. ------^^--------
    2. Before you begin recording, you are going to want to find just the best parts of the demo to record.  Otherwise, you will end up with gigs of useless footage of respawning etc.  So I suggest going through the demo with a notepad out, and carefully watch the demo and write down the tick ranges you will want to record. 
      • Type demoui into console, which opens up controls for demo playback.  Load the demo, and watch it carefully for those ticks where you want to start recording.  I want to note that its best to give a little "lead" time before and after (but more importantly before)  the actual shot that you want, so note 500-1000 ticks before where the shot begins.
        • Once you have gone through your demo, found and written down all the tick #'s of the shots you want to keep, in demoui, open up the demo editor - click Edit...
        • This will open up a new window in which you can create a list of commands to do various things within the demo playback. 
  • In the editor create the following commands:

    •  New --> skipahead
      • starttick: usetick - 0
      • skipto: 15000 (or whatever tick you want it to start recording)

    • New --> PlayCommands - snd_restart
      • starttick: usetick 15001  (this command restarts your audio one tick after the demo starts playing *this part is important if you want your audio to record properly)

    • New --> stop playback
      • usetick = 16000 (or whatever tick you want the recording to end)

     Then, when you use the console command startmovie and then play the demo, tf renders (creates) a sequence of numbered images...THOUSANDS of them (depending on how long each clip is) into your tf folder.  Each frame that you see in game, gets saved as a numbered image file (.tga) - just like the ones you get by pressing your screen shot key (F5 by default).  Also, a .wav file will be created for your audio.  You take this image sequence (think of it like a digital flip book) - and bring them into a video editing software like vegas, after effects, or premier along with your audio.  


    3. startmovie Time! 
        To create a targa sequence and .wav of your demo, go to console type the following commands:

    1. sv_cheats 1         
    2. host_framerate 30         - sets the framerate, so you dont render everytick and get stuck with a full hard drive.
    3. startmovie moviename   - starts a recording
    4. playdemo demoname    - plays the demo
    5. endmovie                      - ends movie *** -- ***make sure you do this before you leave your computer for a long while, because you may just fill up your hard drive if you forget***--

    This produces a targa sequence at 30 fps which I then drop into a composition in Adobe After Effects along with my audio.  I sync the video and audio, then I go to render, choose compression settings - Quicktime .mov @ animation compression for my pre-compositions, then delete the targas.  Once I have all of the .mov files ready, I make a new project and drop all of those into their own compositions and combine it all for the final edit.

    If you want slow motion you will need to record the shot at 60, 90, or 120 fps so just use :
    host_framerate 60
    (or whatever framerate you desire)



    The following list gives an overview about the available demo commands:

    SkipAhead Skips demo playback ahead to a specified tick and resumes playback.**
    StopPlayback Stops demo playback immediately.**
    PlayCommands Executes a console command.
    ScreenFadeStart Fade screen in/out.
    TextMessageStart Shows a simple text message.
    PlayCDTrackStart Starts playing a CD track.
    PlaySoundStart Plays a .WAV or .MP3 sound file.
    Pause Pauses playback for given seconds.
    ChangePlaybackRate Changes the playback speed.
    ZoomFov Adds a zoom in/out effect.



     Other useful command variables

    sv_cheats <0/1>     Required for following commands.
    r_drawviewmodel <0/1>     Hides weapon model.
    cl_drawhud <0/1>     Hides entire hud. **
    hud_saytext_time 0     Hides chat text, default = 12. **
    hideradar     Hides radar location text.
    cl_radaralpha 0     Hides new radar overviews (def. = 200).
    drawradar     Enables radar.
    thirdperson     Enables third person view (firstperson to change back). **
    cam_command <0/1>     Enables camera mode. (*Use this instead of "thirdperson")
    cam_idealyaw <value>     Rotates the camera around model horizontally (0-360)
    cam_idealpitch <value>     Rotates camera around model vertically (0-360)
    cam_idealdist <value>     Sets the distance from player to camera (default = 64)

    Use the "find" command to find other camera
    options (+camyawleft, etc) Usage: find cam


    Demo Console commands

    demo_debug <0/1> Shows additional demo debug info
    demo_fastforwardstartspeed <factor> Go this fast when starting to hold FF button.
    demo_fastforwardramptime <seconds> How many seconds it takes to get to full FF speed.
    demo_fastforwardfinalspeed <factor> Final playback speed when holding the FF button.
    demo_interpolateview <0/1> Enables/disabled view interpolation between demo ticks
    demo_quitafterplayback <0/1> Quits game after demo playback**
    demo_recordcommands <0/1> Record commands typed at console into .dem files
    demo_pause [seconds] Pauses demo playback, seconds optional
    demo_resume Resumes demo playback
    demo_togglepause Toggles demo pause/playback
    demo_gototick <tick> [relative] [pause] Skips to a tick in demo. If the relative parameter is 1 the tick is an offset to the current tick. If the pause parameter is 1, playback while be paused when tick is reached
    demo_timescale <scale> Set the demo playback speed as a factor, 1.0 is normal playback

    snd_restart        reloads audio**

    **useful


    Other useful sites:

    http://www.halflife2.net/forums/showthread.php?t=87850
    http://developer.valvesoftware.com/wiki/Console_Command_List
    #  Aug 19, 2008 at 2:36 PM
    Joined:
    6 Years 6 Months
    Post Count:
    2708
     DurbanPoison
    Loading
    DurbanPoison
     
    Jin brought up a good question in one of my frag video threads:

    Quote:
    Originally Posted by fatality154@live.com
    how big should your hardrive be if you want to make frags?

     I would suggest having 100 gigs of free space to work with.  You dont want to ever fill your hard drive over 75% or it will start to chug.   I have used upwards of 60 gigs of disk space in making one of these videos (and that is after I rendered my uncompressed mov's and deleted all of the tga sequences).
    #  Aug 24, 2008 at 4:42 PM
    Joined:
    6 Years 3 Months
    Post Count:
    394
     TLR
    Loading
    TLR
     
    Its not really true that fraps makes low quality videos.  Fraps records uncompressed avi files.  My last frag video was captured using fraps, at 1680 x 1200 resolution, and looked just like ingame does.  You can set fraps to capture half resolution or full screen, full screen will obviously be better quality but will have an impact on your fps, and fps being the biggest issue with using fraps to capture videos. 
    #  Aug 28, 2008 at 5:00 PM
    Joined:
    6 Years 1 Months
    Post Count:
    1239
     Rosendoom
    Loading
    Rosendoom
     
    Now Durban, what about the other software that the TF2 wiki suggests using to synch the images and audio into a video clip, would that be usable, or would one of those programs you listed be better?
    #  Sep 02, 2008 at 2:39 AM
    Joined:
    6 Years 6 Months
    Post Count:
    2708
     DurbanPoison
    Loading
    DurbanPoison
     
    I didnt actually list any software... but you could use anything that can render video.  Adobe After Effects, Premier, Virtual dub, Sony Vegas... etc.  Yes you can also use fraps, but i find my method of extracting video a little more procedural and efficient (once you get the hang of it).  Plus it is a little more usable in after effects.

    So it entirely depends on what you are going to do with the footage.  After all, it is your project, so do it how you please!
    #  Oct 10, 2008 at 10:15 PM
    Joined:
    6 Years 2 Months
    Post Count:
    116
     sintax
    Loading
    sintax
     
    I just found out something interesting while recording AVI using "startmovie blah avi"
    last time I did it it was running at about 1fps and I assumed it was CPU bound with all the calculations it needed to to to encode 1920x1200 video.
    I just recorded one, but this time with TF2 on my raid0 array, and it ran at about 15fps.
    So yeah, the intense lag experienced while recording demo's as files is HDD churn. Im assuming if I made a ramdisk I could actually enjoy making movies
    #  Oct 11, 2008 at 9:45 PM
    Joined:
    6 Years 6 Months
    Post Count:
    2708
     DurbanPoison
    Loading
    DurbanPoison
     
    Sintax - You have to set the frame rate in console usng the command: host_framerate 30

    and why on earth are you trying to record video at 1900X1200?!?

    did you even read the tutorial?
    #  Oct 12, 2008 at 12:46 AM
    Joined:
    6 Years 2 Months
    Post Count:
    116
     sintax
    Loading
    sintax
     
    er, the frame rate was set, and the video came out at a perfect 30 fps.
    computer just cant record AVI at 30fps, so it lags while its recording. It lags at 720 too while encoding xvid.
    why am I recording video at 1900x1200? because I can. Id rather have a HD source, and then downsample it later.
    Did I read the tutorial?
    Not before I wrote that, but I have now, Its way way better than the ones I found with google. Cheers
    #  Oct 12, 2008 at 2:43 AM
    Joined:
    6 Years 6 Months
    Post Count:
    2708
     DurbanPoison
    Loading
    DurbanPoison
     
    ok, yes that is normal. When recording a demo with startmovie you will have no audio and it will go by very slowly.
    #  Oct 16, 2008 at 8:15 AM
    Joined:
    5 Years 12 Months
    Post Count:
    1039
     willazord
    Loading
    willazord
     
    Thanks for this durban, it's been incredibly helpful!
    « Previous1234Next »
     
     
    World Famous ShoutBox
    Loading
    The Buzz
    GamerNation on Twitter