Skip to content

Remote desktop: H.264 (Phase 1, server + viewer) — needs testing - #107

Merged
Mischa323 merged 1 commit into
mainfrom
remote-h264-phase1
Jul 10, 2026
Merged

Remote desktop: H.264 (Phase 1, server + viewer) — needs testing#107
Mischa323 merged 1 commit into
mainfrom
remote-h264-phase1

Conversation

@Mischa323

Copy link
Copy Markdown
Owner

Phase 1 server + browser side (companion to leuffen-rmm-agent#36), plus the byte-identical vendored agent sync.

  • main.py — fan the agent's video_info codec-negotiation message out to the viewer (binary frames already pass through untouched).
  • static/remote.jsWebCodecs decode path. Advertises codecs: ["h264","jpeg"] when the browser has VideoDecoder; on video_info it configures the decoder and feeds each Annex-B access unit (keyframe detected by NAL type 5/7/8) as an EncodedVideoChunk, drawing decoded VideoFrames to the canvas. Waits for the first keyframe, resets per session, and falls back to the existing JPEG path when H.264 isn't negotiated / WebCodecs is absent.
  • vendored agent/ — sync of the Phase 1 agent code (no AGENT_VERSION change).

⚠️ Not yet tested end-to-end

Safe to deploy (JPEG fallback is unchanged), but H.264 won't actually engage until the agent MSI is rebuilt with PyAV (agent PR #36). Please validate on a real Windows agent + a Chromium/Edge viewer before merging. The viewer's NAL keyframe detection is unit-tested; node --check + py_compile pass.

Suggested test flow: merge/build agent #36 → deploy this → open Remote control in Chrome → confirm it's sharp/smooth and check the agent log shows codec=h264; disconnect from network / use Firefox to confirm the JPEG fallback still works.

🤖 Generated with Claude Code

Server + browser side of Phase 1 (companion to leuffen-rmm-agent#36), plus the
byte-identical vendored agent sync.

- server/app/main.py: fan the agent's `video_info` codec-negotiation message
  out to the remote-desktop viewer (binary frames already pass through).
- static/remote.js: WebCodecs decode path. Advertises `codecs:["h264","jpeg"]`
  when the browser has VideoDecoder; on a `video_info` it configures the decoder
  and feeds each Annex-B access unit (keyframe detected by NAL type) to it,
  drawing decoded VideoFrames to the canvas. Waits for the first keyframe,
  resets per session, and falls back to the existing JPEG path when H.264 isn't
  negotiated or WebCodecs is absent.
- agent/ vendored sync (screen_h264.py new, screen.py, agent.py, requirements)
  — code-only, no AGENT_VERSION change.

Screen-frame/input transport is unchanged; H.264 rides the same binary channel.
NOT tested end-to-end — needs a real Windows agent build (with PyAV) + a
WebCodecs browser. Deploying is safe (JPEG fallback), but H.264 won't engage
until the agent MSI bundles PyAV.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Mischa323
Mischa323 merged commit a40ac42 into main Jul 10, 2026
@Mischa323
Mischa323 deleted the remote-h264-phase1 branch July 10, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant