55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From c7d88d028ea1e5aa4ed1729fd987c7e1c0517faa Mon Sep 17 00:00:00 2001
|
|
From: Fabian Vogt <fabian@ritter-vogt.de>
|
|
Date: Sat, 6 Jul 2024 16:42:36 +0200
|
|
Subject: [PATCH 3/3] Fix some copy-and-paste issues in h264vaapi and libx264
|
|
encoders
|
|
|
|
The code was copied from the libvpx encoder and apparently not adjusted.
|
|
---
|
|
src/h264vaapiencoder.cpp | 4 ----
|
|
src/libx264encoder.cpp | 6 +-----
|
|
2 files changed, 1 insertion(+), 9 deletions(-)
|
|
|
|
diff --git a/src/h264vaapiencoder.cpp b/src/h264vaapiencoder.cpp
|
|
index c4a607d..2d610de 100644
|
|
--- a/src/h264vaapiencoder.cpp
|
|
+++ b/src/h264vaapiencoder.cpp
|
|
@@ -167,10 +167,6 @@ int H264VAAPIEncoder::percentageToAbsoluteQuality(const std::optional<quint8> &q
|
|
void H264VAAPIEncoder::applyEncodingPreference(AVDictionary *options)
|
|
{
|
|
HardwareEncoder::applyEncodingPreference(options);
|
|
- av_dict_set(&options, "tune-content", "screen", 0);
|
|
- av_dict_set(&options, "deadline", "realtime", 0);
|
|
- // In theory a lower number should be faster, but the opposite seems to be true
|
|
- // av_dict_set(&options, "quality", "40", 0);
|
|
// Disable motion estimation, not great while dragging windows but speeds up encoding by an order of magnitude
|
|
av_dict_set(&options, "flags", "+mv4", 0);
|
|
// Disable in-loop filtering
|
|
diff --git a/src/libx264encoder.cpp b/src/libx264encoder.cpp
|
|
index 6f95b84..04eb5ec 100644
|
|
--- a/src/libx264encoder.cpp
|
|
+++ b/src/libx264encoder.cpp
|
|
@@ -32,7 +32,7 @@ bool LibX264Encoder::initialize(const QSize &size)
|
|
|
|
auto codec = avcodec_find_encoder_by_name("libx264");
|
|
if (!codec) {
|
|
- qCWarning(PIPEWIRERECORD_LOGGING) << "h264_vaapi codec not found";
|
|
+ qCWarning(PIPEWIRERECORD_LOGGING) << "libx264 codec not found";
|
|
return false;
|
|
}
|
|
|
|
@@ -93,10 +93,6 @@ int LibX264Encoder::percentageToAbsoluteQuality(const std::optional<quint8> &qua
|
|
void LibX264Encoder::applyEncodingPreference(AVDictionary *options)
|
|
{
|
|
SoftwareEncoder::applyEncodingPreference(options);
|
|
- av_dict_set(&options, "tune-content", "screen", 0);
|
|
- av_dict_set(&options, "deadline", "realtime", 0);
|
|
- // In theory a lower number should be faster, but the opposite seems to be true
|
|
- // av_dict_set(&options, "quality", "40", 0);
|
|
// Disable motion estimation, not great while dragging windows but speeds up encoding by an order of magnitude
|
|
av_dict_set(&options, "flags", "+mv4", 0);
|
|
// Disable in-loop filtering
|
|
--
|
|
2.45.2
|
|
|