Allows inspecting what's actually sent to FFmpeg.
Gbp-Pq: Name upstream_c928ed5c_Add-logging-of-encoding-options-if-log-level-is-set-to-info.patch
return options;
}
+void Encoder::maybeLogOptions(AVDictionary *options)
+{
+ if (PIPEWIRERECORD_LOGGING().isInfoEnabled()) {
+ char *buffer = NULL;
+ av_dict_get_string(options, &buffer, '=', ',');
+ qCInfo(PIPEWIRERECORD_LOGGING) << "Using encoding options:" << buffer;
+ av_freep(&buffer);
+ }
+}
+
SoftwareEncoder::SoftwareEncoder(PipeWireProduce *produce)
: Encoder(produce)
{
protected:
virtual int percentageToAbsoluteQuality(const std::optional<quint8> &quality) = 0;
virtual AVDictionary *buildEncodingOptions();
+ void maybeLogOptions(AVDictionary *options);
PipeWireProduce *m_produce;
}
AVDictionary *options = buildEncodingOptions();
+ maybeLogOptions(options);
// Assign the right hardware context for encoding frames.
// We rely on FFmpeg for creating the VAAPI hardware context as part of
}
AVDictionary *options = buildEncodingOptions();
+ maybeLogOptions(options);
if (int result = avcodec_open2(m_avCodecContext, codec, &options); result < 0) {
qCWarning(PIPEWIRERECORD_LOGGING) << "Could not open codec" << av_err2str(result);
}
AVDictionary *options = buildEncodingOptions();
+ maybeLogOptions(options);
if (int result = avcodec_open2(m_avCodecContext, codec, &options); result < 0) {
qCWarning(PIPEWIRERECORD_LOGGING) << "Could not open codec" << av_err2str(result);
m_avCodecContext->time_base = AVRational{1, 1000};
AVDictionary *options = buildEncodingOptions();
+ maybeLogOptions(options);
const auto area = size.width() * size.height();
// m_avCodecContext->framerate is not set, so we use m_produce->maxFramerate() instead.
}
AVDictionary *options = buildEncodingOptions();
+ maybeLogOptions(options);
if (int result = avcodec_open2(m_avCodecContext, codec, &options); result < 0) {
qCWarning(PIPEWIRERECORD_LOGGING) << "Could not open codec" << av_err2str(result);