Nheko-Reborn / nheko

Desktop client for Matrix using Qt and C++20.
https://nheko-reborn.github.io/
GNU General Public License v3.0
1.87k stars 199 forks source link

Use va-api for video calls #782

Open tusooa opened 2 years ago

tusooa commented 2 years ago

The Problem

Currently nheko video calls does not use gpu (intel_gpu_top gives out 0% usage on video on calls).

Is it due to https://github.com/Nheko-Reborn/nheko/blob/f6f5d2615a517776e10f4c88778aaf4ce226131e/src/WebRTCSession.cpp#L524 ?

] gst-inspect-1.0 vaapi
Plugin Details:
  Name                     vaapi
  Description              VA-API based elements
  Filename                 /usr/lib64/gstreamer-1.0/libgstvaapi.so
  Version                  1.18.4
  License                  LGPL
  Source module            gstreamer-vaapi
  Source release date      2021-03-15
  Binary package           gstreamer-vaapi
  Origin URL               https://www.gentoo.org

  vaapivp9enc: VA-API VP9 encoder
  vaapih265enc: VA-API H265 encoder
  vaapivp8enc: VA-API VP8 encoder
  vaapijpegenc: VA-API JPEG encoder
  vaapih264enc: VA-API H264 encoder
  vaapimpeg2enc: VA-API MPEG-2 encoder
  vaapisink: VA-API sink
  vaapidecodebin: VA-API Decode Bin
  vaapipostproc: VA-API video postprocessing
  vaapih265dec: VA-API H265 decoder
  vaapivp9dec: VA-API VP9 decoder
  vaapivp8dec: VA-API VP8 decoder
  vaapivc1dec: VA-API VC1 decoder
  vaapih264dec: VA-API H264 decoder
  vaapimpeg2dec: VA-API MPEG2 decoder
  vaapijpegdec: VA-API JPEG decoder

  16 features:
  +-- 16 elements

The Solution

We should have the option to use gpu (via va-api).

Alternatives

No response

Additional context

cc @satanepigone

Happens in the latest version

deepbluev7 commented 2 years ago

I think we added that, because vaapi used to crash immediately on most systems. Maybe that is better now though.

deepbluev7 commented 2 years ago

I guess we should at least add a config option for now, so that people can test it easily though.

deepbluev7 commented 2 years ago

So I just tried it, hardware decoding corrupts the stream horribly. It really can't be enabled by default (with gstreamer 1.18)!

tusooa commented 2 years ago

-((