H.264 / WebRTC
H.264 Video
About H.264
H.264 (also known as MPEG-4 AVC) is a highly efficient video compression standard widely used for streaming. Compared with MJPEG, H.264 offers:
- Lower bandwidth usage
- Better compression efficiency
- Audio transmission support
- Lower network latency
Implementation Options
One-KVM provides two H.264 encoding options:
Libx264 (Recommended)
Libx264 is a high-performance H.264 encoding library developed by VideoLAN. This option:
- Is integrated into the latest version and enabled by default
- Delivers excellent performance and ease of use
- Supports WebRTC real-time streaming
- Source code is available in the ustreamer branch
FFmpeg (Deprecated)
This option uses FFmpeg software encoding and has been deprecated due to performance concerns:
- High CPU usage
- Poor experience on low-performance devices
- Kept only for historical reference
WebRTC Configuration
About WebRTC
WebRTC uses P2P connections and UDP transport to:
- Reduce network latency
- Lower server load
- Provide better real-time performance
Default configuration
WebRTC uses Google STUN servers by default. The configuration is located at /etc/kvmd/override.yaml
:
Remote access configuration
Two remote access methods are supported:
-
Port forwarding (not recommended)
- Requires mapping UDP ports 20000-40000
- Complex configuration with lower security
-
Mesh networking (recommended)
- Use tools like Tailscale to establish a secure tunnel
- Simple configuration with higher security
- No need to map a large range of ports
Video Quality Tuning
Image quality optimization
If the video quality is not ideal, you can:
- Adjust the H.264 bitrate in the system menu at the top right of the page
- Adjust the resolution according to network conditions
- Choose an appropriate quality preset