summaryrefslogtreecommitdiffstats
path: root/pica-client/videodevice.cpp
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-11-11 02:47:36 +0400
committerAnton <anton@picapica.im>2026-11-11 02:47:36 +0400
commit7f0f0a965b7bc3c9ba1179264d1fac3d42eba9b5 (patch)
treedd8275e661d087260f7e36b21bac9125dd6dd324 /pica-client/videodevice.cpp
parent5253fff0e57da39ae56108c827f7226f9e14d154 (diff)
downloadpica-pica-7f0f0a965b7bc3c9ba1179264d1fac3d42eba9b5.tar.gz
pica-pica-7f0f0a965b7bc3c9ba1179264d1fac3d42eba9b5.zip
pica-client: handle VAEntrypointEncSliceLP, add low_power option
for VAAPI-accelerated hardware encoding of the video stream.
Diffstat (limited to 'pica-client/videodevice.cpp')
-rw-r--r--pica-client/videodevice.cpp13
1 files changed, 13 insertions, 0 deletions
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);