Files
One-KVM/libs/hwcodec
mofeng-git 206594e292 feat(video): 事务化切换与前端统一编排,增强视频输入格式支持
- 后端:切换事务+transition_id,/stream/mode 返回 switching/transition_id 与实际 codec

- 事件:新增 mode_switching/mode_ready,config/webrtc_ready/mode_changed 关联事务

- 编码/格式:扩展 NV21/NV16/NV24/RGB/BGR 输入与转换链路,RKMPP direct input 优化

- 前端:useVideoSession 统一切换,失败回退真实切回 MJPEG,菜单格式同步修复

- 清理:useVideoStream 降级为 MJPEG-only
2026-01-11 10:41:57 +08:00
..
2025-12-28 18:19:16 +08:00
2025-12-28 18:19:16 +08:00

A real-time hardware codec library for RustDesk based on FFmpeg

Codec

Windows

GPU FFmpeg ram FFmpeg vram sdk vram
intel encode qsv qsv Y
intel decode d3d11 d3d11 Y
nvidia encode nvenc(nv12->d3d11) nvenc(d3d11) Y
nvidia decode d3d11 d3d11 N
amd encode amf amf Y
amd decode d3d11 d3d11 Y

Notes

  • The reason for discarding the codecs using Cucontext is discussed in the following forum thread: https://forums.developer.nvidia.com/t/cuctxdestroy-causing-system-freeze-and-black-screen/290542/1. Based on the information above, there are several optimizations and changes made to the codec:

    • FFmpeg encoding AV_PIX_FMT_NV12 directly: The codec is modified to transfer AV_PIX_FMT_NV12 to AV_PIX_FMT_D3D11. This is done because FFmpeg doesn't use Cucontext if the device type is AV_HWDEVICE_TYPE_D3D11VA.
    • FFmpeg decoding with AV_HWDEVICE_TYPE_CUDA acceleration: This functionality is disabled and replaced with AV_HWDEVICE_TYPE_D3D11VA. The decoding process now utilizes D3D11VA acceleration instead of CUDA.
    • SDK decoding with CUDA acceleration: The CUDA acceleration support is disabled.
  • amd sdk remove h265 support, https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/432

Linux

GPU FFmpeg ram
intel encode vaapi
intel decode vaapi
nvidia encode vaapi, nvnec
nvidia decode vaapi, nvdec
amd encode vaapi, amf
amd decode vaapi

Issue

MacOS

FFmpeg ram encode FFmpeg ram decode
h265 only Y

Android

FFmpeg ram encode
Y

System requirements