> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Long duration game captures (wdcapturesession.exe)

> Long duration game captures (wdcapturesession.exe)

Use this tool to start and stop captures of your game and save the file to the console scratch drive (for example, `xd:\clips\file.mp4`).

<Note>
  You can also use the [XBOX Manager](/tools/tools-console/xbom/xbom) tool to capture video and save to your local PC.
</Note>

| Command                          | Description                                                                                                                        |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [start](#wdcapturesession_start) | Starts a capture session.                                                                                                          |
| [stop]()                         | Stops a capture session and completes writing the file to disk. The command is called automatically if low disk space is detected. |

<a id="wdcapturesession_start" />

## wdcapturesession start

Starts a capture session and saves it to the scratch drive in MP4 file format.

`FilePath` is an optional parameter where the path defaults to `d:\clips\sessionvideo_[timestamp].mp4`. `FilePath` requires an MP4 extension in the name. If you don't specify a path, the file is written to the `d:\clips` path.

`Max duration in seconds` is optional and defaults to 3,600 seconds.

Calling `start` while an active session is being captured returns the error "Error: Cannot start session capture, Recording in Progress" (0x8C111120).

`wdcapturesession start /f:<filepath> /d:<maxduration in seconds> /autostop`

| Option     | Description                                                                                                                                             |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `f`        | The path and name of the output file                                                                                                                    |
| `d`        | Specifies that the max duration (seconds) of the session capture. Defaults to 3600.                                                                     |
| `autostop` | Automatically stops the capture session when the game title exits. This flag is optional and only applies to the console version of `wdcapturesession`. |

<a id="wdcapturesession_stop" />

## wdcapturesession stop

Stops a capture session and completes writing the file to disk. Will be called automatically if low disk space is detected.

`wdcapturesession stop `

## Using Real-time Messaging Protocol (RTMP) with wdcapturesession

RTMP is an audio/video streaming protocol that's suitable for archival purposes, such as running tests and for live streaming.

<Note>
  RTMP doesn't support encryption. Don't use it to transmit confidential information over the public internet.
</Note>

For example, a suitable command might be `wdcapturesession start /f:rtmp://servername/live/streamname`.

Similar to the existing scenarios, `wdcapturesession stop` stops the streaming session, publishes the stream, and then closes the connection to the server.  This feature is restricted to devkits.

RTMP has the following limitations:

* A default maximum time limit of 1 hour (3,600 seconds). Use the `/d:` option if you want a longer recording.
* Video is sent in H264 format at HD resolution, 30 fps, around 5 Mbps.
* Audio is sent as AAC stereo audio.

Support is limited to unencrypted connections, so share confidential content only on internal networks. This feature works with Google Cloud Service, nginx-rtmp, and YouTube RTMP servers.

For example, `YouTube` requires this option to switch from the default to `"live"` publishing mode when receiving output from `wdcapturesession`.

A suitable URL might be `rtmp://servername/live/streamkey?publishmode=live`.

## See also

[Console Command-line tools](/tools/tools-console/console_commandlinetools/consolecommandlinetools)

[XTF transport errors](/tools/tools-console/commandlinetools/xtf-transport-errors)


## Related topics

- [Console-based command-line tools](/tools/tools-console/console_commandlinetools/consolecommandlinetools.md)
- [Video Capture (wdcapturesession.exe)](/tools/tools-pc/commandlinetools/gr-wdcapturesession.md)
- [Command-line tools for PC development](/tools/tools-pc/commandlinetools/gr-commandlinetools-toc.md)
- [Commandlinetools](/tools/tools-pc/commandlinetools/index.md)
- [Screen-capture tool (wdcapture.exe)](/tools/tools-console/console_commandlinetools/wdcapture.md)
