﻿================================================================================
 VideoDistanceMarking (VDM) - Installation Package
================================================================================

 Version:      1.2.1
 Built:        2026-08-16 00:56:01
 Source commit: f30697b2c9b9ea99d668ba93ac49a573fbc6d618

--------------------------------------------------------------------------------
 WHAT THIS IS
--------------------------------------------------------------------------------

VDM measures ski jump landing distances from live HDMI camera feeds.  It
captures up to three feeds, detects the jumper by frame-differencing
motion, encodes the jump to video with distance gridlines burned in, and
serves the result to a viewer where an official marks the landing point.

This package is everything needed to set the system up on a NEW Windows
laptop: the compiled binaries, their runtime libraries, the current tuned
configuration, and the documentation.

Everything here is self-contained.  No internet access, compiler, or
source checkout is required to install.


--------------------------------------------------------------------------------
 INSTALL - THE ONE LINE
--------------------------------------------------------------------------------

Open PowerShell in this directory and run:

    powershell -ExecutionPolicy Bypass -File .\Install-VDM.ps1

That installs to C:\VDM.  To install elsewhere:

    powershell -ExecutionPolicy Bypass -File .\Install-VDM.ps1 -InstallRoot D:\VDM

To see exactly what would happen without writing anything:

    powershell -ExecutionPolicy Bypass -File .\Install-VDM.ps1 -WhatIf

Administrator rights are NOT required for the default C:\VDM target.
Nothing is written to Program Files, the registry, or system settings.

After installing, confirm the result:

    powershell -ExecutionPolicy Bypass -File .\Verify-Install.ps1

That prints a PASS / WARN / FAIL table and exits nonzero if anything is
actually broken.  WARN lines are machine-specific values to confirm, not
install defects.


--------------------------------------------------------------------------------
 RUNNING THE INSTALLER
--------------------------------------------------------------------------------

Windows may refuse to run the .ps1 with:

    ... cannot be loaded because running scripts is disabled on this
    system.

The least-invasive fix is to bypass the policy for that ONE command only.
This changes no system setting:

    powershell -NoProfile -ExecutionPolicy Bypass -File .\Install-VDM.ps1 -InstallRoot C:\VDM

If you would rather change the policy for your own account once (instead
of per command):

    Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

If the files were downloaded from the web, Windows may also mark them
"blocked".  Clear that mark before running:

    Unblock-File .\Install-VDM.ps1
    Get-ChildItem -Recurse | Unblock-File


--------------------------------------------------------------------------------
 WHAT IS IN HERE
--------------------------------------------------------------------------------

  app\                 Executables, SDL3 + FFmpeg runtime DLLs, and the
                       data files that must sit beside them (numbers.txt
                       bitmap font, NorgeLogo.png, jumpers.csv).
  config\              settings.txt (the current tuned configuration),
                       settings_sample.txt (generic template),
                       pixel_frames.txt (derived hill calibration),
                       jumpers.csv, SSH-UPLOAD-SETUP.txt.
  upload_video.bat     Uploads finished videos to the server via scp over
                       SSH (installed into the root next to VDM.exe).
  doc\                 Full documentation.  START AT doc\index.html.
  Install-VDM.ps1      The installer.
  Verify-Install.ps1   Post-install verification.
  MANIFEST.json        Every packaged file with its size and SHA-256.
  README.txt           This file.

The app\ and config\ split is packaging layout only.  After installation
everything lands flat in the install root, with settings.txt sitting next
to VDM.exe, because that is how the programs find each other.


--------------------------------------------------------------------------------
 AFTER INSTALLING - READ THIS PART
--------------------------------------------------------------------------------

The packaged settings.txt is a copy of the LIVE tuned configuration from
the previous laptop.  Three groups of values are tied to that specific
hardware and will be wrong here until you redo them:

  1. Camera device paths.  Run VDM, then Tools -> Select Cameras.
  2. NVENC GPU name.  Currently pinned to a specific RTX 3070 Ti Laptop
     GPU.  Change it if this machine has a different card.
  3. Window geometry.  Currently 2880 x 1620.  Reduce it if this display
     is smaller.

The installer prints these again as a NEXT STEPS block when it finishes,
and doc\index.html covers each one in full.

Also: add the install directory to the antivirus exclusion list before
the first run.  Norton in particular flags new executables that open
capture devices.


--------------------------------------------------------------------------------
 RUNNING IT
--------------------------------------------------------------------------------

The installer writes a launcher at the install root:

    C:\VDM\VDM.bat

It changes to the install directory and runs "VDM.exe settings.txt",
sending diagnostics to debug_log.txt.  A Start Menu shortcut pointing at
the same launcher is created unless you pass -NoShortcut.

Do not launch VDM.exe by double-clicking it directly - it must run with
the install directory as its working directory, which is exactly what the
launcher guarantees.


--------------------------------------------------------------------------------
 IF SOMETHING GOES WRONG
--------------------------------------------------------------------------------

  Install-VDM.ps1 aborts on a FAILed prerequisite.
      Fix the item it names.  For the Visual C++ runtime it prints the
      exact command:  winget install --id Microsoft.VCRedist.2015+.x64
      To install anyway and deal with it later, add -SkipPrereqCheck.

  Verify-Install.ps1 reports a DLL that will not load.
      A dependency is missing.  Re-run the installer; if it persists, the
      Visual C++ runtime is almost certainly not installed.

  VDM starts but no video appears.
      Camera device paths are not set for this machine.
      Tools -> Select Cameras.

  Encoding is very slow.
      NVENC is off.  settings.txt ships with disable_nvenc_encoding=1.
      Set it to 0 once the GPU name is correct for this machine.

Full troubleshooting: doc\index.html

