Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -594,14 +594,20 @@ void CWelsH264SVCEncoder::UpdateStatistics (const int64_t kiCurrentFrameTs, EVid · 593 unmodified lines | ||
| 594 | 594 | kiTimeDiff); |
| 595 | 595 | pStatistics->uiBitRate = static_cast<unsigned int> ((m_pEncContext->iTotalEncodedBytes - |
| 596 | 596 | m_pEncContext->iLastStatisticsBytes) * 8 * 1000 / kiTimeDiff); |
| 597 | − } | |
| 598 | 597 | |
| 599 | − if (m_pEncContext->pSvcParam->iRCMode == RC_QUALITY_MODE || m_pEncContext->pSvcParam->iRCMode == RC_BITRATE_MODE) { | |
| 600 | − if ((pStatistics->fLatestFrameRate > 0) | |
| 601 | − && WELS_ABS (m_pEncContext->pSvcParam->fMaxFrameRate - pStatistics->fLatestFrameRate) > 5) { | |
| 598 | + if (WELS_ABS (pStatistics->fLatestFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) { | |
| 602 | 599 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 603 | − "Actual Input Framerate %f is different from framerate in setting %f, suggest to use other rate control modes", | |
| 604 | − pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate); | |
| 600 | + "Actual input fLatestFrameRate = %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms), cur_Ts = %" PRId64 " start_Ts = %" PRId64, | |
| 601 | + pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate, kiCurrentFrameTs, static_cast<int64_t> (pStatistics->iStatisticsTs) ); | |
| 602 | + } | |
| 603 | + | |
| 604 | + if (m_pEncContext->pSvcParam->iRCMode == RC_QUALITY_MODE || m_pEncContext->pSvcParam->iRCMode == RC_BITRATE_MODE) { | |
| 605 | + if ((pStatistics->fLatestFrameRate > 0) | |
| 606 | + && WELS_ABS (m_pEncContext->pSvcParam->fMaxFrameRate - pStatistics->fLatestFrameRate) > 5) { | |
| 607 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | |
| 608 | + "Actual input framerate %f is different from framerate in setting %f, suggest to use other rate control modes", | |
| 609 | + pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate); | |
| 610 | + } | |
| 605 | 611 | } |
| 606 | 612 | } |
| 607 | 613 | |
| @@ -616,18 +622,17 @@ void CWelsH264SVCEncoder::UpdateStatistics (const int64_t kiCurrentFrameTs, EVid · 8 unmodified lines | ||
| 616 | 622 | if (m_pEncContext->iStatisticsLogInterval > 0) { |
| 617 | 623 | const int64_t kiTimeDiff = kiCurrentFrameTs - m_pEncContext->iLastStatisticsLogTs; |
| 618 | 624 | if ((kiTimeDiff > m_pEncContext->iStatisticsLogInterval) || (0 == pStatistics->uiInputFrameCount % 300)) { |
| 619 | − | |
| 620 | 625 | if (WELS_ABS (pStatistics->fAverageFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) { |
| 621 | 626 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 622 | − "Actual Input Framerate %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms)", | |
| 623 | − pStatistics->fAverageFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate); | |
| 627 | + "Actual input framerate fAverageFrameRate = %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms), start_Ts = %" PRId64, | |
| 628 | + pStatistics->fAverageFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate, m_pEncContext->uiStartTimestamp); | |
| 624 | 629 | } |
| 625 | 630 | |
| 626 | 631 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 627 | 632 | "EncoderStatistics: %dx%d, SpeedInMs: %f, fAverageFrameRate=%f, " |
| 628 | 633 | "LastFrameRate=%f, LatestBitRate=%d, LastFrameQP=%d, uiInputFrameCount=%d, uiSkippedFrameCount=%d, " |
| 629 | 634 | "uiResolutionChangeTimes=%d, uIDRReqNum=%d, uIDRSentNum=%d, uLTRSentNum=NA, iTotalEncodedBytes=%" PRId64 |
| 630 | − "at Ts = %" PRId64, | |
| 635 | + " at Ts = %" PRId64, | |
| 631 | 636 | pStatistics->uiWidth, pStatistics->uiHeight, |
| 632 | 637 | pStatistics->fAverageFrameSpeedInMs, pStatistics->fAverageFrameRate, |
| 633 | 638 | pStatistics->fLatestFrameRate, pStatistics->uiBitRate, pStatistics->uiAverageFrameQP, |