From 7f0f0a965b7bc3c9ba1179264d1fac3d42eba9b5 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 11 Nov 2026 02:47:36 +0400 Subject: pica-client: handle VAEntrypointEncSliceLP, add low_power option for VAAPI-accelerated hardware encoding of the video stream. --- pica-client/videodevice.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pica-client/videodevice.cpp') diff --git a/pica-client/videodevice.cpp b/pica-client/videodevice.cpp index 6eec078..67094aa 100644 --- a/pica-client/videodevice.cpp +++ b/pica-client/videodevice.cpp @@ -1573,6 +1573,19 @@ void VideoDevice::runTranscodeLoop(AVFormatContext *ifmt_ctx, AVStream *in_st) enc_ctx = openHwEncoder(enc, hw_device_ref, AV_PIX_FMT_VAAPI, m_width, m_height, frameRate, m_bitrate, gopSize, nullptr, &hw_frames_ref); + + // Newer Intel GPUs (iHD driver, Gen11+) expose only the low-power + // VAEntrypointEncSliceLP, which FFmpeg will not pick unless asked. + if (!enc_ctx) + { + AVDictionary *opts = nullptr; + av_dict_set(&opts, "low_power", "1", 0); + enc_ctx = openHwEncoder(enc, hw_device_ref, AV_PIX_FMT_VAAPI, + m_width, m_height, frameRate, m_bitrate, gopSize, + &opts, &hw_frames_ref); + av_dict_free(&opts); + } + hardware = enc_ctx != nullptr; av_buffer_unref(&hw_device_ref); -- cgit v1.2.1