Skip to main content

XAppCaptureRecordTimespan

Makes a GameDVR recording. There is no UI to indicate that such a recording is being made. The user does not have access to the recording. At most 2 such recordings can be made at any given time. Once 2 recordings are made, XAppCaptureCloseLocalStream will need to be called to close & delete a recording before another recording can be made. This can be used to capture past or future activity.

Syntax

Parameters

startTimestamp _In_opt_
Type: const SYSTEMTIME *
The timestamp to start recording from. This parameter can be null, in which case the system will automatically calculate the start time as durationInMilliseconds in the past and the recording will contain past activities. durationInMilliseconds _In_
Type: uint64_t
Length of recording in milliseconds. result _Out_
Type: XAppCaptureLocalResult *
On function completion, contains the capture results. See XAppCaptureReadLocalStream for how the resulting recording can be read.

Return value

Type: HRESULT Function result. The function will return E_ACCESSDENIED if the user’s GameDVR setting forbids games from making captures.

Remarks

There are two ways to pass in the startTimestamp parameter to record past activity. In the first, null is passed. The system will automatically calculate the timestamp and record past activities that are durationInMilliseconds long from now.
Older clips will be deleted when allotted space is filled to make room for new clips. Use PLS (Persistent Local Storage), connected storage (e.g. XGameSave or XGameSaveFiles), or a similar storage system in order to retain clips for a set period of time.
In the second, you must calculate your desired start timestamp by converting SYSTEMTIME or FILETIME to ULARGE_INTEGER, doing the required arithmetic, then converting ULARGE_INTEGER back to SYSTEMTIME.
XAppCaptureRecordTimespan can also be used to record the next durationInMilliseconds milliseconds of activity by specifying startTimestamp as the current system time.
See XAppCaptureLocalResult and XAppCaptureReadLocalStream

Requirements

Header: XAppCapture.h Library: xgameruntime.lib Supported platforms: XBOX One family consoles and XBOX Series consoles

See also

XAppCapture members
Last modified on August 20, 2026