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

AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE reports always frame type either 'NONE' or 'IDR' #473

Open MichaelLudeo opened 5 months ago

MichaelLudeo commented 5 months ago

Hi. Immediately after querying the output I am trying to read the frame type with this code:

uint32_t picType = AMF_VIDEO_ENCODER_PICTURE_TYPE_NONE;
if (outputBuffer->GetProperty(AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE, &picType) != AMF_OK)
{
    assert(0);
}

I am always getting picType equal either 0 or 2. I tried different low latency and high quality modes but same happens. I am encoding in CBR mode and setting IDR period to be the same as the frame rate:

Result = m_AmfEncoder->SetProperty(AMF_VIDEO_ENCODER_IDR_PERIOD, IdrPeriod);

where idrPeriod = fps (30).

Also, I am forcing SPS/PPS onto the first frame,but it always reports frame type 'NONE' for the first frame. I expect the sequence in GOP to look smth like this: IDR,PPPPPPPPPPPPPP... IDR. Frame sizes vary, and the output video stream is playable, so it is clearly has to do with my settings or encoder reporting wrong info.

MikhailAMD commented 5 months ago

The output frame type is reported by this property:AMF_VIDEO_ENCODER_OUTPUT_DATA_TYPE_ENUM. 0 and 2 are IDR and P

MichaelLudeo commented 5 months ago

Oh, And I am casting to AMF_VIDEO_ENCODER_PICTURE_TYPE_ENUM

MichaelLudeo commented 5 months ago

Solved. Thanks.