Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEncoderStatistics.uiAverageFrameQP always return 0 when get the encoder stats #3317

Closed
mypopydev opened this issue Jul 26, 2020 · 8 comments · Fixed by #3603
Closed

SEncoderStatistics.uiAverageFrameQP always return 0 when get the encoder stats #3317

mypopydev opened this issue Jul 26, 2020 · 8 comments · Fixed by #3603

Comments

@mypopydev
Copy link

SEncoderStatistics.uiAverageFrameQP always return 0 when get the encoder stats with option ENCODER_OPTION_GET_STATISTICS

mypopydev added a commit to mypopydev/FFmpeg that referenced this issue Jul 26, 2020
Export choosen pict_type and qp.

NOTE: now libopenh264enc always export the the average QP with
zero. And I have opened a issue for libopenh264 in
cisco/openh264#3317

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
mypopydev added a commit to mypopydev/FFmpeg that referenced this issue Jul 26, 2020
Export choosen pict_type and qp.

NOTE: now libopenh264enc always export the the average QP with
zero. And I have opened a issue for libopenh264 in
cisco/openh264#3317

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
mypopydev added a commit to mypopydev/FFmpeg that referenced this issue Jul 27, 2020
Export choosen pict_type and qp.

NOTE: now libopenh264enc always export the the average QP with
zero. And I have opened a issue for libopenh264 in
cisco/openh264#3317

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
@huili2
Copy link
Collaborator

huili2 commented Aug 11, 2020

any detailed case for this issue? Actually If the encoder is called properly, and encoding is just in the process, the return value should be true.

@mypopydev
Copy link
Author

I think uiAverageFrameQP means Average Frame QP base on Frame, but openh264enc just return 0 now

@huili2
Copy link
Collaborator

huili2 commented Aug 21, 2020

your guess is right. But it is strange that it returns 0. Any more details on how it occurs?

@mypopydev
Copy link
Author

You can try FFmpeg + Openh264enc with the patch mypopydev/FFmpeg@9f95625

@Allen1207
Copy link

Allen1207 commented Aug 28, 2020

that because the uiAverageFrameQP is not assigned when GetOption ENCODER_OPTION_GET_STATISTICS. You may add one line "pStatistics->uiAverageFrameQP = pEncStatistics->uiAverageFrameQP;" as follows to solve it:

case ENCODER_OPTION_GET_STATISTICS: {
SEncoderStatistics* pStatistics = (static_cast<SEncoderStatistics*> (pOption));
SEncoderStatistics* pEncStatistics = &m_pEncContext->sEncoderStatistics[m_pEncContext->pSvcParam->iSpatialLayerNum - 1];
pStatistics->uiWidth = pEncStatistics->uiWidth;
pStatistics->uiHeight = pEncStatistics->uiHeight;
pStatistics->fAverageFrameSpeedInMs = pEncStatistics->fAverageFrameSpeedInMs;
pStatistics->sEncMv = pEncStatistics->sEncMv;

// rate control related
pStatistics->fAverageFrameRate = pEncStatistics->fAverageFrameRate;
pStatistics->fLatestFrameRate = pEncStatistics->fLatestFrameRate;
pStatistics->uiBitRate = pEncStatistics->uiBitRate;
pStatistics->uiAverageFrameQP = pEncStatistics->uiAverageFrameQP;    //added line here

pStatistics->uiInputFrameCount = pEncStatistics->uiInputFrameCount;
pStatistics->uiSkippedFrameCount = pEncStatistics->uiSkippedFrameCount;

pStatistics->uiResolutionChangeTimes = pEncStatistics->uiResolutionChangeTimes;
pStatistics->uiIDRReqNum = pEncStatistics->uiIDRReqNum;
pStatistics->uiIDRSentNum = pEncStatistics->uiIDRSentNum;
pStatistics->uiLTRSentNum = pEncStatistics->uiLTRSentNum;

}

@mypopydev
Copy link
Author

Will try this patch, thx

mypopydev added a commit to mypopydev/FFmpeg that referenced this issue Sep 22, 2020
Export choosen pict_type and qp.

NOTE: now libopenh264enc always export the the average QP with
zero. And I have opened a issue for libopenh264 in
cisco/openh264#3317

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
@mypopydev
Copy link
Author

@huili2 can you try Allen1207's patch for this issue

@huili2
Copy link
Collaborator

huili2 commented Sep 22, 2020

I do not have code at hand, but from above code lines, I think it should be OK.

mypopydev added a commit to mypopydev/FFmpeg that referenced this issue Sep 25, 2020
Export choosen pict_type and qp.

NOTE: now libopenh264enc always export the the average QP with
zero. And I have opened a issue for libopenh264 in
cisco/openh264#3317

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@huili2 @mypopydev @Allen1207 and others