|
|
|
|
@ -21,6 +21,7 @@ struct LiveVideoEncoder::Impl {
|
|
|
|
|
int64_t submittedFrames = 0; |
|
|
|
|
QElapsedTimer reportTimer; |
|
|
|
|
unsigned inputs = 0, outputs = 0, keys = 0; |
|
|
|
|
bool slowReported = false; |
|
|
|
|
qint64 prepareMax = 0, submitMax = 0, drainMax = 0, keyMax = 0, deltaMax = 0; |
|
|
|
|
#ifdef HAVE_FFMPEG |
|
|
|
|
AVCodecContext* codec = nullptr; |
|
|
|
|
@ -374,6 +375,14 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
|
|
|
|
|
m->drainMax = std::max(m->drainMax, totalUs - submittedUs); |
|
|
|
|
auto& frameMax = producedKey ? m->keyMax : m->deltaMax; |
|
|
|
|
frameMax = std::max(frameMax, totalUs); |
|
|
|
|
if (totalUs > 100000 && !m->slowReported) { |
|
|
|
|
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, |
|
|
|
|
"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, |
|
|
|
|
(long long)totalUs, (long long)preparedUs, (long long)(submittedUs - preparedUs), (long long)(totalUs - submittedUs)); |
|
|
|
|
m->slowReported = true; |
|
|
|
|
} |
|
|
|
|
if (m->reportTimer.elapsed() >= 1000) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, |
|
|
|
|
"video encoder flow name=%s size=%dx%d bitrate=%d interval_us=%lld inputs=%u outputs=%u keys=%u " |
|
|
|
|
@ -383,6 +392,7 @@ bool LiveVideoEncoder::encode(const QImage& image, uint64_t pts, bool key, QList
|
|
|
|
|
(long long)m->prepareMax, (long long)m->submitMax, (long long)m->drainMax, |
|
|
|
|
(long long)m->keyMax, (long long)m->deltaMax, (unsigned long long)pts); |
|
|
|
|
m->reportTimer.restart(); m->inputs = m->outputs = m->keys = 0; |
|
|
|
|
m->slowReported = false; |
|
|
|
|
m->prepareMax = m->submitMax = m->drainMax = m->keyMax = m->deltaMax = 0; |
|
|
|
|
} |
|
|
|
|
if (key && output.isEmpty()) DEBUG_DEBUG(DEBUG_CATEGORY_VIDEO, "desktop requested KEY buffered name=%s PTS=%llu", |
|
|
|
|
|