Difference between revisions of "Help:Recording demos"
m (→Console commands) |
GrampaSwood (talk | contribs) m |
||
(19 intermediate revisions by 17 users not shown) | |||
Line 1: | Line 1: | ||
{{Help navbar}} | {{Help navbar}} | ||
− | + | {{update}} | |
== Console commands == | == Console commands == | ||
Line 8: | Line 8: | ||
|- | |- | ||
|'''record''' ''<filename>'' | |'''record''' ''<filename>'' | ||
− | |Starts recording a demo of the current gameplay under the specified filename. The demo will be saved as | + | |Starts recording a demo of the current gameplay under the specified filename. The demo will be saved as ''<filename>''.dem in your game folder {{code|\Steam\SteamApps\common\team fortress 2\tf\}} along with all its associated files. |
|- | |- | ||
|'''stop''' | |'''stop''' | ||
Line 17: | Line 17: | ||
|- | |- | ||
|'''playdemo''' ''<filename>'' | |'''playdemo''' ''<filename>'' | ||
− | |Plays back a pre-recorded demo of name specified in <filename> | + | |Plays back a pre-recorded demo of name specified in <filename>. |
|- | |- | ||
|'''stopdemo''' | |'''stopdemo''' | ||
− | |Stops playback of the currently playing demo | + | |Stops playback of the currently playing demo. |
|- | |- | ||
|'''listdemo''' ''<demoname>'' | |'''listdemo''' ''<demoname>'' | ||
− | |Provides details of the specified demo file | + | |Provides details of the specified demo file. |
− | |||
− | |||
− | |||
|- | |- | ||
|'''startmovie''' ''<filename>'' ''[avi/raw]'' | |'''startmovie''' ''<filename>'' ''[avi/raw]'' | ||
− | |Starts recording movie frames, stored in your game folder | + | |Starts recording movie frames, stored in your game folder {{code|\Steam\SteamApps\common\team fortress 2\tf\}} as .tga files. |
− | A recent feature to | + | A recent feature to the PC version of the Source Engine is the ability to record directly to AVI by specifying {{code|avi}} as a parameter. When this parameter is used a windows codec dialogue box will be shown for you to select the codec so it is best to set TF2 to windowed mode before doing this. |
− | Example: | + | Example: {{code|Startmovie mymovie avi}} will record a mymovie.avi to your game folder. |
− | ''' | + | <br>'''Note that .avi is no longer supported. Attempts to record in .avi formats will issue a prompt telling the user to use h264 (Quicktime) instead.''' |
|- | |- | ||
|'''endmovie''' | |'''endmovie''' | ||
Line 38: | Line 35: | ||
|- | |- | ||
|'''demo_debug''' ''<0/1>'' | |'''demo_debug''' ''<0/1>'' | ||
− | |Shows additional demo debug info | + | |Shows additional demo debug info. |
|- | |- | ||
|'''demo_fastforwardstartspeed''' ''<factor>'' | |'''demo_fastforwardstartspeed''' ''<factor>'' | ||
Line 44: | Line 41: | ||
|- | |- | ||
|'''demo_fastforwardramptime''' ''<seconds>'' | |'''demo_fastforwardramptime''' ''<seconds>'' | ||
− | |How many seconds it takes to get to full FF speed | + | |How many seconds it takes to get to full FF speed. |
|- | |- | ||
|'''demo_fastforwardfinalspeed''' ''<factor>'' | |'''demo_fastforwardfinalspeed''' ''<factor>'' | ||
− | |Final playback speed when holding the FF button | + | |Final playback speed when holding the FF button. |
|- | |- | ||
|'''demo_interpolateview''' ''<0/1>'' | |'''demo_interpolateview''' ''<0/1>'' | ||
− | |Enables/disabled view interpolation between demo ticks | + | |Enables/disabled view interpolation between demo ticks. |
|- | |- | ||
|'''demo_quitafterplayback''' ''<0/1>'' | |'''demo_quitafterplayback''' ''<0/1>'' | ||
− | |Quits game after demo playback | + | |Quits game after demo playback. |
|- | |- | ||
|'''demo_recordcommands''' ''<0/1>'' | |'''demo_recordcommands''' ''<0/1>'' | ||
− | |Record commands typed at console into .dem files | + | |Record commands typed at console into .dem files. |
|- | |- | ||
|'''demo_pause''' ''[seconds]'' | |'''demo_pause''' ''[seconds]'' | ||
− | |Pauses demo playback, seconds optional | + | |Pauses demo playback, seconds optional. |
|- | |- | ||
|'''demo_resume''' | |'''demo_resume''' | ||
− | |Resumes demo playback | + | |Resumes demo playback. |
|- | |- | ||
|'''demo_togglepause''' | |'''demo_togglepause''' | ||
− | |Toggles demo pause/playback | + | |Toggles demo pause/playback. |
|- | |- | ||
| style="white-space:nowrap" | '''demo_gototick''' ''<tick>'' ''[relative]'' ''[pause]'' | | style="white-space:nowrap" | '''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 will be paused when tick is reached | + | |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 will be paused when tick is reached. |
|- | |- | ||
|'''demo_timescale''' ''<scale>'' | |'''demo_timescale''' ''<scale>'' | ||
− | |Set the demo playback speed as a factor, a ''scale'' of 1.0 is normal playback | + | |Set the demo playback speed as a factor, a ''scale'' of 1.0 is normal playback. |
+ | |- | ||
+ | |'''ds_record''' | ||
+ | |Start recording a demo manually. | ||
+ | |- | ||
+ | |'''ds_stop''' | ||
+ | |Stop recording a demo manually. | ||
+ | |- | ||
+ | |'''ds_mark''' ''<comment>'' | ||
+ | |Bookmark the current demo tick count for future reference. The <comment> is an optional descriptor you may include. | ||
+ | |- | ||
+ | |'''ds_status''' | ||
+ | |Report the current recording status. | ||
|} | |} | ||
Line 79: | Line 88: | ||
* All HUD elements including chat / console text messages | * All HUD elements including chat / console text messages | ||
* Audio received by the player through the voice chat system | * Audio received by the player through the voice chat system | ||
− | |||
There are limitations to note when recording a demo: | There are limitations to note when recording a demo: | ||
Line 85: | Line 93: | ||
* The demo only records what was necessary to render audio and video for the player. | * The demo only records what was necessary to render audio and video for the player. | ||
** The demo does not record the scoreboard at any time even if the player views it during recording. | ** The demo does not record the scoreboard at any time even if the player views it during recording. | ||
− | ** The player cannot externally view | + | ** The player cannot externally view their own character during play unless they taunt or die. However, turning on {{code|sv_cheats}} during demo playback and using the {{code|thirdperson}} console command works as normal. |
− | ** Objects such as other players, buildings and weapons fire will not be visible beyond a certain distance from the player's current position if | + | ** Objects such as other players, buildings and weapons fire will not be visible beyond a certain distance from the player's current position if the player uses the '''Drive''' function in the Demo Playback window. The entire map is loaded but distant activity not in the player's line of sight may not be rendered at all times. Sprays are rendered at all times if the local cached spray still exists. |
− | * The recorder does not capture the recording player's voice communication. | + | * The recorder does not capture the recording player's voice communication. It does record text messages in the game chat, however. (To record the player's voice, {{code|voice_loopback 1}} must be set in the console. This forces the player's voice to be played back in the audio output.) |
* If a server changes maps during a recording, the game will create a new demo file with the same name and an appended sequential number to avoid filename conflicts. | * If a server changes maps during a recording, the game will create a new demo file with the same name and an appended sequential number to avoid filename conflicts. | ||
* A demo file cannot be started from within the operating system (e.g. double-clicking on it in Windows Explorer). A demo must be loaded from within the game by console command or demoui interface. | * A demo file cannot be started from within the operating system (e.g. double-clicking on it in Windows Explorer). A demo must be loaded from within the game by console command or demoui interface. | ||
− | |||
===Recording Tutorial=== | ===Recording Tutorial=== | ||
− | [[ | + | [[File:Demo_tutorial_Record.JPG|thumb|300 px|right|Demo recording console command: '''record''']] |
− | [[ | + | [[File:Demo_tutorial_Stop.JPG|thumb|300 px|right|Demo recording console command: '''stop''']] |
This procedure will create a short demo on a private server. | This procedure will create a short demo on a private server. | ||
− | # | + | # Ensure that the developer console is enabled. |
− | |||
#* '''Option 1)''' | #* '''Option 1)''' | ||
+ | #* Start ''Team Fortress 2''. | ||
#* On the main menu, choose Options. | #* On the main menu, choose Options. | ||
#* On the Keyboard tab, click Advanced. | #* On the Keyboard tab, click Advanced. | ||
Line 107: | Line 114: | ||
#* Go to '''Properties'''. | #* Go to '''Properties'''. | ||
#* In a window that opens, press '''Set launch options'''. | #* In a window that opens, press '''Set launch options'''. | ||
− | #* Type in box the following: {{code|-console}} | + | #* Type in box the following: {{code|-console}}. |
#* Press '''OK''' and close '''Properties''' window. | #* Press '''OK''' and close '''Properties''' window. | ||
#* Console opens automatically when you start ''Team Fortress 2''. | #* Console opens automatically when you start ''Team Fortress 2''. | ||
+ | # Start Team Fortress 2. | ||
# Create a server. | # Create a server. | ||
#* On the main menu, click Create Server. | #* On the main menu, click Create Server. | ||
− | #* On the Server tab, choose any desired map such as ctf_2fort. | + | #* On the Server tab, choose any desired map, such as {{code|ctf_2fort.bsp}}. |
#* On the Game tab, set the Server password to prevent other players from joining during this test. | #* On the Game tab, set the Server password to prevent other players from joining during this test. | ||
#* Click Start. | #* Click Start. | ||
Line 118: | Line 126: | ||
#* Choose a team and character class as normal, such as a Blu Scout. | #* Choose a team and character class as normal, such as a Blu Scout. | ||
#* After spawning, open the developer console. The default key is ~ (tilde). | #* After spawning, open the developer console. The default key is ~ (tilde). | ||
− | #* On the console's command line, enter | + | #* On the console's command line, enter {{code|record demotest}}. This will record the demo to a file called {{code|demotest.dem}}. |
#* The game is now recording. | #* The game is now recording. | ||
#** Close the console. | #** Close the console. | ||
Line 126: | Line 134: | ||
# After recording for a suitable period of time, stop recording. | # After recording for a suitable period of time, stop recording. | ||
#* Open the console. | #* Open the console. | ||
− | #* On the command line, enter | + | #* On the command line, enter {{code|stop}}. ''Note: disconnecting from a game while recording a demo will also stop recording.'' |
#* The console will return the total time and frames recorded. | #* The console will return the total time and frames recorded. | ||
− | + | #* '''Option 3)''' | |
+ | #* As of the [[May 31, 2016 Patch]], you can set the game to record demos automatically, and configure it from the Advanced Options menu. | ||
===Playback Tutorial=== | ===Playback Tutorial=== | ||
− | [[ | + | [[File:Demo_tutorial_demoui.JPG|thumb|300 px|right|demoui interface]] |
− | [[ | + | [[File:Demo_tutorial_demoui2.JPG|thumb|300 px|right|demoui2 interface]] |
This procedure will load the demo recorded in the Recording tutorial. | This procedure will load the demo recorded in the Recording tutorial. | ||
− | # In the console, enter | + | # In the console, enter {{code|demoui}}. This opens a Demo Playback window. Pressing {{key|Shift}}+{{key|F2}} will also bring up this window. |
− | # Click Load in the Demo Playback window. This opens a file browser which defaults to | + | # Click Load in the Demo Playback window. This opens a file browser, which defaults to {{code|\Steam\SteamApps\common\team fortress 2\tf\}}. |
# Find ''demotest.dem'' and open it. | # Find ''demotest.dem'' and open it. | ||
# Playback will begin. | # Playback will begin. | ||
#* All characters in the recorded game will follow every instruction given during play. | #* All characters in the recorded game will follow every instruction given during play. | ||
− | #* The player's view will pan and shift as | + | #* The player's view will pan and shift as they did while recording. This includes viewpoints recorded during a respawn wait. The only way to override this by using the '''Drive''' function mentioned later. |
#* Each frame of the playback is a ''tick'', and the current tick and total ticks in the demo are shown in the demoui window. | #* Each frame of the playback is a ''tick'', and the current tick and total ticks in the demo are shown in the demoui window. | ||
#* Common Demoui controls: | #* Common Demoui controls: | ||
Line 147: | Line 156: | ||
#** '''Drive''' allows the viewer to use mouse and movement keys to change the perspective of the camera. It may appear counter-intuitive at first, so experimentation is suggested. | #** '''Drive''' allows the viewer to use mouse and movement keys to change the perspective of the camera. It may appear counter-intuitive at first, so experimentation is suggested. | ||
#** '''Goto''' jumps to the tick typed by the user into the text box to the right of the Goto button. | #** '''Goto''' jumps to the tick typed by the user into the text box to the right of the Goto button. | ||
− | #* There is also a | + | #* There is also a {{code|demoui2}} console command which opens a streamlined Demo Playback window. It does not feature some of the buttons found on the {{code|demoui}} version like Drive. |
===Movie Creation Tutorial=== | ===Movie Creation Tutorial=== | ||
− | The Source | + | The Source Engine can generate audio and video files based on a recorded demo. The output audio and video can then be processed through video-creation software. The following procedure will generate output called mymovie based on the demo file created in the Recording tutorial ''demotest.dem''. If you are making a High quality video for in use in a [[Machinima]] you can use [[ultra high settings]] for an added graphical boost |
− | [[ | + | [[File:Demo_tutorial_Startmovie.jpg|thumb|300 px|right|Console command: {{code|startmovie}}]] |
− | # In the console, enter | + | # In the console, enter {{code|startmovie mymovie}}. The game will prepare to save output to files starting with the name ''mymovie''. The user can choose any name here. |
# The console will return the message, "Started recording movie, frames will record after console is cleared...". The game is now ready to process the demo file. | # The console will return the message, "Started recording movie, frames will record after console is cleared...". The game is now ready to process the demo file. | ||
− | # In the console, enter | + | # In the console, enter {{code|playdemo demotest}}. The playdemo command plays a demo from start to finish without any other user intervention. |
− | #* The game will process the demo file. It will generate | + | #* The game will process the demo file. It will generate a TarGA (.tga) image file for each video frame and a Wave(.wav) sound file for the audio track in {{code|\Steam\SteamApps\common\team fortress 2\tf\}}. |
#* The following occurs during startmovie processing: | #* The following occurs during startmovie processing: | ||
− | #** Each frame of video is saved as a TarGA | + | #** Each frame of video is saved as a TarGA image file. The game will appear sluggish as this is occurring. The file size of each image file will vary on the game's current resolution. A 1024x768 resolution frame is approximately 2,300 kilobytes (2.3 MB per file). |
− | #** Stuttering audio or no audio will be heard. This is because startmovie will directly lift the audio track from the demo file. All processing power is utilized in converting the video. | + | #** Stuttering audio or no audio will be heard. This is because {{code|startmovie}} will directly lift the audio track from the demo file. All processing power is utilized in converting the video. |
#* When the end of the demo is reached, the console will reappear. | #* When the end of the demo is reached, the console will reappear. | ||
− | # In the console, enter | + | # In the console, enter {{code|endmovie}}. The console will return "Stopped recording movie..." |
− | # Exit Team Fortress 2 and navigate to | + | # Exit Team Fortress 2 and navigate to {{code|\Steam\SteamApps\common\team fortress 2\tf\}}. |
#* The Wave file is saved as mymovie.wav. | #* The Wave file is saved as mymovie.wav. | ||
#* The TarGA file names begin with "mymovie" and end with a frame number. The first image in the sequence will be a multiple of 10, such as 01000. | #* The TarGA file names begin with "mymovie" and end with a frame number. The first image in the sequence will be a multiple of 10, such as 01000. | ||
− | |||
These files can be combined into a single movie file by using software such as [http://www.virtualdub.org/ VirtualDub], a GNU-licensed video capture / processing utility. The following procedure builds on the prior examples in this article to merge the ''mymovie'' files into a movie file. | These files can be combined into a single movie file by using software such as [http://www.virtualdub.org/ VirtualDub], a GNU-licensed video capture / processing utility. The following procedure builds on the prior examples in this article to merge the ''mymovie'' files into a movie file. | ||
# Open VirtualDub. | # Open VirtualDub. | ||
− | # Choose | + | # Choose {{code|File > Open > Open video file...}} |
− | # Navigate to the folder Steam\SteamApps\ | + | # Navigate to the folder {{code|\Steam\SteamApps\common\team fortress 2\tf\}}. |
# Choose the first TarGA (.tga) file in the movie's sequence. | # Choose the first TarGA (.tga) file in the movie's sequence. | ||
#* Usually this is numbered similar to 01000; choose the file with the lowest number. Sorting by filename will help. | #* Usually this is numbered similar to 01000; choose the file with the lowest number. Sorting by filename will help. | ||
#* If the first file in the sequence is not chosen, the images will be loaded sequentially starting with the one chosen. | #* If the first file in the sequence is not chosen, the images will be loaded sequentially starting with the one chosen. | ||
− | # Go to | + | # Go to {{code|Video > Compression}}. A video codec can be chosen. The editor chose XviD MPEG-4 Codec. |
#* A discussion on different codec choices is beyond the scope of this article. The user may need to experiment with different codecs to find one that generates the desired output. | #* A discussion on different codec choices is beyond the scope of this article. The user may need to experiment with different codecs to find one that generates the desired output. | ||
#* Failing to choose a proper codec (i.e. leaving it set as Uncompressed RGB) may yield a movie file with an unreasonable size. | #* Failing to choose a proper codec (i.e. leaving it set as Uncompressed RGB) may yield a movie file with an unreasonable size. | ||
− | # Go to | + | # Go to {{code|Audio > WAV Audio...}}. Select the Wave (.wav) file with the matching name of the movie from {{code|\Steam\SteamApps\common\team fortress 2\tf\}}. |
− | # After setting the WAV Audio track, set | + | # After setting the WAV Audio track, set {{code|Audio > Full processing mode}}. This will enable audio compression. |
− | # Go to | + | # Go to {{code|Audio > Compression}}. The editor chose MPEG-Layer 3. |
− | # Go to | + | # Go to {{code|File > Save as [[Wikipedia:AVI|AVI]]...}} The user can specify a name for the output movie file. Specify a name and click OK. |
− | # VirtualDub will generate the movie file. | + | # VirtualDub will generate the movie file. ({{code|Close video file}} before attempting to view the result.) |
− | |||
− | |||
− | |||
− | |||
− | |||
Or you can directly make video file from TF2 using the following tutorial (taken from the steam community TF2 forums posted by Kuiper): | Or you can directly make video file from TF2 using the following tutorial (taken from the steam community TF2 forums posted by Kuiper): | ||
− | Here's how you can create a video using max graphics settings with constant | + | Here's how you can create a video using max graphics settings with constant framerate even if your hardware is low-end: |
− | If you haven't already done so, you need to record a demo of the gameplay that you want to create a video from. Do this by typing | + | If you haven't already done so, you need to record a demo of the gameplay that you want to create a video from. Do this by typing {{code|record [demoname]}} in the console while you are playing and {{code|stop}} when you are done. Once you have your demo file, follow these steps: |
# Load up TF2 using the settings that you want to show in the video. This includes screen resolution. If you are planning to upload to a low-quality Streaming site, I advise using 640x480 so that it will take less time to render and upload. If you're uploading an HD video to Youtube, use 1280x720. | # Load up TF2 using the settings that you want to show in the video. This includes screen resolution. If you are planning to upload to a low-quality Streaming site, I advise using 640x480 so that it will take less time to render and upload. If you're uploading an HD video to Youtube, use 1280x720. | ||
− | # Open up the console and enter the following commands: | + | # Open up the console and enter the following commands: {{code|sv_cheats 1}} and {{code|host_framerate 30}} (You can record at a higher framerate if you want a 60 FPS video for editing purposes, but most streaming sites use 30 fps. Youtube has recently added a function allowing the upload and playback of 60fps videos.) |
− | # Start playing the demo either via the console command | + | # Start playing the demo either via the console command {{code|playdemo [demoname]}} or the demo ui accessed via the command {{code|demoui}} or keyboard shortcut {{key|shift}}+{{key|f2}}. |
− | # When you get to the part of the demo that you want to record, type | + | # When you get to the part of the demo that you want to record, type {{code|startmovie [videofilename] h264}}. |
− | # You should get a pop-up window with a list of codecs to choose from. I recommend using the XviD codecs. If the list doesn't include the codecs you need, you may want to grab [http://www. | + | # You should get a pop-up window with a list of codecs to choose from. I recommend using the XviD codecs. If the list doesn't include the codecs you need, you may want to grab [http://www.cccp-project.net/ CCCP] or [http://www.codecguide.com/download_mega.htm K-Lite] (pick one, you can try the other if it's not working). |
# After you've begun recording the movie, allow the game to play out. The playback will be choppy and look buggy and the sound may loop or be completely muted. Don't worry, this is normal and the finished video will not look like this. Just allow the demo to play until it's gotten as far as you want to record. If you have a lower-end system or you're recording a rather lengthy video segment, this could take awhile, so you might want to find something else to do while the video renders. | # After you've begun recording the movie, allow the game to play out. The playback will be choppy and look buggy and the sound may loop or be completely muted. Don't worry, this is normal and the finished video will not look like this. Just allow the demo to play until it's gotten as far as you want to record. If you have a lower-end system or you're recording a rather lengthy video segment, this could take awhile, so you might want to find something else to do while the video renders. | ||
− | # Type | + | # Type {{code|endmovie}} in the console when you are done recording. |
− | # The resulting | + | # The resulting MOV file will not be located in your TF folder. It will be put in your "team fortress 2" folder with the name you required, e.g. {{code|\Steam\SteamApps\common\team fortress 2\mymovie.avi}}. |
− | # Now you can import the | + | # Now you can import the MOV into Windows Movie Maker or whatever program you use if you need to do any further editing. |
===Sharing Demo files=== | ===Sharing Demo files=== | ||
− | .DEM files created by the demo recorder can be shared with other users. | + | {{code|.DEM}} files created by the demo recorder can be shared with other users. |
* The other user must have the related game installed. | * The other user must have the related game installed. | ||
* The other user must have the map featured in the recording. The game will return an error if the demo tries to load a non-existent map file. | * The other user must have the map featured in the recording. The game will return an error if the demo tries to load a non-existent map file. | ||
− | * .DEM files exhibit good compression when processed by [[Wikipedia:File_archiver|file archival software]] such as [http://www.7-zip.org/ 7zip] or [http://www.rarlab.com/ WinRAR]. | + | * {{code|.DEM files}} exhibit good compression when processed by [[Wikipedia:File_archiver|file archival software]] such as [http://www.7-zip.org/ 7zip] or [http://www.rarlab.com/ WinRAR]. |
===Troubleshooting=== | ===Troubleshooting=== | ||
Line 216: | Line 219: | ||
==Additional Links== | ==Additional Links== | ||
− | * | + | * {{vdc|Demo Recording Tools}}. This page contains instructions for creating and manipulating demos in supported [[Wikipedia:Source_engine|Source]] games such as Team Fortress 2. It details additional functionality such as demo smoothing and customizing commands. |
− | |||
* [http://www.youtube.com/watch?v=l4MK_XJeNqA Source Record Tutorial]: A demonstration film posted to YouTube covering record, startmovie, and movie creation. | * [http://www.youtube.com/watch?v=l4MK_XJeNqA Source Record Tutorial]: A demonstration film posted to YouTube covering record, startmovie, and movie creation. | ||
− | |||
− | |||
== See also == | == See also == | ||
*[[Replay]] | *[[Replay]] |
Latest revision as of 12:32, 10 December 2023
|
“Gotta move that gear up!” This help may contain content that is out of date. You can help improve this help by updating the content as necessary. See the wiki style guide. Notes: None added |
Contents
Console commands
Command | Description |
---|---|
record <filename> | Starts recording a demo of the current gameplay under the specified filename. The demo will be saved as <filename>.dem in your game folder \Steam\SteamApps\common\team fortress 2\tf\ along with all its associated files.
|
stop | Stops recording the current demo |
demoui or demoui2 | Opens a small demo user interface which looks like a media player, but makes the opening and playing of demos much easier, including the capability to Fast Forward, Rewind and Skip to specific points in the demo. This can also be achieved by pressing Shift+F2 at any time. |
playdemo <filename> | Plays back a pre-recorded demo of name specified in <filename>. |
stopdemo | Stops playback of the currently playing demo. |
listdemo <demoname> | Provides details of the specified demo file. |
startmovie <filename> [avi/raw] | Starts recording movie frames, stored in your game folder \Steam\SteamApps\common\team fortress 2\tf\ as .tga files.
A recent feature to the PC version of the Source Engine is the ability to record directly to AVI by specifying |
endmovie | Stops recording movie frames. |
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 will be paused when tick is reached. |
demo_timescale <scale> | Set the demo playback speed as a factor, a scale of 1.0 is normal playback. |
ds_record | Start recording a demo manually. |
ds_stop | Stop recording a demo manually. |
ds_mark <comment> | Bookmark the current demo tick count for future reference. The <comment> is an optional descriptor you may include. |
ds_status | Report the current recording status. |
Basic Demo Recording
A demo recorded for Team Fortress 2 captures the following:
- Gameplay from the perspective of the player recording the demo
- All HUD elements including chat / console text messages
- Audio received by the player through the voice chat system
There are limitations to note when recording a demo:
- The demo relies upon the user having a copy of the map file related to the demo. The demo does not save a copy of the map that was played.
- The demo only records what was necessary to render audio and video for the player.
- The demo does not record the scoreboard at any time even if the player views it during recording.
- The player cannot externally view their own character during play unless they taunt or die. However, turning on
sv_cheats
during demo playback and using thethirdperson
console command works as normal. - Objects such as other players, buildings and weapons fire will not be visible beyond a certain distance from the player's current position if the player uses the Drive function in the Demo Playback window. The entire map is loaded but distant activity not in the player's line of sight may not be rendered at all times. Sprays are rendered at all times if the local cached spray still exists.
- The recorder does not capture the recording player's voice communication. It does record text messages in the game chat, however. (To record the player's voice,
voice_loopback 1
must be set in the console. This forces the player's voice to be played back in the audio output.) - If a server changes maps during a recording, the game will create a new demo file with the same name and an appended sequential number to avoid filename conflicts.
- A demo file cannot be started from within the operating system (e.g. double-clicking on it in Windows Explorer). A demo must be loaded from within the game by console command or demoui interface.
Recording Tutorial
This procedure will create a short demo on a private server.
- Ensure that the developer console is enabled.
- Option 1)
- Start Team Fortress 2.
- On the main menu, choose Options.
- On the Keyboard tab, click Advanced.
- Place a checkmark in Enable developer console.
- OR
- Option 2)
- In your Steam Library, click Team Fortress 2 with your MOUSE2.
- Go to Properties.
- In a window that opens, press Set launch options.
- Type in box the following:
-console
. - Press OK and close Properties window.
- Console opens automatically when you start Team Fortress 2.
- Start Team Fortress 2.
- Create a server.
- On the main menu, click Create Server.
- On the Server tab, choose any desired map, such as
ctf_2fort.bsp
. - On the Game tab, set the Server password to prevent other players from joining during this test.
- Click Start.
- Once the map loads, recording may begin.
- Choose a team and character class as normal, such as a Blu Scout.
- After spawning, open the developer console. The default key is ~ (tilde).
- On the console's command line, enter
record demotest
. This will record the demo to a file calleddemotest.dem
. - The game is now recording.
- Close the console.
- Walk outside of your spawn area and jump and move about.
- Use a taunt. While taunting, look at the character from different perspectives.
- If the character is a Soldier or Demoman, use explosives to suicide.
- After recording for a suitable period of time, stop recording.
- Open the console.
- On the command line, enter
stop
. Note: disconnecting from a game while recording a demo will also stop recording. - The console will return the total time and frames recorded.
- Option 3)
- As of the May 31, 2016 Patch, you can set the game to record demos automatically, and configure it from the Advanced Options menu.
Playback Tutorial
This procedure will load the demo recorded in the Recording tutorial.
- In the console, enter
demoui
. This opens a Demo Playback window. Pressing ⇧ Shift+F2 will also bring up this window. - Click Load in the Demo Playback window. This opens a file browser, which defaults to
\Steam\SteamApps\common\team fortress 2\tf\
. - Find demotest.dem and open it.
- Playback will begin.
- All characters in the recorded game will follow every instruction given during play.
- The player's view will pan and shift as they did while recording. This includes viewpoints recorded during a respawn wait. The only way to override this by using the Drive function mentioned later.
- Each frame of the playback is a tick, and the current tick and total ticks in the demo are shown in the demoui window.
- Common Demoui controls:
- Pause pauses playback
- Stop returns to the game main menu
- The Timescale slider control adjusts the timescale, or playback speed. 100% is normal speed. 200% plays the demo twice as fast.
- Drive allows the viewer to use mouse and movement keys to change the perspective of the camera. It may appear counter-intuitive at first, so experimentation is suggested.
- Goto jumps to the tick typed by the user into the text box to the right of the Goto button.
- There is also a
demoui2
console command which opens a streamlined Demo Playback window. It does not feature some of the buttons found on thedemoui
version like Drive.
Movie Creation Tutorial
The Source Engine can generate audio and video files based on a recorded demo. The output audio and video can then be processed through video-creation software. The following procedure will generate output called mymovie based on the demo file created in the Recording tutorial demotest.dem. If you are making a High quality video for in use in a Machinima you can use ultra high settings for an added graphical boost
- In the console, enter
startmovie mymovie
. The game will prepare to save output to files starting with the name mymovie. The user can choose any name here. - The console will return the message, "Started recording movie, frames will record after console is cleared...". The game is now ready to process the demo file.
- In the console, enter
playdemo demotest
. The playdemo command plays a demo from start to finish without any other user intervention.- The game will process the demo file. It will generate a TarGA (.tga) image file for each video frame and a Wave(.wav) sound file for the audio track in
\Steam\SteamApps\common\team fortress 2\tf\
. - The following occurs during startmovie processing:
- Each frame of video is saved as a TarGA image file. The game will appear sluggish as this is occurring. The file size of each image file will vary on the game's current resolution. A 1024x768 resolution frame is approximately 2,300 kilobytes (2.3 MB per file).
- Stuttering audio or no audio will be heard. This is because
startmovie
will directly lift the audio track from the demo file. All processing power is utilized in converting the video.
- When the end of the demo is reached, the console will reappear.
- The game will process the demo file. It will generate a TarGA (.tga) image file for each video frame and a Wave(.wav) sound file for the audio track in
- In the console, enter
endmovie
. The console will return "Stopped recording movie..." - Exit Team Fortress 2 and navigate to
\Steam\SteamApps\common\team fortress 2\tf\
.- The Wave file is saved as mymovie.wav.
- The TarGA file names begin with "mymovie" and end with a frame number. The first image in the sequence will be a multiple of 10, such as 01000.
These files can be combined into a single movie file by using software such as VirtualDub, a GNU-licensed video capture / processing utility. The following procedure builds on the prior examples in this article to merge the mymovie files into a movie file.
- Open VirtualDub.
- Choose
File > Open > Open video file...
- Navigate to the folder
\Steam\SteamApps\common\team fortress 2\tf\
. - Choose the first TarGA (.tga) file in the movie's sequence.
- Usually this is numbered similar to 01000; choose the file with the lowest number. Sorting by filename will help.
- If the first file in the sequence is not chosen, the images will be loaded sequentially starting with the one chosen.
- Go to
Video > Compression
. A video codec can be chosen. The editor chose XviD MPEG-4 Codec.- A discussion on different codec choices is beyond the scope of this article. The user may need to experiment with different codecs to find one that generates the desired output.
- Failing to choose a proper codec (i.e. leaving it set as Uncompressed RGB) may yield a movie file with an unreasonable size.
- Go to
Audio > WAV Audio...
. Select the Wave (.wav) file with the matching name of the movie from\Steam\SteamApps\common\team fortress 2\tf\
. - After setting the WAV Audio track, set
Audio > Full processing mode
. This will enable audio compression. - Go to
Audio > Compression
. The editor chose MPEG-Layer 3. - Go to
File > Save as AVI...
The user can specify a name for the output movie file. Specify a name and click OK. - VirtualDub will generate the movie file. (
Close video file
before attempting to view the result.)
Or you can directly make video file from TF2 using the following tutorial (taken from the steam community TF2 forums posted by Kuiper):
Here's how you can create a video using max graphics settings with constant framerate even if your hardware is low-end:
If you haven't already done so, you need to record a demo of the gameplay that you want to create a video from. Do this by typing record [demoname]
in the console while you are playing and stop
when you are done. Once you have your demo file, follow these steps:
- Load up TF2 using the settings that you want to show in the video. This includes screen resolution. If you are planning to upload to a low-quality Streaming site, I advise using 640x480 so that it will take less time to render and upload. If you're uploading an HD video to Youtube, use 1280x720.
- Open up the console and enter the following commands:
sv_cheats 1
andhost_framerate 30
(You can record at a higher framerate if you want a 60 FPS video for editing purposes, but most streaming sites use 30 fps. Youtube has recently added a function allowing the upload and playback of 60fps videos.) - Start playing the demo either via the console command
playdemo [demoname]
or the demo ui accessed via the commanddemoui
or keyboard shortcut ⇧ Shift+f2. - When you get to the part of the demo that you want to record, type
startmovie [videofilename] h264
. - You should get a pop-up window with a list of codecs to choose from. I recommend using the XviD codecs. If the list doesn't include the codecs you need, you may want to grab CCCP or K-Lite (pick one, you can try the other if it's not working).
- After you've begun recording the movie, allow the game to play out. The playback will be choppy and look buggy and the sound may loop or be completely muted. Don't worry, this is normal and the finished video will not look like this. Just allow the demo to play until it's gotten as far as you want to record. If you have a lower-end system or you're recording a rather lengthy video segment, this could take awhile, so you might want to find something else to do while the video renders.
- Type
endmovie
in the console when you are done recording. - The resulting MOV file will not be located in your TF folder. It will be put in your "team fortress 2" folder with the name you required, e.g.
\Steam\SteamApps\common\team fortress 2\mymovie.avi
. - Now you can import the MOV into Windows Movie Maker or whatever program you use if you need to do any further editing.
Sharing Demo files
.DEM
files created by the demo recorder can be shared with other users.
- The other user must have the related game installed.
- The other user must have the map featured in the recording. The game will return an error if the demo tries to load a non-existent map file.
.DEM files
exhibit good compression when processed by file archival software such as 7zip or WinRAR.
Troubleshooting
- If the error "Unreliable snapshot error" is returned when loading a demo file, the user should try to load the demo file again.
- If an error regarding a missing map file is returned, the user must download the proper version of the map upon which the the demo recording took place and try again.
- There is a known issue of certain Team Fortress 2 patches, such as the April 29 Goldrush / Medic update, which makes demos recorded before that point unplayable. There is no known solution to this issue.
- Screen shots and recorded frames will appear black when Multi-Core support is enabled. Turning off this feature should fix the problem.
Additional Links
- Demo Recording Tools on the Valve Developer Community. This page contains instructions for creating and manipulating demos in supported Source games such as Team Fortress 2. It details additional functionality such as demo smoothing and customizing commands.
- Source Record Tutorial: A demonstration film posted to YouTube covering record, startmovie, and movie creation.