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

[Request]: <2 pass encoding hevc, and avc> #318

Closed
LuisB79 opened this issue May 29, 2022 · 5 comments
Closed

[Request]: <2 pass encoding hevc, and avc> #318

LuisB79 opened this issue May 29, 2022 · 5 comments

Comments

@LuisB79
Copy link

LuisB79 commented May 29, 2022

Allow for 2 pass encoding using hw acceleration

@rhutsAMD
Copy link
Collaborator

  1. AMF_VIDEO_ENCODER_PREENCODE_ENABLE / AMF_VIDEO_ENCODER_HEVC_PREENCODE_ENABLE
    Enables or disables rate control pre-analysis, disabled by default.
    When it is enabled, the encoder will lookahead for 1 frame and encode it with ¼ resolution at first. The second pass will use the result from the first encoding pass and will optimize the rate control settings in the second pass encoding.

  2. AMF_VIDEO_ENCODER_HIGH_MOTION_QUALITY_BOOST_ENABLE / AMF_VIDEO_ENCODER_HEVC_HIGH_MOTION_QUALITY_BOOST_ENABLE
    Enables high motion quality boost mode. It pre-analyzes the motion of the video and uses the information for better encoding.
    When it is enabled, the encoder will lookahead for 1 frame and encode it with ¼ resolution at first. The second pass will use the result from the first encoding pass and will optimize the motion search in the second pass encoding.

Both options can be enabled simultaneously. The total overhead from both features being enabled simultaneously is less than the sum of each feature enabled individually.

@cs9kc
Copy link

cs9kc commented Jun 5, 2022

2. Enables high motion quality boost mode. It pre-analyzes the motion of the video and uses the information for better encoding.

Hi @rhutsAMD! In the documentation for the PreAnalysis module, it is listed that VBAQ and PREENCODE are disabled when the PA module is enabled.

Given that High Quality Motion Boost appears to work in a similar way to PREENCODE, does enabling the PA module also disable High Quality Motion Boost, too?

Thanks!

@MikhailAMD
Copy link
Collaborator

PA (AMF_VIDEO_ENCODER_PRE_ANALYSIS_ENABLE) feature enables pre-analyze of the input video and allows user to enable some PA features listed in table 1. It also allows user to enables some other feature such as:
AMF_VIDEO_ENCODER_ADAPTIVE_MINIGOP
Or AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD = QVBR, HQVBR or HQCBR.

PA will add extra latency so it is recommended to enable only under these rate control methods: AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD = VBR or QVBR, HQVBR or HQCBR.
PA can work with pre-encode assisted rate control (AMF_VIDEO_ENCODER_PREENCODE_ENABLE) and extended 2 pass motion search (AMF_VIDEO_ENCODER_HIGH_MOTION_QUALITY_BOOST_ENABLE). Thanks for pointing out this issue and we will update our documents in the near future.

@cs9kc
Copy link

cs9kc commented Jun 7, 2022

Excellent! Thank you for the information!

Or AMF_VIDEO_ENCODER_RATE_CONTROL_METHOD = QVBR, HQVBR or HQCBR.

I don't even see HQVBR nor HQCBR in the code, yet. I would love to know more about them in the upcoming documentation, too (including which int that each lives in, for both AVC and HEVC, if possible). <3

Page 5 over in https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/doc/AMF_Video_PreAnalysis_API.pdf will need to be updated as well, it seems

In the current release, the PA feature is only supported when operating in PEAK_CONSTRAINED_VBR rate control
mode. PA is automatically disabled in other rate control modes. PA cannot work with pre-encode assisted rate
control (AMF_VIDEO_ENCODER_PREENCODE_ENABLE) and VBAQ (AMF_VIDEO_ENCODER_ENABLE_VBAQ) features.
When PA is enabled, pre-encode assisted rate control and VBAQ settings are ignored.

If there is a better method that you all would like me to provide feedback on documentation, I can oblige if you all wish. I am part of Vanguard as well, if that is a method you would like to communicate through.

@LuisB79
Copy link
Author

LuisB79 commented Jun 15, 2022

Closing this out of relevance.

@LuisB79 LuisB79 closed this as completed Jun 15, 2022
@LuisB79 LuisB79 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants