Move desktop video and publisher diagnostics out of temporary debug category

This commit is contained in:
evgeny committed 2026-11-01 20:40:13 +01:00
1 parent 811f5b7659
commit 8336487596
3 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -368,7 +368,7 @@ void CallVideoEngine::transmit() {
}
}
if (now - reportAt >= 1000000) {
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG,
DEBUG_DEBUG(DEBUG_CATEGORY_VIDEO,
"video capture flow call=%llu interval_us=%lld captured=%llu encoded=%u keys=%u send_busy=%u "
"expired=%u encode_max_us=%lld input_age_max_us=%lld capture_age_us=%lld pts=%lld clock_correction_us=%lld",
(unsigned long long)m->id, (long long)(now - reportAt), (unsigned long long)(captured - captureBase),
+10 -10
View File
@@ -34,7 +34,7 @@ struct LiveVideoEncoder::Impl {
#ifdef HAVE_FFMPEG
AVCodecContext* codec = nullptr;
AVBSFContext* filter = nullptr;
AVBSFContext* headers = nullptr; // Только чтение заголовков KEY при debug=trace, исходный пакет не меняется.
AVBSFContext* headers = nullptr; // Только чтение заголовков KEY при video=trace, исходный пакет не меняется.
bool headersAttempted = false;
AVFrame* frame = nullptr;
AVBufferRef* device = nullptr;
@@ -354,9 +354,9 @@ bool LiveVideoEncoder::open(const LiveVideoConfig& config, Backend backend) {
if (!settings.isEmpty()) settings += ' ';
settings += QByteArray(option) + '=' + (result >= 0 ? QByteArray::number(value) : QByteArray("unavailable"));
}
CODEC_LOG(DEBUG_LEVEL_INFO, DEBUG_CATEGORY_DEBUG,
CODEC_LOG(DEBUG_LEVEL_INFO, DEBUG_CATEGORY_VIDEO,
"AMF effective settings encoder=%s %s target_bps=%lld max_bps=%lld vbv_bits=%d qmin=%d qmax=%d "
"time_base=%d/%d framerate=%d/%d; driver trace requires debug=trace",
"time_base=%d/%d framerate=%d/%d; driver trace requires video=trace",
name.constData(), settings.constData(), (long long)c->bit_rate, (long long)c->rc_max_rate, c->rc_buffer_size,
c->qmin, c->qmax, c->time_base.num, c->time_base.den, c->framerate.num, c->framerate.den);
}
@@ -411,7 +411,7 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
int stride[4] = {static_cast<int>(canvas.bytesPerLine()), 0, 0, 0};
result = sws_scale(m->scale, input, stride, 0, canvas.height(), m->frame->data, m->frame->linesize);
}
if (result >= 0 && m->reportTimer.elapsed() >= 1000 && debug_should_output(DEBUG_LEVEL_TRACE, DEBUG_CATEGORY_DEBUG)
if (result >= 0 && m->reportTimer.elapsed() >= 1000 && debug_should_output(DEBUG_LEVEL_TRACE, DEBUG_CATEGORY_VIDEO)
&& (m->frame->format == AV_PIX_FMT_NV12 || m->frame->format == AV_PIX_FMT_YUV420P)) {
uint64_t edges = 0, samples = 0;
int minimum = 255, maximum = 0;
@@ -422,7 +422,7 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
edges += std::abs(value - row[x + 1]) + std::abs(value - row[x + m->frame->linesize[0]]); samples += 2;
}
}
DEBUG_TRACE(DEBUG_CATEGORY_DEBUG,
DEBUG_TRACE(DEBUG_CATEGORY_VIDEO,
"video encoder input name=%s pts=%llu source=%dx%d encoded=%dx%d pixel=%d luma_min=%d luma_max=%d edge_x1000=%llu",
qPrintable(m->name), (unsigned long long)pts, image.width(), image.height(), m->frame->width, m->frame->height,
m->frame->format, minimum, maximum, (unsigned long long)(samples ? edges * 1000 / samples : 0));
@@ -463,7 +463,7 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
if (result < 0) break;
}
if (m->config.codec == STREAM_MEDIA_H265 && (packet->flags & AV_PKT_FLAG_KEY)
&& debug_should_output(DEBUG_LEVEL_TRACE, DEBUG_CATEGORY_DEBUG)) {
&& debug_should_output(DEBUG_LEVEL_TRACE, DEBUG_CATEGORY_VIDEO)) {
int diagnostic = 0;
if (!m->headersAttempted) {
m->headersAttempted = true;
@@ -475,7 +475,7 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
m->headers->time_base_in = m->codec->time_base;
diagnostic = av_bsf_init(m->headers);
}
if (diagnostic >= 0) CODEC_LOG(DEBUG_LEVEL_INFO, DEBUG_CATEGORY_DEBUG,
if (diagnostic >= 0) CODEC_LOG(DEBUG_LEVEL_INFO, DEBUG_CATEGORY_VIDEO,
"HEVC KEY header diagnostics enabled name=%s; slice_QP=26+init_qp_minus26+slice_qp_delta",
qPrintable(m->name));
}
@@ -530,7 +530,7 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
auto& frameMax = producedKey ? m->keyMax : m->deltaMax;
frameMax = std::max(frameMax, totalUs);
if (totalUs > 100000 && !m->slowReported) {
CODEC_LOG(DEBUG_LEVEL_WARN, DEBUG_CATEGORY_DEBUG,
CODEC_LOG(DEBUG_LEVEL_WARN, DEBUG_CATEGORY_VIDEO,
"video encoder slow frame name=%s size=%dx%d pts=%llu key=%d requested_key=%d "
"total_us=%lld prepare_us=%lld submit_us=%lld drain_us=%lld",
qPrintable(m->name), m->config.width, m->config.height, (unsigned long long)pts, producedKey, key,
@@ -538,7 +538,7 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
m->slowReported = true;
}
if (m->reportTimer.elapsed() >= 1000) {
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG,
DEBUG_DEBUG(DEBUG_CATEGORY_VIDEO,
"video encoder flow name=%s size=%dx%d bitrate=%d interval_us=%lld inputs=%u outputs=%u keys=%u "
"prepare_max_us=%lld submit_max_us=%lld drain_max_us=%lld key_max_us=%lld delta_max_us=%lld pending=%zu pts=%llu",
qPrintable(m->name), m->config.width, m->config.height, m->config.bitrate,
@@ -619,7 +619,7 @@ bool LiveVideoEncoder::setMaxQp(int qp) {
qPrintable(m->name), qp, qPrintable(m->error)); return false;
}
m->codec->qmin = 0; m->codec->qmax = qp;
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "desktop live QP ceiling requested name=%s qp=%d", qPrintable(m->name), qp);
DEBUG_DEBUG(DEBUG_CATEGORY_VIDEO, "desktop live QP ceiling requested name=%s qp=%d", qPrintable(m->name), qp);
return true;
#else
return false;
+1 -1
View File
@@ -816,7 +816,7 @@ void MainWindow::showStreamPublisher(quint64 group, StreamGridWindow* returnTo)
(unsigned long long)group, returnTo != nullptr);
m_streamPublishWindow->show(); m_streamPublishWindow->raise(); m_streamPublishWindow->activateWindow();
qint64 shownUs = elapsed.nsecsElapsed() / 1000;
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG,
DEBUG_DEBUG(DEBUG_CATEGORY_STREAM,
"desktop publisher UI group=%llx active=%d return_to_grid=%d engine_us=%lld remove_us=%lld construct_us=%lld show_us=%lld total_us=%lld",
(unsigned long long)group, m_streamPublisher->active(), returnTo != nullptr, (long long)engineUs,
(long long)(removedUs - engineUs), (long long)(constructedUs - removedUs),