> For the complete documentation index, see [llms.txt](https://yall.yassrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yall.yassrobotics.com/documentation/how-to-guides/how-do-i-take-snapshots-and-rewind-captures.md).

# How do I take snapshots and rewind captures?

## Snapshots (all hardware)

Asynchronously requests the Limelight to save a still image, without blocking the robot loop:

```java
limelight.snapshot("auto-align-attempt");
```

Pass `null` or `""` to let the Limelight auto-name the snapshot. This runs on a background thread via `CompletableFuture`, so it's safe to call from a periodic loop, though it's typically triggered from a button or a one-shot event rather than every cycle.

## Rewind capture (supported hardware only)

Rewind saves a rolling video buffer you can flush to disk on demand, useful for post-match diagnosis of a missed vision read. Enable recording, then trigger a capture:

```java
limelight.getSettings().withRewindEnable(RewindState.ENABLED).save();

// Later, e.g. bound to a driver button after a suspicious auto-align:
limelight.rewindCapture(10); // capture the last 10 seconds, max 165
```

Capture requests are rate-limited to once every 2 seconds on the Limelight and are dropped if a flush is already in progress.

## Checking rewind buffer status

```java
limelight.getLatestResults().ifPresent(result -> {
    if (result.rewindStats != null) {
        boolean isFull = result.rewindStats.bufferUsage >= 1.0;
        double secondsStored = result.rewindStats.storedSeconds;
    }
});
```

## See Also

* Limelight#rewindCapture
* RewindStats reference


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://yall.yassrobotics.com/documentation/how-to-guides/how-do-i-take-snapshots-and-rewind-captures.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
