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

# Highlights

> Automatically generate highlight reels from your session recordings with AI

Segra can automatically create highlight reels from your full session recordings by detecting important moments like kills, deaths, goals, and other game events.

## How Highlights Work

Highlights are created from **bookmarks** in your session recordings:

<Steps>
  <Step title="Record a session">
    Highlights only work with **Session** or **Hybrid** recording modes. Replay Buffer mode doesn't support highlights.
  </Step>

  <Step title="Bookmarks are created">
    During gameplay, Segra automatically creates bookmarks for important events (kills, goals, assists) using per-game integrations.
  </Step>

  <Step title="Generate highlight">
    After the session, click **Create Highlight** to generate a compilation of your best moments.
  </Step>

  <Step title="Review and share">
    The highlight reel is saved to the Highlights section, ready to watch or share.
  </Step>
</Steps>

## Bookmark Types

Segra creates different types of bookmarks during gameplay:

### Manual Bookmarks

**Press F8** during gameplay to create a manual bookmark at the current moment.

* Useful for marking clutch plays, funny moments, or anything you want to remember
* Manual bookmarks are **not included** in auto-generated highlights, but they appear on the timeline so you can find them quickly when clipping by hand
* You can change the keybinding in **Settings > Keybindings**

### Automatic Bookmarks

Segra automatically creates bookmarks for game events:

#### Kill

When you eliminate an opponent:

* **Included in highlights** by default
* Works across the supported game integrations (see [Game Integration](/configuration/game-integration))

#### Death

When you are eliminated:

* **Not included in highlights** (usually not a highlight-worthy moment)
* Still visible on the timeline for review
* Useful for analyzing mistakes

#### Goal

When you score (Rocket League):

* **Included in highlights**
* Auto-detected via game integration

#### Assist

When you assist a teammate:

* **Not included in highlights** by default
* Still visible on the timeline for review

<Info>
  You can see which bookmark types are included in highlights by the `[IncludeInHighlight]` attribute in the source code. Currently, only **Kill** and **Goal** bookmarks are auto-included. **Manual**, **Death**, and **Assist** bookmarks appear on the timeline but are not added to auto-generated highlights.
</Info>

## Creating Highlights

### From Session Recordings

<Steps>
  <Step title="Open Sessions page">
    Navigate to the **Sessions** tab in Segra.
  </Step>

  <Step title="Select a session">
    Click on any session recording that has bookmarks.
  </Step>

  <Step title="Click Create Highlight">
    Look for the **Create Highlight** button (usually in the video controls).
  </Step>

  <Step title="Wait for processing">
    Segra extracts clips around each bookmark and combines them into a highlight reel.
  </Step>
</Steps>

### Automatic Highlight Generation

Enable **Auto-Generate Highlights After Recording** in **Settings > Highlights** (requires **Enable Highlights** to be turned on):

* Segra automatically creates a highlight reel after each session recording
* Only creates highlights if the session has highlight-worthy bookmarks (Kill or Goal)
* Saves processing time by running in the background

<Warning>
  Auto-generated highlights can use significant storage space if you play many games. Monitor your storage usage in **Settings > Storage**.
</Warning>

## Highlight Algorithm

Segra uses a smart algorithm to create engaging highlights:

### Time Window

By default, each bookmark gets a **4-second window** before and after (configurable from 1–60 seconds in **Settings > Highlights**):

* **4 seconds before** - Provides context for what led to the moment
* **4 seconds after** - Captures the result and immediate aftermath
* Total of **8 seconds per bookmark** at the default padding

### Segment Merging

Overlapping segments are automatically merged:

* Whenever two bookmarks' padding windows overlap (8 seconds total at the default 4s/4s padding), they're combined into one continuous clip
* Prevents choppy transitions and duplicate footage
* Results in smoother, more watchable highlights

For example:

* Kill at 1:00 → Clip from 0:56 to 1:04
* Kill at 1:02 → Clip from 0:58 to 1:06
* **Merged result:** One clip from 0:56 to 1:06

### Fast Processing

Highlights use **stream copy** technology:

* Segments are extracted without re-encoding
* Processing is extremely fast (seconds instead of minutes)
* Original video quality is preserved
* No generational quality loss

## Game Integrations

Segra has built-in integrations for popular games to automatically detect events:

### Counter-Strike 2

* **Kills**
* **Deaths**

Integration listens for CS2 Game State Integration (GSI) events on a local HTTP endpoint.

### League of Legends

* **Kills**
* **Assists**
* **Deaths**

Integration polls the League Live Client Data API (`https://127.0.0.1:2999/liveclientdata`) every 250ms.

### PUBG

* **Kills**
* **Deaths**

Integration parses local PUBG replay files written to `%LocalAppData%/TslGame/Saved/Demos` after each match.

### Rocket League

* **Goals**
* **Assists**

Integration uses on-screen OCR to recognize goal and assist banners in real time.

### Dota 2

* **Kills**
* **Deaths**
* **Assists**

Integration uses Dota 2's Game State Integration (GSI) on a local HTTP listener at `http://127.0.0.1:1341/`.

### Minecraft

* **Deaths**

Integration tails the Minecraft **Java** `latest.log` (vanilla and Lunar Client). Bedrock Edition is not supported.

### Rust

* **Deaths**

Integration tails `output_log.txt` next to the Rust executable for the `You died` marker.

### RuneScape: Dragonwilds

* **Deaths**

Integration tails `%LocalAppData%/RSDragonwilds/Saved/Logs/RSDragonwilds.log` for the death-state transition.

### War Thunder

* **Kills**
* **Deaths**

Integration polls War Thunder's local HUD message endpoint at `http://127.0.0.1:8111/hudmsg` to detect events in real time. The local `.clog` combat log is read only to extract the player's nickname.

### Grand Theft Auto

* **Deaths**

Integration uses on-screen OCR to detect the `WASTED` notification and bookmark the death. Supports GTA V / Online and Rage Multiplayer.

<Tip>
  Enable or disable specific game integrations in **Settings > Game Integrations**. This can help reduce false positives or improve performance. Per-game details (events, kill/death lists) for the newer integrations may be incomplete and are continuing to be documented.
</Tip>

## Highlight Generation

Segra's automatic highlight generation works from bookmarks that have already been recorded — either manual (F8) or events emitted by a supported game integration.

### How It Works

1. **Bookmark collection** - The recorder gathers all bookmarks attached to the session
2. **Filtering** - Only bookmark types tagged with `[IncludeInHighlight]` (currently `Kill` and `Goal`) become highlight segments
3. **Padding & merging** - Each bookmark is expanded by the configured padding (default 4s before / 4s after); overlapping windows are merged into one continuous clip
4. **Stream-copy export** - Segments are extracted without re-encoding and concatenated into a single MP4

### Enabling Highlights

In **Settings > Highlights**:

* Toggle **Enable Highlights** to allow highlight generation for this session and to surface AI-related options
* Toggle **Auto-Generate Highlights After Recording** to run highlight generation in the background as each session ends
* Adjust **Highlight padding (before/after)** to change how much context is included around each bookmark

<Note>
  Manual bookmarks (F8) are always the most reliable way to mark moments — they're recorded in real time and don't depend on a game integration being active.
</Note>

### Improving Results

To get better highlights:

* Add manual bookmarks (F8) for moments your supported game doesn't tag automatically
* Enable per-game integrations under **Settings > Game Integrations** for the titles you play
* Tune the padding sliders so each highlight gets enough lead-up and reaction time

## Highlight Output

Generated highlights are saved to the **Highlights** folder:

```
Segra/
└── Highlights/
    ├── Counter-Strike 2/
    │   └── 2024-01-15_14-30-45.mp4
    ├── League of Legends/
    │   └── 2024-01-15_15-22-10.mp4
    └── Rocket League/
        └── 2024-01-16_18-45-33.mp4
```

Each highlight includes:

* **Video file** - MP4 with all highlight segments
* **Metadata** - Game, source session, bookmarks included
* **Thumbnail** - Preview image
* **Waveform** - Audio visualization

### Highlight Length

Highlight duration depends on the number of bookmarks:

* **Few bookmarks** (1-5): 8-40 second highlight
* **Many bookmarks** (10+): 1-3 minute highlight
* **Dense action** (20+): 3-5 minute highlight

Segra automatically merges overlapping segments, so actual duration may be shorter than total bookmark count × 8 seconds.

## Editing Highlights

### Create Custom Clips

You can create custom clips from highlight videos:

1. Open a highlight in the video player
2. Use the timeline to select specific moments
3. Click **Create Clip** to extract just those segments

This is useful for creating ultra-short clips (15-30 seconds) for social media.

### Re-generate Highlights

If you manually add or remove bookmarks from a session:

1. Open the session recording
2. Add/remove bookmarks as needed
3. Click **Create Highlight** again
4. Segra re-generates the highlight with the updated bookmarks

### Delete Unwanted Highlights

Right-click any highlight and select **Delete** to remove it. This frees up storage space.

## Troubleshooting

<AccordionGroup>
  <Accordion title="No highlights generated">
    * Check that your session has highlight-worthy bookmarks (Kill or Goal)
    * Verify **Auto-Generate Highlights After Recording** is enabled in **Settings > Highlights**
    * Manual, Death, and Assist bookmarks are **not** auto-included in highlights
    * Try manually creating a highlight from the session page
  </Accordion>

  <Accordion title="Missing important moments">
    * Use **manual bookmarks (F8)** during gameplay to mark moments
    * Check that the relevant game integration is enabled in **Settings > Game Integrations**
    * Some events may not be detected if the game is minimized or alt-tabbed
  </Accordion>

  <Accordion title="Too many false positives">
    * Disable specific game integrations that are producing errors
    * Manually review and delete unwanted bookmarks before generating highlights
  </Accordion>

  <Accordion title="Highlight is too long">
    * Manually delete some bookmarks from the session before regenerating
    * Create a custom clip from the highlight with only your best moments
    * Adjust the bookmark types included (future feature)
  </Accordion>

  <Accordion title="Highlight quality is poor">
    * Highlights use stream copy and preserve original recording quality
    * Improve your recording quality settings in **Settings > Video**
    * Ensure your source session was recorded at good quality
  </Accordion>
</AccordionGroup>

## Best Practices

<CardGroup cols={2}>
  <Card title="Use manual bookmarks" icon="bookmark">
    Press F8 during gameplay to mark your best moments. This ensures they're included in highlights even if AI misses them.
  </Card>

  <Card title="Review before sharing" icon="eye">
    Always watch your generated highlights before sharing. Remove any segments that don't fit.
  </Card>

  <Card title="Clean up bookmarks" icon="broom">
    Delete unwanted bookmarks from sessions before generating highlights to keep them concise.
  </Card>

  <Card title="Combine with clipping" icon="scissors">
    Create highlights first, then make ultra-short clips from the highlight for social media.
  </Card>
</CardGroup>

## Performance Tips

* **Highlight generation** is very fast due to stream copy (usually under 10 seconds)
* Highlight processing runs in the background while you keep recording
* Multiple highlights can be generated simultaneously
* Storage usage scales with the number of bookmarks (more bookmarks = longer highlights)

## Related Features

* [Recording](/features/recording) - Capture gameplay sessions with bookmarks
* [Clipping](/features/clipping) - Create custom clips from highlights
* [Uploads](/features/uploads) - Share highlights online
