Closed Shhiva5 closed 3 months ago
AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME
is the only parameter that controls the number of slices for the HEVC encoder.
Do you intend to try to keep the size of each slice constant which results in larger compressed frames being split into more slices than smaller compressed frames? Could you please clarify your use case so that we may consider it for possible future improvements?
Hi, sorry for delayed response. Yes. We are exploring a mode in which all slices are of similar size. Larger compressed frames should be split into more number of slices. We are potentially working on an application which would need equivalent packet sizes for streaming. It would be great if this mode can be supported. Other thing on this is, if this mode is supported, we would need an mechanism to detect last slice of the frame from encoder return codes. This will be needed because the number of slices for any frame will be variable for this mode of operation.
Thank you for providing the additional information. AMF does not currently have a mode to output slices of a constant size but we will consider this for the future.
AMF does currently provide a way to identify the last slice. AMF_VIDEO_ENCODER_OUTPUT_BUFFER_TYPE
will identify the last slice in the frame after slice output has been enabled with AMF_VIDEO_ENCODER_OUTPUT_MODE
.
Additionally and somewhat related, AMF does have the ability to limit frame size using AMF_VIDEO_ENCODER_MAX_AU_SIZE
to keep the network bitrate constant. This is not the same as limiting the size of each slice which you were originally looking for but it may help.
AMF version : 1.4.30 AMD GPU Hardware : Radeon RX 6800 XT Encoder : HEVC
To set number of slices per frame : res = pEncoder->SetProperty(AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME, numOfSlicesPerFrame);
"AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME" is used to set number of slices per frame. Is there any way to set slices based on number of bits? If this is possible, please suggest the parameter to be used.