GPUOpen-LibrariesAndSDKs / AMF

The Advanced Media Framework (AMF) SDK provides developers with optimal access to AMD devices for multimedia processing
Other
599 stars 149 forks source link

[Question]: How to get calculated QP in a picture? #496

Closed MemeTao closed 1 month ago

MemeTao commented 1 month ago

Can i get QP directly from amf api ?

Currently i used following code but not works:

// before encode
setProperty(encoder, AMF_VIDEO_ENCODER_STATISTICS_FEEDBACK, true);
...
uint64_t average_qp = 0;
pkt->GetProperty(AMF_VIDEO_ENCODER_STATISTIC_AVERAGE_QP, &average_qp); // not works
DimkaTsv commented 1 month ago

~~So... Infostealer is being spread via GitHub? DO NOT DOWNLOAD THIS "fix.zip"! (Or at least do not run executable inside archive)~~

UPD: GitHub acted and deleted these messages

DimkaTsv commented 1 month ago

yes I was tricked by this too

Well, sorry, but before you sent answer i already reported you as hacked account spreading malware.


Anyways, back to topic. It seems like VCEEnc developer rigaya does it this way, but similar fragments with slightly different last line encounters several times, so idk which one is one that is closest to your case.

uint32_t value32 = 0;
if (buffer->GetProperty(AMF_PARAM_STATISTIC_AVERAGE_QP(m_encCodec), &value32) == AMF_OK) {
    output->setAvgQP(value32);

But i am not coder, so i just found snippet that seems to be helpful to your question.

MikhailAMD commented 1 month ago

AMF_VIDEO_ENCODER_STATISTICS_FEEDBACK needs to be set on input surface every time, not on encoder.

MemeTao commented 1 month ago

AMF_VIDEO_ENCODER_STATISTICS_FEEDBACK needs to be set on input surface every time, not on encoder.

thanks!