fix: remove patch merged upstream
This commit is contained in:
parent
467e8efa60
commit
78642af9b8
@ -1,64 +0,0 @@
|
|||||||
From bfeb50c28c5282a451ca9e48ca6736e66de108a8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Aleix Pol <aleixpol@kde.org>
|
|
||||||
Date: Mon, 30 Jan 2023 03:00:07 +0100
|
|
||||||
Subject: [PATCH] record: Use vp8 instead of x264
|
|
||||||
|
|
||||||
Initially tried using vp9 but it's much slower in comparison and the videos
|
|
||||||
I get with this are acceptable.
|
|
||||||
It's better than x264 because it's easier to distribute by the different
|
|
||||||
distributions that ship our software.
|
|
||||||
---
|
|
||||||
src/pipewirerecord.cpp | 16 +++++++++++-----
|
|
||||||
1 file changed, 11 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/pipewirerecord.cpp b/src/pipewirerecord.cpp
|
|
||||||
index 385b59c..8098d33 100644
|
|
||||||
--- a/src/pipewirerecord.cpp
|
|
||||||
+++ b/src/pipewirerecord.cpp
|
|
||||||
@@ -85,7 +85,7 @@ PipeWireRecord::PipeWireRecord(QObject *parent)
|
|
||||||
: QObject(parent)
|
|
||||||
, d(new PipeWireRecordPrivate)
|
|
||||||
{
|
|
||||||
- d->m_encoder = "libx264rgb";
|
|
||||||
+ d->m_encoder = "libvpx";
|
|
||||||
av_log_set_level(AV_LOG_DEBUG);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ void PipeWireRecordProduce::finish()
|
|
||||||
|
|
||||||
QString PipeWireRecord::extension()
|
|
||||||
{
|
|
||||||
- return QStringLiteral("mp4");
|
|
||||||
+ return QStringLiteral("webm");
|
|
||||||
}
|
|
||||||
|
|
||||||
void PipeWireRecordProduce::setupStream()
|
|
||||||
@@ -229,8 +229,8 @@ void PipeWireRecordProduce::setupStream()
|
|
||||||
disconnect(m_stream.get(), &PipeWireSourceStream::streamParametersChanged, this, &PipeWireRecordProduce::setupStream);
|
|
||||||
avformat_alloc_output_context2(&m_avFormatContext, nullptr, nullptr, m_output.toUtf8().constData());
|
|
||||||
if (!m_avFormatContext) {
|
|
||||||
- qCWarning(PIPEWIRERECORD_LOGGING) << "Could not deduce output format from file: using MPEG." << m_output;
|
|
||||||
- avformat_alloc_output_context2(&m_avFormatContext, nullptr, "mpeg", m_output.toUtf8().constData());
|
|
||||||
+ qCWarning(PIPEWIRERECORD_LOGGING) << "Could not deduce output format from file: using WebM." << m_output;
|
|
||||||
+ avformat_alloc_output_context2(&m_avFormatContext, nullptr, "webm", m_output.toUtf8().constData());
|
|
||||||
}
|
|
||||||
if (!m_avFormatContext) {
|
|
||||||
qCDebug(PIPEWIRERECORD_LOGGING) << "could not set stream up";
|
|
||||||
@@ -265,7 +265,13 @@ void PipeWireRecordProduce::setupStream()
|
|
||||||
}
|
|
||||||
m_avCodecContext->time_base = AVRational{1, 1000};
|
|
||||||
|
|
||||||
- if (avcodec_open2(m_avCodecContext, m_codec, nullptr) < 0) {
|
|
||||||
+ AVDictionary *options = nullptr;
|
|
||||||
+ av_dict_set_int(&options, "threads", 4, 0);
|
|
||||||
+ av_dict_set(&options, "preset", "ultrafast", 0);
|
|
||||||
+ av_dict_set(&options, "tune-content", "screen", 0);
|
|
||||||
+ av_dict_set(&options, "quality", "realtime", 0);
|
|
||||||
+
|
|
||||||
+ if (avcodec_open2(m_avCodecContext, m_codec, &options) < 0) {
|
|
||||||
qCWarning(PIPEWIRERECORD_LOGGING) << "Could not open codec";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.39.1
|
|
||||||
|
|
@ -14,10 +14,6 @@ URL: https://invent.kde.org/plasma/%{name}
|
|||||||
%endif
|
%endif
|
||||||
Source0: http://download.kde.org/%{stable}/plasma/%{version}/%{name}-%{version}.tar.xz
|
Source0: http://download.kde.org/%{stable}/plasma/%{version}/%{name}-%{version}.tar.xz
|
||||||
|
|
||||||
# Use VP8 on WebM instead of x264 on MP4 for screen recording by default
|
|
||||||
# Adapted from: https://invent.kde.org/plasma/kpipewire/-/merge_requests/20
|
|
||||||
Patch0: 0001-record-Use-vp8-instead-of-x264.patch
|
|
||||||
|
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: extra-cmake-modules
|
BuildRequires: extra-cmake-modules
|
||||||
|
Loading…
Reference in New Issue
Block a user