rustdesk-org/hwcodec

The hardware encoder does not seem to work properly in the rustdesk night version.

Closed this issue · 75 comments

ytoaa commented

Encoding via Intel graphics is not properly supported on Ubuntu 22.04 and Windows 10 Since Linux uses va-api, Windows doesn't seem to support qsv yet, even if it's an extra. Is this intended?

The cpu used in the encoder is Intel N6005. IGPU has been used.

--windows--

[2022-11-07 01:22:04.839961 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\1f03d20\src\encode.rs:231] prepare yuv 1.0783ms
[2022-11-07 01:22:04.860588 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\1f03d20\src\encode.rs:253] h264_nvenc new failed 1.8321ms
[2022-11-07 01:22:04.861012 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\1f03d20\src\encode.rs:253] h264_amf new failed 2.1723ms
[2022-11-07 01:22:04.864178 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\1f03d20\src\encode.rs:253] hevc_amf new failed 1.4291ms
[2022-11-07 01:22:04.865334 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\1f03d20\src\encode.rs:253] hevc_nvenc new failed 3.7026ms
[2022-11-07 01:22:04.868158 +09:00] DEBUG [libs\hbb_common\src\config.rs:292] Configuration path: C:\Users\tesn\AppData\Roaming\RustDesk\config\RustDesk_hwcodec.toml

--linux--

[2022-11-07 18:53:17.167367 +09:00] DEBUG [/home/runner/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/1f03d20/src/encode.rs:231] prepare yuv 1.247427ms
[2022-11-07 18:53:17.170574 +09:00] DEBUG [/home/runner/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/1f03d20/src/encode.rs:253] hevc_amf new failed 538.615µs
[2022-11-07 18:53:17.171005 +09:00] DEBUG [/home/runner/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/1f03d20/src/encode.rs:253] h264_nvenc new failed 259.478µs
[2022-11-07 18:53:17.171241 +09:00] DEBUG [/home/runner/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/1f03d20/src/encode.rs:253] h264_amf new failed 143.477µs
[2022-11-07 18:53:17.173073 +09:00] DEBUG [/home/runner/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/1f03d20/src/encode.rs:253] hevc_nvenc new failed 216.658µs
[2022-11-07 18:53:17.179104 +09:00] DEBUG [libs/hbb_common/src/config.rs:292] Configuration path: /root/.config/rustdesk/RustDesk_hwcodec.toml

here, qsv doesn't support yuv420p, RustDesk use yuv420p as default, qsv will be supported soon.

ytoaa commented

Oh, then is VA-API possible on Linux?

support in code, but I only tested it on amd and nvidia,

ytoaa commented

I'm eagerly waiting for the moment when Linux becomes a vaapi with Intel igpu. Thank you.

ytoaa commented

It seems to detect "QSV", but the performance is not much different from cpu encoding.

[2022-11-23 08:01:18.111102 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:231] prepare yuv 1.254ms
[2022-11-23 08:01:18.119187 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:253] h264_nvenc new failed 791.9µs
[2022-11-23 08:01:18.119688 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:253] hevc_nvenc new failed 487.7µs
[2022-11-23 08:01:18.407808 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:244] h264_qsv new 288.9401ms
[2022-11-23 08:01:18.408103 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:253] hevc_amf new failed 288.389ms
[2022-11-23 08:01:18.425347 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:247] h264_qsv encode 17.1254ms
[2022-11-23 08:01:18.747116 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:244] hevc_qsv new 627.1736ms
[2022-11-23 08:01:18.747377 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:253] h264_amf new failed 628.7584ms
[2022-11-23 08:01:18.778977 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\encode.rs:247] hevc_qsv encode 31.8049ms
[2022-11-23 08:01:18.806200 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:353] name:h264 device:AV_HWDEVICE_TYPE_CUDA new failed:1.0305ms
[2022-11-23 08:01:18.806345 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:353] name:hevc device:AV_HWDEVICE_TYPE_CUDA new failed:1.0854ms
[2022-11-23 08:01:18.807575 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:h264_qsv device:AV_HWDEVICE_TYPE_NONE new:118.2µs
[2022-11-23 08:01:18.809813 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:hevc_qsv device:AV_HWDEVICE_TYPE_NONE new:60.2µs
[2022-11-23 08:01:18.814004 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:h264 device:AV_HWDEVICE_TYPE_NONE new:8.5955ms
[2022-11-23 08:01:18.821727 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:hevc device:AV_HWDEVICE_TYPE_NONE new:15.3649ms
[2022-11-23 08:01:18.835199 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:h264 device:AV_HWDEVICE_TYPE_NONE decode:21.1307ms
[2022-11-23 08:01:18.867225 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:hevc device:AV_HWDEVICE_TYPE_NONE decode:45.4146ms
[2022-11-23 08:01:18.915146 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:h264 device:AV_HWDEVICE_TYPE_DXVA2 new:106.5518ms
[2022-11-23 08:01:18.916933 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:hevc device:AV_HWDEVICE_TYPE_DXVA2 new:109.1316ms
[2022-11-23 08:01:18.933429 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:hevc device:AV_HWDEVICE_TYPE_D3D11VA new:125.3139ms
[2022-11-23 08:01:18.946963 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:h264 device:AV_HWDEVICE_TYPE_DXVA2 decode:31.7519ms
[2022-11-23 08:01:18.954810 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:h264 device:AV_HWDEVICE_TYPE_D3D11VA new:144.6404ms
[2022-11-23 08:01:18.972595 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:hevc device:AV_HWDEVICE_TYPE_DXVA2 decode:55.5838ms
[2022-11-23 08:01:19.001597 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:hevc device:AV_HWDEVICE_TYPE_D3D11VA decode:68.0983ms
[2022-11-23 08:01:19.020166 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:h264 device:AV_HWDEVICE_TYPE_D3D11VA decode:65.2854ms
[2022-11-23 08:01:19.209881 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:h264_qsv device:AV_HWDEVICE_TYPE_NONE decode:402.2484ms
[2022-11-23 08:01:19.396476 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:h264_qsv device:AV_HWDEVICE_TYPE_QSV new:586.8382ms
[2022-11-23 08:01:19.643004 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:hevc_qsv device:AV_HWDEVICE_TYPE_NONE decode:833.13ms
[2022-11-23 08:01:19.818178 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:325] name:hevc_qsv device:AV_HWDEVICE_TYPE_QSV new:1.0117739s
[2022-11-23 08:01:20.049065 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:h264_qsv device:AV_HWDEVICE_TYPE_QSV decode:652.5376ms
[2022-11-23 08:01:20.179563 +09:00] DEBUG [C:\Users\runneradmin.cargo\git\checkouts\hwcodec-8b4454f7f5e13466\f54d69b\src\decode.rs:337] name:hevc_qsv device:AV_HWDEVICE_TYPE_QSV decode:361.3351ms
[2022-11-23 08:01:20.235202 +09:00] DEBUG [libs\hbb_common\src\config.rs:329] Configuration path: C:\Users\tesn\AppData\Roaming\RustDesk\config\RustDesk_hwcodec.toml
[2022-11-23 08:01:20.235723 +09:00] DEBUG [libs\hbb_common\src\config.rs:329] Configuration path: C:\Users\tesn\AppData\Roaming\RustDesk\config\RustDesk_hwcodec.toml

It seems to detect "QSV", but the performance is not much different from cpu encoding.

Can you tell the difference? eg: fps, quality

ytoaa commented

It seems to detect "QSV", but the performance is not much different from cpu encoding.

Can you tell the difference? eg: fps, quality

No difference was found. It showed almost the same cpu gpu utilization.

Did you choose h264/h265 encoding on remote menubar ?

ytoaa commented

Without installation, we proceeded with direct connection with only hw encoding turned on.

qsv has lower priority than soft now.

image

ytoaa commented

Nothing changes even if you press h265 and h264. It still shows resource consumption, such as cpu encoding.

high fps, watch cpu & gpu consumption

ytoaa commented
bandicam.2022-11-23.12-14-37-437.mp4

Codec is the conversion between 264/265/vp9 and yuv, the conversion between yuv and rgba will still consume cpu. try compare with vp9

ytoaa commented
bandicam.2022-11-23.12-25-42-114.mp4
ytoaa commented
bandicam.2022-11-23.12-28-03-455.mp4

All three codecs show the same pattern.

I just try it on my pc, i7 6700hq, set fps limit 15,
h265 cpu 8% ~ 10%, gpu about 40% ~60%
vp9 cpu 13% ~ 16%, gpu about 10%

ytoaa commented

The host point is using intel N6005 and iGPU.

You can set the fps to 15 and play the video in the background, then will be same fps

check show quality monitor

ytoaa commented

Oh, I just saw on the monitor that no matter how much you change the codec, it doesn't change in vp9

always use vp9? Even you choose h264/h265?

ytoaa commented
bandicam.2022-11-23.12-45-59-032.mp4

Could you run example available on both pc? and show C:\Users\<Yourname>\AppData\Roaming\RustDesk\config\Rustdesk_hwcodec.toml if not installed?

available exe

dowload this jpg and rename it as available.exe, run it in terminal

ytoaa commented

client
[2022-11-23T04:09:59Z INFO available] avaliable_encoders:78.2084ms
[2022-11-23T04:09:59Z INFO available] count:0, []
[2022-11-23T04:09:59Z INFO available] best encoders:CodecInfos { h264: None, h265: None }
[2022-11-23T04:10:00Z INFO available] avaliable_decoders:1.2985061s
[2022-11-23T04:10:00Z INFO available] count:10, [CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }]
[2022-11-23T04:10:00Z INFO available] best decoders:CodecInfos { h264: Some(CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }), h265: Some(CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }) }

host

[2022-11-23T04:09:36Z INFO available] avaliable_encoders:130.5097ms
[2022-11-23T04:09:36Z INFO available] count:0, []
[2022-11-23T04:09:36Z INFO available] best encoders:CodecInfos { h264: None, h265: None }
[2022-11-23T04:09:38Z INFO available] avaliable_decoders:1.6538623s
[2022-11-23T04:09:38Z INFO available] count:10, [CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }]
[2022-11-23T04:09:38Z INFO available] best decoders:CodecInfos { h264: Some(CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }), h265: Some(CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }) }

There is no avaliable encoders, but it seems that it can encode success in your previous log, and menubar show h264/h265 only if it's detect result is support

ytoaa commented

This is a very strange thing

I'll try to fix it

Could you show C:\Users\<Yourname>\AppData\Roaming\RustDesk\config\Rustdesk_hwcodec.toml?

ytoaa commented

RustDesk_hwcodec
Please change the extension
Files on the host.

It shows support

available exe

It's my bad, retry, the previous is not nv12

ytoaa commented

host

[2022-11-23T04:52:36Z INFO available] avaliable_encoders:568.2507ms
[2022-11-23T04:52:36Z INFO available] count:2, [CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 70, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 60, hwdevice: AV_HWDEVICE_TYPE_NONE }]
[2022-11-23T04:52:36Z INFO available] best encoders:CodecInfos { h264: Some(CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 70, hwdevice: AV_HWDEVICE_TYPE_NONE }), h265: Some(CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 60, hwdevice: AV_HWDEVICE_TYPE_NONE }) }
[2022-11-23T04:52:38Z INFO available] avaliable_decoders:1.1540611s
[2022-11-23T04:52:38Z INFO available] count:10, [CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }]
[2022-11-23T04:52:38Z INFO available] best decoders:CodecInfos { h264: Some(CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }), h265: Some(CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }) }

client

[2022-11-23T04:53:34Z INFO available] avaliable_encoders:571.4731ms
[2022-11-23T04:53:34Z INFO available] count:2, [CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 60, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 70, hwdevice: AV_HWDEVICE_TYPE_NONE }]
[2022-11-23T04:53:34Z INFO available] best encoders:CodecInfos { h264: Some(CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 70, hwdevice: AV_HWDEVICE_TYPE_NONE }), h265: Some(CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 60, hwdevice: AV_HWDEVICE_TYPE_NONE }) }
[2022-11-23T04:53:35Z INFO available] avaliable_decoders:1.1741327s
[2022-11-23T04:53:35Z INFO available] count:10, [CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 90, hwdevice: AV_HWDEVICE_TYPE_DXVA2 }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc_qsv", format: H265, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }, CodecInfo { name: "h264_qsv", format: H264, vendor: INTEL, score: 80, hwdevice: AV_HWDEVICE_TYPE_QSV }]
[2022-11-23T04:53:35Z INFO available] best decoders:CodecInfos { h264: Some(CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }), h265: Some(CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 91, hwdevice: AV_HWDEVICE_TYPE_D3D11VA }) }

Do support, I'll try to fix it

try this, rustdesk-1.2.0-x86_64-pc-windows-msvc-nv12.exe

both side this version ?

ytoaa commented

It is still displayed as vp9 in the quality monitor.

ok

rustdesk-1.2.0-x86_64-pc-windows-msvc-nv12.exe, could you try this build both side? I add some logs, it'll log to D:\log.txt

ytoaa commented

I just found out a new fact. In direct connection mode, no matter how many codec settings were changed, the quality monitor did not change. However, as a result of configuring and connecting the relay server, if you change the codec, the quality monitor displays the codec correctly. There is also a change in actual cpu and gpu usage.

ytoaa commented

log.txt
client
log.txt
host
When can we meet in the official nightly version?

ytoaa commented

Is there no way to do it on Linux yet?

you can try my nighly, it is all nv12. You tried twice in your log, first all prefers is auto, It seems that you didn't change codec, did you?; second time is ok. Could you try another time that is all fail and give the log? linux will log to /tmp/log.txt

ytoaa commented

2022-11-24T15:00:37.927452101+09:00 on_message: option:OptionMessage { image_quality: NotSet, lock_after_session_end: NotSet, show_remote_cursor: NotSet, privacy_mode: NotSet, block_input: NotSet, custom_image_quality: 10240, disable_audio: NotSet, disable_clipboard: NotSet, enable_file_transfer: NotSet, video_codec_state: MessageField(Some(VideoCodecState { score_vpx: 90, score_h264: 91, score_h265: 91, perfer: Auto, special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } })), custom_fps: 30, special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }
2022-11-24T15:00:37.928078161+09:00 connection update_option: q:VideoCodecState { score_vpx: 90, score_h264: 91, score_h265: 91, perfer: Auto, special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }
2022-11-24T15:00:43.238521038+09:00 on_message: option:OptionMessage { image_quality: NotSet, lock_after_session_end: NotSet, show_remote_cursor: NotSet, privacy_mode: NotSet, block_input: NotSet, custom_image_quality: 10240, disable_audio: NotSet, disable_clipboard: NotSet, enable_file_transfer: NotSet, video_codec_state: MessageField(Some(VideoCodecState { score_vpx: 90, score_h264: 91, score_h265: 91, perfer: Auto, special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } })), custom_fps: 30, special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }
2022-11-24T15:00:43.239297422+09:00 connection update_option: q:VideoCodecState { score_vpx: 90, score_h264: 91, score_h265: 91, perfer: Auto, special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }

perfer: Auto

which is wrong, should be auto/h264/h265/vp9

ytoaa commented

When you connect to a Linux host, you do not see the codec selection menu. The hardware is the same as n6005.

available

rename as available and run in linux

perfer: Auto

which is wrong, should be auto/h264/h265/vp9

You changed the codec but it sent auto

ytoaa commented

What extension should I change to?

need not, chmod a+x and run

ytoaa commented

[2022-11-24T06:20:33Z INFO available] avaliable_encoders:9.151933ms
[2022-11-24T06:20:33Z INFO available] count:0, []
[2022-11-24T06:20:33Z INFO available] best encoders:CodecInfos { h264: None, h265: None }
[2022-11-24T06:20:33Z INFO available] avaliable_decoders:66.291317ms
[2022-11-24T06:20:33Z INFO available] count:4, [CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 70, hwdevice: AV_HWDEVICE_TYPE_VAAPI }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 70, hwdevice: AV_HWDEVICE_TYPE_VAAPI }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }]
[2022-11-24T06:20:33Z INFO available] best decoders:CodecInfos { h264: Some(CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }), h265: Some(CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }) }

let me try

can't get any intel encoders too.

ytoaa commented

Don't Linux usually use va-api instead of qsv?

vaapi or vdpau, maybe driver problem

ytoaa commented

Do I need to delete or reinstall the driver?

maybe reinstall will help

sudo apt-get install libva-dev libvdpau-dev

ytoaa commented

The packages are already installed, so I deleted them and reinstalled them, but they still show the driver in available.

ytoaa commented

It's strange to see that transcoding works normally in plex etc.

I'm not sure about that, my pc support nvidia and intel, maybe I should uninstall nvidia and test it.

ytoaa commented

I will test it by installing a new Linux.

on linux , it's qsv also, need not reinstall. I really want to know why you can't change prefer codec
qsv is encoder, vaapi is decoder.

ytoaa commented

Are you saying that qsv encoding is possible in Ubuntu?

Maybe I should add libmfx on linux, like windows

ytoaa commented

Is there a possibility that the cause is Ubuntu version 22.04?

Probably not, maybe some dev work is needed.

ytoaa commented

I just installed a new Ubuntu 22.04 kernel 6.0.0, but hardware encoding was still not possible.

[2022-11-24T12:30:18Z INFO available] avaliable_encoders:34.347654ms
[2022-11-24T12:30:18Z INFO available] count:0, []
[2022-11-24T12:30:18Z INFO available] best encoders:CodecInfos { h264: None, h265: None }
[2022-11-24T12:30:18Z INFO available] avaliable_decoders:70.035ms
[2022-11-24T12:30:18Z INFO available] count:4, [CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 70, hwdevice: AV_HWDEVICE_TYPE_VAAPI }, CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 70, hwdevice: AV_HWDEVICE_TYPE_VAAPI }, CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }]
[2022-11-24T12:30:18Z INFO available] best decoders:CodecInfos { h264: Some(CodecInfo { name: "h264", format: H264, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }), h265: Some(CodecInfo { name: "hevc", format: H265, vendor: OTHER, score: 80, hwdevice: AV_HWDEVICE_TYPE_NONE }) }

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSliceLP
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSliceLP
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile1 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileVP9Profile3 : VAEntrypointVLD
VAProfileHEVCMain422_10 : VAEntrypointVLD
VAProfileHEVCMain444 : VAEntrypointVLD
VAProfileHEVCMain444 : VAEntrypointEncSliceLP
VAProfileHEVCMain444_10 : VAEntrypointVLD
VAProfileHEVCMain444_10 : VAEntrypointEncSliceLP

There is still some work for me

ytoaa commented

Oh, take your time

ytoaa commented

In the current nightly version, vaapi decoding seems to work normally.

[2022-11-28 18:05:11.716615 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/encode.rs:231] prepare yuv 1.68313ms
[2022-11-28 18:05:11.717922 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/encode.rs:253] h264_nvenc new failed 505.911µs
[2022-11-28 18:05:11.717927 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/encode.rs:253] h264_amf new failed 397.238µs
[2022-11-28 18:05:11.717929 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/encode.rs:253] hevc_nvenc new failed 566.288µs
[2022-11-28 18:05:11.718058 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/encode.rs:253] hevc_amf new failed 322.996µs
[2022-11-28 18:05:11.719421 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:353] name:h264 device:AV_HWDEVICE_TYPE_CUDA new failed:1.284281ms
[2022-11-28 18:05:11.719454 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:353] name:hevc device:AV_HWDEVICE_TYPE_CUDA new failed:731.65µs
[2022-11-28 18:05:11.719929 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:325] name:hevc device:AV_HWDEVICE_TYPE_NONE new:1.659043ms
[2022-11-28 18:05:11.735682 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:325] name:h264 device:AV_HWDEVICE_TYPE_NONE new:2.485375ms
[2022-11-28 18:05:11.750332 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:325] name:hevc device:AV_HWDEVICE_TYPE_VAAPI new:30.876946ms
[2022-11-28 18:05:11.751016 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:325] name:h264 device:AV_HWDEVICE_TYPE_VAAPI new:31.543226ms
[2022-11-28 18:05:11.756974 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:337] name:hevc device:AV_HWDEVICE_TYPE_NONE decode:37.026235ms
[2022-11-28 18:05:11.765363 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:337] name:h264 device:AV_HWDEVICE_TYPE_NONE decode:29.64957ms
[2022-11-28 18:05:11.777835 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:337] name:h264 device:AV_HWDEVICE_TYPE_VAAPI decode:26.798727ms
[2022-11-28 18:05:11.781993 +09:00] DEBUG [/root/.cargo/git/checkouts/hwcodec-8b4454f7f5e13466/f54d69b/src/decode.rs:337] name:hevc device:AV_HWDEVICE_TYPE_VAAPI decode:31.622408ms
[2022-11-28 18:05:11.792562 +09:00] DEBUG [libs/hbb_common/src/config.rs:328] Configuration path: /root/.config/rustdesk/RustDesk_hwcodec.toml

thanks

ytoaa commented

When will the qsv update be in the official nightly version?