diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 46bbebae..f8e10e7b 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -76,6 +76,24 @@ jobs: xcopy "T3000Webview\dist\spa\" "T3000 Output\release\ResourceFile\webview\www\" /E /H /C /I /y xcopy "T3000Webview\api\target\i686-pc-windows-msvc\release\t3_webview_api.dll" "T3000 Output\release\" /Y xcopy "T3000Webview\api\target\i686-pc-windows-msvc\release\t3_webview_api.dll.lib" "T3000 Output\release\" /Y + # CCTV UI. Sidecar exes are optional MIT processes (go2rtc / MediaMTX), + # never linked into T3000.exe. T3000.aip is unchanged; AddFolder of the + # release tree already installs whatever is under T3000 Output\release. + xcopy "T3000\ResourceFile\nvr\" "T3000 Output\release\ResourceFile\nvr\" /E /H /C /I /y + if exist "T3000\sidecar\go2rtc.exe" ( + if not exist "T3000 Output\release\sidecar" mkdir "T3000 Output\release\sidecar" + copy /Y "T3000\sidecar\go2rtc.exe" "T3000 Output\release\sidecar\" + ) + if exist "T3000\sidecar\mediamtx.exe" ( + if not exist "T3000 Output\release\sidecar" mkdir "T3000 Output\release\sidecar" + copy /Y "T3000\sidecar\mediamtx.exe" "T3000 Output\release\sidecar\" + ) + + - name: Fetch CCTV sidecars (optional MIT exes for the MSI) + continue-on-error: true + shell: pwsh + run: | + powershell -ExecutionPolicy Bypass -File tools\fetch-nvr-sidecars.ps1 -OutDir "T3000 Output\release\sidecar" # ----------------------------------------------------------------------- # SIGNING - origin-verification-compliant approach @@ -125,6 +143,7 @@ jobs: # Excluded (3rd-party, not owned by Temco): # sqlite3.dll - SQLite Consortium # WebView2Loader.dll - Microsoft + # sidecar\go2rtc.exe / mediamtx.exe - MIT sidecars, not linked into T3000.exe $missing = @() foreach ($file in $filesToSign) { diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 65489b0b..43ee4249 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -85,6 +85,23 @@ jobs: xcopy "T3000Webview\dist\spa\" "T3000 Output\release\ResourceFile\webview\www\" /E /H /C /I /y xcopy "T3000Webview\api\target\i686-pc-windows-msvc\release\t3_webview_api.dll" "T3000 Output\release\" /Y xcopy "T3000Webview\api\target\i686-pc-windows-msvc\release\t3_webview_api.dll.lib" "T3000 Output\release\" /Y + # CCTV UI. Sidecar exes are optional MIT processes (go2rtc / MediaMTX). + # T3000.aip is unchanged; AddFolder of the release tree installs this folder. + xcopy "T3000\ResourceFile\nvr\" "T3000 Output\release\ResourceFile\nvr\" /E /H /C /I /y + if exist "T3000\sidecar\go2rtc.exe" ( + if not exist "T3000 Output\release\sidecar" mkdir "T3000 Output\release\sidecar" + copy /Y "T3000\sidecar\go2rtc.exe" "T3000 Output\release\sidecar\" + ) + if exist "T3000\sidecar\mediamtx.exe" ( + if not exist "T3000 Output\release\sidecar" mkdir "T3000 Output\release\sidecar" + copy /Y "T3000\sidecar\mediamtx.exe" "T3000 Output\release\sidecar\" + ) + + - name: Fetch CCTV sidecars (optional MIT exes for the MSI) + continue-on-error: true + shell: pwsh + run: | + powershell -ExecutionPolicy Bypass -File tools\fetch-nvr-sidecars.ps1 -OutDir "T3000 Output\release\sidecar" # ----------------------------------------------------------------------- # PE SIGNING (origin-verification-compliant) diff --git a/.gitignore b/.gitignore index c7c9fc76..7d715ff5 100644 --- a/.gitignore +++ b/.gitignore @@ -953,3 +953,7 @@ build/ALL_BUILD.vcxproj /.vs /T3000/Database T3000Controls/project.lock.json + +# CCTV sidecar binaries (downloaded; MIT, not vendored) +T3000/sidecar/*.exe +T3000/sidecar/*.zip diff --git a/DEMO.md b/DEMO.md new file mode 100644 index 00000000..755e734f --- /dev/null +++ b/DEMO.md @@ -0,0 +1,179 @@ +# T3000 CCTV — Windows teammate demo + +**This branch is for a live demo on a normal T3000 Windows box. Do not merge until people have seen it running.** + +The Linux cloud agent that opened the PR **cannot** start T3000.exe, WebView2, or a LAN camera. Follow these steps on your VS2019 machine. There is no special installer and you do not need master. + +Developer background: [Documentation/nvr.md](Documentation/nvr.md). + +--- + +## 1. Check out this branch and build (same as the rest of T3000) + +```bat +git fetch origin +git checkout CCTV +``` + +1. Open **`T3000 - VS2019.sln`** in Visual Studio 2019. +2. Toolbar: configuration **Release** (or Debug), platform **Win32**. +3. **Build → Build Solution** (Ctrl+Shift+B). + +Same MFC / x86 / requireAdministrator path as always. Sidecar `.exe` files are **not** required to compile. If the build fails, it is a normal T3000 compile error — see [README_Build.md](README_Build.md). + +**Ignore the red GitHub check named “Testing the MSBuild” on this PR.** That workflow has been failing on `master` as well (missing MFC and .NET Framework 4.5.2 targeting pack on `windows-latest`). It dies before compiling `T3000NvrSidecar.cpp`. Your local VS2019 box is the real build. + +Built app: + +| Config | T3000.exe | +| --- | --- | +| Release | `T3000 Output\release\T3000.exe` | +| Debug | `T3000 Output\debug\T3000.exe` | + +Post-build already copies `T3000\ResourceFile\nvr\index.html` next to that exe. + +You also need the **Microsoft Edge WebView2 Runtime** (same as HVAC graphics / Modbus Register v2). If CCTV warns that it is missing, install it from https://developer.microsoft.com/en-us/microsoft-edge/webview2/ then retry. + +--- + +## 2. Drop `go2rtc.exe` where the launcher will find it + +Live video needs **go2rtc** (MIT, separate process, 64-bit is fine). **MediaMTX is optional** for this demo. + +### Official Windows zips (no script required) + +1. Download **[go2rtc_win64.zip](https://github.com/AlexxIT/go2rtc/releases/download/v1.9.14/go2rtc_win64.zip)** from [go2rtc v1.9.14](https://github.com/AlexxIT/go2rtc/releases/tag/v1.9.14). +2. Unzip. Copy **`go2rtc.exe`** to **any one** of these folders (create `sidecar` if needed): + +**Preferred (no rebuild):** next to the exe you just built + +``` +T3000 Output\release\sidecar\go2rtc.exe +``` + +or simply + +``` +T3000 Output\release\go2rtc.exe +``` + +(Debug: the same under `T3000 Output\debug\`.) + +**Also works:** source-tree folder (launcher walks `..\..\T3000\sidecar` from the output dir) + +``` +T3000\sidecar\go2rtc.exe +``` + +A Release post-build will also copy `T3000\sidecar\*.exe` into `T3000 Output\release\sidecar\` if they are already there. + +### Optional MediaMTX (record/playback home, not needed for live view) + +- Zip: **[mediamtx_v1.20.1_windows_amd64.zip](https://github.com/bluenviron/mediamtx/releases/download/v1.20.1/mediamtx_v1.20.1_windows_amd64.zip)** +- Drop `mediamtx.exe` in the **same** folder as `go2rtc.exe`. +- The CCTV header shows **MediaMTX :9197** when it is up, **MediaMTX off** when it is not. Live tiles still work. + +### Optional: fetch script instead of a browser download + +From the repo root, in PowerShell: + +```powershell +powershell -ExecutionPolicy Bypass -File tools\fetch-nvr-sidecars.ps1 +``` + +That writes `T3000\sidecar\go2rtc.exe` and `T3000\sidecar\mediamtx.exe`. Then either rebuild once, or copy those two files into `T3000 Output\release\sidecar\`. + +**Do not commit the `.exe` files.** + +--- + +## 3. Open the CCTV view + +1. Run **`T3000.exe`** (the one you built — it will ask for Administrator, as usual). +2. Menu: **Tools → CCTV**. +3. A WebView2 window titled **CCTV** opens. + +T3000 starts `go2rtc.exe` (and `mediamtx.exe` if present) on localhost, then loads `http://127.0.0.1:9191/index.html`. Closing that window stops processes T3000 started. + +--- + +## 4. Point at a camera + +The PC and the camera must be on the **same LAN** (ONVIF discovery uses multicast). + +### Option A — ONVIF on the LAN + +1. If the camera needs a login, type **Username** / **Password** first. +2. Click **Discover ONVIF**. +3. Wait a few seconds. Devices appear in the list (name + URL). +4. Click **Add** on the one you want. + +### Option B — paste an RTSP URL (no ONVIF camera) + +1. **Name:** e.g. `lobby` +2. **RTSP or ONVIF URL:** from the camera’s web UI, for example + `rtsp://admin:password@192.168.1.20/Streaming/Channels/101` +3. Click **Add and play**. + +Any RTSP the Windows box can reach works (another recorder, a camera, a phone app that publishes RTSP). There is no fake “demo stream” bundled. Without a reachable URL you still see the CCTV UI and sidecar status, but no video. + +WebView2 cannot play raw `rtsp://` inside a `