# File Viewer

## Usage

    fileviewer.exe [video_file_or_url] [settings_file]
    fileviewer.exe --help

Argument | Description
--- | ---
`video_file_or_url` | Path to a local video file, or an http/https URL to download
`settings_file` | Path to settings.txt (optional; auto-downloaded for URLs)

## Description

The file viewer loads video from disk files or web downloads rather than shared memory. It decodes all frames into a local buffer for instant random-access navigation. It provides the same grid line overlay and distance measurement as the live viewer, making it useful for:

- Reviewing saved competition clips after the event
- Measuring distances on archived footage
- Grid line calibration from reference recordings

## Opening Files

### From the command line

    # Local file
    fileviewer.exe videos\jump_001.mp4

    # Local file with specific settings
    fileviewer.exe videos\jump_001.mp4 my_settings.txt

    # Download from web
    fileviewer.exe https://www.thehansens.com/tournament/jump_001.mp4

### File-open dialog

If no argument is given, the file viewer presents a standard Windows file-open dialog where you can browse for a video file.

### Web download

When given a URL, the file viewer downloads the video file to a temporary directory. It also attempts to download a companion `settings.txt` from the same web directory, so that grid line calibration data is available for distance measurement.

## Supported Formats

- MP4, AVI, MKV, MOV — decoded via Media Foundation
- Raw YUV420 (.yuv420, .i420) — planar 1920×1080
- Raw YUV422 (.yuv422, .yuyv) — packed YUYV 1920×1080

## Controls

Same as the live viewer:

Key | Action
--- | ---
`Right Arrow` | Step forward 1 frame
`Left Arrow` | Step back 1 frame
`Down Arrow` | Step forward 7 frames (Shift: 15 frames)
`Up Arrow` | Step back 7 frames (Shift: 15 frames)
`Page Down` | Jump forward 25 frames
`Page Up` | Jump back 25 frames
`1` | Toggle main grid lines
`2` | Toggle sub-meter grid lines
`F1` | Open help documentation
`ESC` or `Q` | Quit

Mouse Action | Effect
--- | ---
Move cursor | Distance readout updates at cursor position
Hold right button + move left/right | Fast navigation through the video at 3× speed; move mouse left to go backward, right to go forward
Hold right button + Shift + move left/right | Extra-fast navigation at 6× speed
Scroll wheel | Step forward or backward one frame at a time

## Frame Counter

The current frame number and total frame count are displayed in the top-right corner of the video (e.g., "42/520").

## Memory Usage

The file viewer loads up to 2000 frames into memory (~4.6 GB). Longer videos are truncated at 2000 frames (~33 seconds at 60fps).

## Troubleshooting

### Norton Antivirus blocks or deletes fileviewer.exe

Norton may flag `fileviewer.exe` as suspicious because it is not digitally signed. Norton can quarantine or delete the file without warning. To prevent this:

1. Open Norton Security (or Norton 360)
2. Click Settings (gear icon) → Antivirus → Scans and Risks
3. Under Exclusions / Low Risks:
   - Items to Exclude from Scans → Configure → Add Folders → select the folder containing `fileviewer.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\*`
   - Items to Exclude from Auto-Protect, SONAR, and Download Intelligence Detection → Configure → add the same path
4. Click OK to save

If Norton has already quarantined the file, open Norton Security → Security History, find the quarantined item, choose Restore, and then add the exclusion.

## See Also

- Viewer — live version from shared memory
- Testing with Video Files
- Grid Line Calibration