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

[Question]: <AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD_CBR bitrate is higher then target bitrate> #315

Open
xiaozhilaoliu opened this issue May 23, 2022 · 18 comments
Labels

Comments

@xiaozhilaoliu
Copy link

xiaozhilaoliu commented May 23, 2022

params is below:
AMF_VIDEO_ENCODER_PEAK_BITRATE : 545 x1000
AMF_VIDEO_ENCODER_TARGET_BITRATE:545x1000
qp: min/max = 0/51

my problem is:
encoder output bitrate is higher then 545 x1000;explem: 1440 x1000 .....

image

@MikhailAMD
Copy link
Collaborator

What is your GPU?
Do you use the latest driver?
Try to enable AMF_VIDEO_ENCODER_FILLER_DATA_ENABLE

@xiaozhilaoliu
Copy link
Author

What is your GPU? Do you use the latest driver? Try to enable AMF_VIDEO_ENCODER_FILLER_DATA_ENABLE

thank for replay;

this is my environment :
1、Driver Version:30.0.21001.1004
2、gpu:AMD Radeon RX 6600

enable AMF_VIDEO_ENCODER_FILLER_DATA_ENABLE is useless

@MikhailAMD
Copy link
Collaborator

If you can, please share source and result clips, Also please try to repro with TranscodeHW sample.

@xiaozhilaoliu
Copy link
Author

video_local_encoded-2022-05-23-18-33-58-1-Amd-640x360.zip

this is my result;i expect :
bitrate : 485kbs
fps:15

I am based on sample development, and there are many internal implementations of coupling logic; why peak_bitrate cannot control the maximum bit rate

@MikhailAMD
Copy link
Collaborator

The clip doesn't look overcomplicated.
I have to see full set of parameters with values - preferably in a code snippet.

@xiaozhilaoliu
Copy link
Author

The clip doesn't look overcomplicated. I have to see full set of parameters with values - preferably in a code snippet.

property:LowLatencyInternal1
property:Profile66
property:RateControlPreanalysisEnable1
property:QualityPreset0
property:RateControlMethod1
property:TargetBitrate480000
property:PeakBitrate480000
property:MinQP0
property:MaxQP51
property:IDRPeriod15
property:HeaderInsertionSpacing15
property:SlicesPerFrame1
property:BReferenceEnable0
property:CABACEnable1
property:TargetBitrate485000
property:PeakBitrate485000

@MikhailAMD
Copy link
Collaborator

This is app values: how the app sees them. I would like to see how did the app sets them using AMF API, also Init() call. If you don't want to share code, enable AMF_TRACE_DEBUG log level and share debug output.

@xiaozhilaoliu
Copy link
Author

amflog.txt

@xiaozhilaoliu
Copy link
Author

amflog.txt

@MikhailAMD this is log

@MikhailAMD
Copy link
Collaborator

Hi, thanks for the log. I don't see set of AMF_VIDEO_ENCODER_FILLER_DATA_ENABLE = true. Could you please add and send log and the result stream?

@xiaozhilaoliu
Copy link
Author

thanks for replay;here is my test:
amflog.txt
video_local_encoded-2022-05-25-23-21-10-1-Amd-640x360.zip

@MikhailAMD
Copy link
Collaborator

MikhailAMD commented May 25, 2022

OK, thanks. Please try to remove set of AMF_VIDEO_ENCODER_PREENCODE_ENABLE or AMF_VIDEO_ENCODER_RATE_CONTROL_PREANALYSIS_ENABLE. This is more experimental feature, doesn't work in some cases.

@xiaozhilaoliu
Copy link
Author

PREENCODE_ENABLE

thanks for replay;
I remove set of AMF_VIDEO_ENCODER_PREENCODE_ENABLE,Problem still not solved

@MikhailAMD
Copy link
Collaborator

Please share log and output file

@xiaozhilaoliu
Copy link
Author

Please share log and output file
video_local_encoded-2022-05-27-01-01-37-1-Amd-640x360.zip
amflog.txt

@xiaozhilaoliu
Copy link
Author

Please share log and output file
video_local_encoded-2022-05-27-01-01-37-1-Amd-640x360.zip
amflog.txt

@MikhailAMD Excuse me,did you find anything suspicious?

@MikhailAMD
Copy link
Collaborator

We didn't forget :). Over weekend I consulted with codec folks. They don't see anything wrong in the log. But they cannot reproduce the issue either. So to move forward they ask you to reproduce the problem with one of AMF samples:
TranscodeHW.exe -input <input_file> -output <output_flie> -width 640 -height 360 -codec h264 -EncoderInstance 0 -Usage TRANSCODING -Profile main -ProfileLevel 50 -LowLatencyInternal true -QualityPreset speed -RateControlMethod CBR -FrameRate 15,1 -EnforceHRD true -VBVBufferSize 48000 -FillerDataEnable true -TargetBitrate 480000 -PeakBitrate 480000 -IDRPeriod 15

you can modify parameters any way you like to repro.

or
SimpleEncoder - modify it to your set of parameters and add read of raw data.

This way we could repro on our side.
Also please update to the latest driver: https://www.amd.com/en/support/graphics/amd-radeon-6000-series/amd-radeon-6600-series/amd-radeon-rx-6600

@xiaozhilaoliu
Copy link
Author

We didn't forget :). Over weekend I consulted with codec folks. They don't see anything wrong in the log. But they cannot reproduce the issue either. So to move forward they ask you to reproduce the problem with one of AMF samples: TranscodeHW.exe -input <input_file> -output <output_flie> -width 640 -height 360 -codec h264 -EncoderInstance 0 -Usage TRANSCODING -Profile main -ProfileLevel 50 -LowLatencyInternal true -QualityPreset speed -RateControlMethod CBR -FrameRate 15,1 -EnforceHRD true -VBVBufferSize 48000 -FillerDataEnable true -TargetBitrate 480000 -PeakBitrate 480000 -IDRPeriod 15

you can modify parameters any way you like to repro.

or SimpleEncoder - modify it to your set of parameters and add read of raw data.

This way we could repro on our side. Also please update to the latest driver: https://www.amd.com/en/support/graphics/amd-radeon-6000-series/amd-radeon-6600-series/amd-radeon-rx-6600

OK, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants