Professional Linux video capture, streaming, and HDR encoding toolset. Integrate low-cost USB capture devices, build P010 10-bit kernel support, and stream 4K HDR to YouTube with GPU acceleration. Some of these produce shims that conflict with secure boot unless enrolled with a MOK.
This monorepo contains standalone, production-ready modules:
Linux capture device automation with v4l2loopback, auto-reconnect, and crash recovery.
- β v4l2loopback isolation & feed relay
- β Auto-reconnect on device disconnect
- β OBS crash recovery (auto-restart + auto-resume stream)
- β USB device reset & driver rebind
- β Wayland graphics optimisation
- β HDR passthrough (NV12)
Quick Start: make install && make optimise-drivers
Docs: op-cap/docs/README.md
Note: v42cl-loopback installation may require MOK enrolment or disabling secure boot
FFmpeg-based capture relay with P010 HDR support, HLS streaming, and YouTube integration.
- β NV12 capture (immediate) / P010 10-bit (with kernel patch)
- β GPU encoding (NVIDIA NVENC HEVC Main10)
- β Full HDR metadata (BT.2020, SMPTE2084, mastering display)
- β HLS HTTP PUT relay to YouTube Live
- β Auto-reconnect on source disconnect
- β Bandwidth limiting & performance tuning
Quick Start: export COPT_FFMPEG_BIN=~/.local/bin/ffmpeg && copt-worker stream
Docs: copt/docs/README.md | P010_README.md
Linux kernel patches for native 10-bit P010 video format capture.
- β 3 surgical kernel modifications (~20 lines)
- β DKMS auto-installer
- β Works with standard Linux USB UVC
- β Tested: Ubuntu 24.04, Raspberry Pi
Install: sudo copt/scripts/setup-p010-support.sh
Credits: @awawa-dev β upstream repo (licence)
Detailed Guide: P010 Kernel Support
Note: Installation requires MOK enrolment or disabling secure boot
cd op-cap
make install
make optimise-drivers
# Launch OBS, add /dev/video10 as source
# v42cl-loopback (video10) requires MOK enrolment or disabling secure boot# Install op-cap
cd op-cap && make install && make optimise-drivers
# Install copt & custom FFmpeg
cd ../copt
bash scripts/build-ffmpeg-hevc.sh
export COPT_FFMPEG_BIN=~/.local/bin/ffmpeg
# Start streaming
copt-worker stream# Setup P010 kernel support (requires reboot and MOK enrolment or disabling secure boot)
sudo copt/scripts/setup-p010-support.sh
# After reboot, verify
v4l2-ctl -d /dev/video0 --list-formats-ext | grep -i p010
# Use P010 for capture
export COPT_USB_INPUT_FORMAT=p010
copt-worker streamπ op-cap README β Device setup, crash recovery, troubleshooting
π P010_README.md β Complete HDR pipeline, NV12 vs P010, verification checklist
- P010 Kernel Support Deep Dive
- Device Hardware Info & Accuracy
- Buffer Corruption Diagnosis
- USB Stability & Recovery
- Wayland Graphics Optimisation
- Automatic OBS restart on USB device crash
- Stream resumption (if streaming before crash)
- No cumulative retry cap by default (optional per-crash limit)
- 3-second recovery timeout
- 4K @ 30fps native P010 capture
- NVIDIA NVENC GPU encoding (HEVC Main10)
- Full HDR metadata (colour space, tone curve, mastering display)
- YouTube recognition verified working
- Auto-reconnect on device disconnect
- Device health monitoring
- USB reset & driver rebind
- Power optimisation (disable autosuspend)
HDMI Source
β
op-cap (USB Capture + OBS)
β [/dev/video10 loopback]
copt (FFmpeg relay)
β [P010 10-bit HEVC Main10]
YouTube Live HLS
β
YouTube recognises as HDR β
- Linux kernel 5.10+
- NVIDIA GPU with NVENC (RTX 2060+) or compatible AMD/Intel
- USB 3.0+ capture device (UGREEN 25173, Elgato HD60 S+, etc.)
- 8GB RAM, 4 CPU cores
- Ubuntu 24.04 or later / Debian 12+
- NVIDIA RTX 2060 SUPER or newer
- Desktop environment: GNOME/KDE
- P010_for_V4L2 kernel patches (for native 10-bit capture)
- Custom FFmpeg build with NVENC (included script)
video-tools/
βββ op-cap/ # USB capture & OBS stability
β βββ scripts/
β β βββ obs-safe-launch.sh # β Crash recovery wrapper
β β βββ auto_reconnect.sh # β Device monitoring
β β βββ optimise_drivers.sh # β GPU driver fixes
β β βββ maintenance.sh # β Interactive recovery tools
β βββ lib/ # Core libraries
β βββ docs/
β βββ README.md # Main op-cap guide
β βββ DRIVER_INFO.md # Hardware specs
β βββ USB_STABILITY.md # Troubleshooting
β
βββ copt/ # Capture & streaming relay
β βββ scripts/
β β βββ build-ffmpeg-hevc.sh # Custom FFmpeg builder
β β βββ setup-p010-support.sh # β Kernel patch installer
β β βββ hls-upload-relay.sh # YouTube HLS uploader
β βββ lib/
β β βββ ffmpeg.sh # HEVC Main10 encoder
β βββ docs/
β βββ README.md
β βββ P010_KERNEL_SUPPORT.md # Kernel patching guide
β
βββ P010_for_V4L2/ # Submodule: Kernel patches
β βββ p010.patch # 3 kernel modifications
β βββ dkms-installer.sh # DKMS installer
β βββ README.md # Upstream docs
β
βββ docs/
βββ README.md # β You are here
βββ P010_README.md # Complete HDR guide
βββ [standard files]
- Crash Recovery β Auto-restart OBS + resume stream on disconnect
- --no-device flag β Launch OBS without device requirement
- --no-loopback option β Direct device mode (skip v4l2loopback)
- Stream Detection β Monitors logs to detect active streams before crash
- 3-second Recovery β Fast restart after device failure
- Full HDR Metadata β BT.2020 colorspace + SMPTE2084 tone curve
- Mastering Display Info β Content light level integration
- HLS Playlist Upload β Fixed m3u8 relay to YouTube every 3-5 seconds
- Bandwidth Control β Limit streaming bitrate dynamically
- XAOSTECH β Integration, testing, documentation
- @awawa-dev β P010_for_V4L2 kernel patches, HyperHDR research
- USB UVC 1.0+ specification
- HEVC/H.265 Main10 profile (HDR10)
- ITU-R BT.2100 (HDR colour space)
- SMPTE ST 2084 (PQ tone curve)
- YouTube HLS Live streaming API
All modules distributed under GPL-3.0 Licence. See individual LICENCE files in each module.
- π§ Issues: GitHub Issues
- π€ Contributing: See CONTRIBUTING.md
- π Code of Conduct: CODE_OF_CONDUCT.md
OBS keeps crashing? β op-cap README crash recovery section
YouTube not recognising HDR? β P010_README.md verification checklist
Device not detected? β op-cap troubleshooting
Building FFmpeg fails? β copt FFmpeg builder β check script comments for common issues
Made with β€οΈ by XAOSTECH
GitHub β’
Releases β’
Issues
Status: Production Ready β
Last Updated: Feb 2026
Tested: Ubuntu 24.04, UGREEN 25173, NVIDIA RTX 2060 SUPER, YouTube Live