# Norge Replay

## Usage

    NorgeReplay.exe
    NorgeReplay.exe --help

No command-line arguments are required. The application launches a graphical window.

## Description

Norge Replay downloads and plays tournament ski jumping videos recorded by the Video Distance Marking system. It connects to the tournament server at `thehansens.com`, lets you browse recorded videos by date, caches them locally for instant replay, and launches the file viewer for playback with distance measurement grid lines.

## Getting Started

### Step 1 — Launch

Double-click `NorgeReplay.exe`. It automatically creates local cache folders and connects to the tournament server to fetch available dates. The status bar at the bottom shows progress.

### Step 2 — Select a Date

Use the Date dropdown to pick a tournament date. The list shows all dates that have recorded videos, with the most recent date first. The corresponding settings file is downloaded automatically.

### Step 3 — Choose a Video

The Video dropdown lists all clips for that date. Each entry shows a cache indicator:

Prefix | Meaning
--- | ---
`[+]` | Video is already cached locally — instant playback
`[ ]` | Video needs to be downloaded before playing

### Step 4 — Play

Click the Play button. If the video is not yet cached, it will be downloaded first (progress shown in the status bar). The file viewer then opens with the video and its matching settings file for grid line calibration.

## Buttons

Button | Action
--- | ---
Load Cache | Downloads all videos for the selected date at once. The status bar shows progress as each file is downloaded. Once complete, all entries show `[+]` for instant playback.
Play | Downloads the selected video (if needed) and opens it in the file viewer with the correct settings for that date.
Help | Opens this help page in the default web browser.
Exit | Closes Norge Replay. Any file viewers already launched remain open.

## Keyboard Shortcuts

Key | Action
--- | ---
`F1` | Open this help page

## Local Cache

Norge Replay stores downloaded files in a `cache` folder in the current working directory (typically next to the executable). Videos only need to be downloaded once — subsequent plays load instantly from disk.

    cache/
      settings/
        settings.txt.20260201
        settings.txt.20260315
        ...
      videos/
        02-01-2026/
          2026-02-01_14-30-22.315.139.026.mp4
          ...
        03-15-2026/
          ...

Tip: To free disk space, you can safely delete the entire `cache` folder or individual date folders within `cache\videos\`. They will be re-downloaded as needed.

## Video Filename Format

Each video filename encodes metadata about the jump:

    YYYY-MM-DD_HH-MM-SS.<total_frames>.<feed2_start>.<jumper_no>.mp4

Field | Description
--- | ---
`YYYY-MM-DD_HH-MM-SS` | Date and time of the recording
`total_frames` | Total number of frames in the video
`feed2_start` | Frame where the bottom half switches from feed 0 to feed 2
`jumper_no` | Jumper number assigned in the controller

## Network Requirements

- Internet connection required for downloading videos from `thehansens.com`
- Videos range from a few MB to 30+ MB depending on jump duration
- Settings files are small (< 50 KB each)
- Use Load Cache to pre-download all videos for a date

## Requirements

- Windows 10 or later
- `fileviewer.exe` and `SDL3.dll` in the same directory
- `NorgeLogo.png` in the same directory (optional, for logo display)
- `numbers.txt` in the same directory (used by file viewer for text overlay)

## Troubleshooting

### Norton Antivirus blocks or deletes the programs

Norton may flag `NorgeReplay.exe` or `fileviewer.exe` as suspicious because they are not digitally signed. Norton can quarantine or delete the files without warning. To prevent this, add the installation folder as an exclusion:

1. Open Norton Security (or Norton 360)
2. Click Settings (gear icon)
3. Select Antivirus
4. Click the Scans and Risks tab
5. Scroll down to Exclusions / Low Risks
6. Under Items to Exclude from Scans, click Configure → Add Folders → browse to the folder containing `NorgeReplay.exe`, or type the path directly:
   `C:\Users\{USERID}\AppData\Local\Programs\NorgeReplay\*`
   Replace `{USERID}` with your Windows username. For example, for the user david:
   `C:\Users\david\AppData\Local\Programs\NorgeReplay\*`
7. Under Items to Exclude from Auto-Protect, SONAR, and Download Intelligence Detection, click Configure and add the same path
8. Click OK to save

If Norton has already quarantined the files, open Norton Security → Security History, find the quarantined items, choose Restore, and then add the exclusion before running the programs again.

### Cannot connect to server

If you see a "Network Error" dialog, check your internet connection and verify that `thehansens.com` is reachable. The full URL that failed is shown in the error message.

### File viewer does not open

Make sure `fileviewer.exe` is in the same directory as `NorgeReplay.exe`. The error dialog shows the Windows error code if the launch fails.

### Videos play but have no grid lines

Grid lines require a settings file with calibrated anchor points for each camera feed. The settings file is downloaded automatically when you select a date. If the grid lines are missing, the settings may not have been calibrated for that date yet.

Note: Large video files may take a minute or more to download depending on your connection speed. The status bar shows which file is currently downloading. Use the Load Cache button to download all videos for a date while you step away.

## See Also

- File Viewer — the video player launched by Norge Replay
- Grid Line Calibration — how distance measurement works
- Viewer — live viewer from shared memory