fix: improve video capture quality for HDMI capture cards#34
Merged
Conversation
The main issue was a leaked MediaStream from the permission request in
getVideoDevices() — the stream was never stopped, which locked the
capture card (e.g. Elgato Cam Link 4K) at its default 640x480 resolution
before startVideoStream could request a proper resolution.
Additional fixes:
- Remove image-rendering: -webkit-optimize-contrast which forced
nearest-neighbor (pixelated) scaling on the video element
- Add image-rendering: high-quality and filter: contrast(1) to use
Chromium's GPU filter pipeline with better interpolation
- Add frameRate: { ideal: 60 } to all getUserMedia constraints
- Cap resolution retry at 1920x1080 to prefer uncompressed formats
over MJPEG on USB capture cards
- Remove GPU flags (enable-accelerated-mjpeg-decode,
enable-native-gpu-memory-buffers) that could interfere with
UVC device format negotiation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Required by repo policy — pin all actions to their v4/v2 commit SHAs instead of version tags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getVideoDevices()— the permission request stream was never stopped, locking capture cards (e.g. Elgato Cam Link 4K) at 640x480 before the actual stream could negotiate a proper resolutionimage-rendering: -webkit-optimize-contrastwhich forced pixelated nearest-neighbor scaling; replaced withhigh-qualityand GPU filter pipeline renderingframeRate: { ideal: 60 }to all getUserMedia constraints and cap resolution retry at 1920x1080 to prefer uncompressed formats over MJPEGenable-accelerated-mjpeg-decode,enable-native-gpu-memory-buffers) that interfered with UVC device format negotiationTest plan
🤖 Generated with Claude Code