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

Is there any reference manual for the parameters of the "h264_amf" encoder in FFMPEG? #336

Open
rajhlinux opened this issue Jul 11, 2022 · 1 comment
Labels

Comments

@rajhlinux
Copy link

Hello,

I just recently able to get "h264_amf" encoder working on Arch linux and now I can not find any details of what these parameters do:

Encoder h264_amf [AMD AMF H.264 Encoder]:
    General capabilities: dr1 delay hardware 
    Threading capabilities: none
    Supported hardware devices: d3d11va d3d11va dxva2 dxva2 
    Supported pixel formats: nv12 yuv420p d3d11 dxva2_vld
h264_amf AVOptions:
  -usage             <int>        E..V....... Encoder Usage (from 0 to 3) (default transcoding)
     transcoding     0            E..V....... Generic Transcoding
     ultralowlatency 1            E..V....... 
     lowlatency      2            E..V....... 
     webcam          3            E..V....... Webcam
  -profile           <int>        E..V....... Profile (from 66 to 257) (default main)
     main            77           E..V....... 
     high            100          E..V....... 
     constrained_baseline 256          E..V....... 
     constrained_high 257          E..V....... 
  -level             <int>        E..V....... Profile Level (from 0 to 62) (default auto)
     auto            0            E..V....... 
     1.0             10           E..V....... 
     1.1             11           E..V....... 
     1.2             12           E..V....... 
     1.3             13           E..V....... 
     2.0             20           E..V....... 
     2.1             21           E..V....... 
     2.2             22           E..V....... 
     3.0             30           E..V....... 
     3.1             31           E..V....... 
     3.2             32           E..V....... 
     4.0             40           E..V....... 
     4.1             41           E..V....... 
     4.2             42           E..V....... 
     5.0             50           E..V....... 
     5.1             51           E..V....... 
     5.2             52           E..V....... 
     6.0             60           E..V....... 
     6.1             61           E..V....... 
     6.2             62           E..V....... 
  -quality           <int>        E..V....... Quality Preference (from 0 to 2) (default speed)
     speed           1            E..V....... Prefer Speed
     balanced        0            E..V....... Balanced
     quality         2            E..V....... Prefer Quality
  -rc                <int>        E..V....... Rate Control Method (from -1 to 3) (default -1)
     cqp             0            E..V....... Constant Quantization Parameter
     cbr             1            E..V....... Constant Bitrate
     vbr_peak        2            E..V....... Peak Contrained Variable Bitrate
     vbr_latency     3            E..V....... Latency Constrained Variable Bitrate
  -enforce_hrd       <boolean>    E..V....... Enforce HRD (default false)
  -filler_data       <boolean>    E..V....... Filler Data Enable (default false)
  -vbaq              <boolean>    E..V....... Enable VBAQ (default false)
  -frame_skipping    <boolean>    E..V....... Rate Control Based Frame Skip (default false)
  -qp_i              <int>        E..V....... Quantization Parameter for I-Frame (from -1 to 51) (default -1)
  -qp_p              <int>        E..V....... Quantization Parameter for P-Frame (from -1 to 51) (default -1)
  -qp_b              <int>        E..V....... Quantization Parameter for B-Frame (from -1 to 51) (default -1)
  -preanalysis       <boolean>    E..V....... Pre-Analysis Mode (default false)
  -max_au_size       <int>        E..V....... Maximum Access Unit Size for rate control (in bits) (from 0 to INT_MAX) (default 0)
  -header_spacing    <int>        E..V....... Header Insertion Spacing (from -1 to 1000) (default -1)
  -bf_delta_qp       <int>        E..V....... B-Picture Delta QP (from -10 to 10) (default 4)
  -bf_ref            <boolean>    E..V....... Enable Reference to B-Frames (default true)
  -bf_ref_delta_qp   <int>        E..V....... Reference B-Picture Delta QP (from -10 to 10) (default 4)
  -intra_refresh_mb  <int>        E..V....... Intra Refresh MBs Number Per Slot in Macroblocks (from 0 to INT_MAX) (default 0)
  -coder             <int>        E..V....... Coding Type (from 0 to 2) (default auto)
     auto            0            E..V....... Automatic
     cavlc           2            E..V....... Context Adaptive Variable-Length Coding
     cabac           1            E..V....... Context Adaptive Binary Arithmetic Coding
  -me_half_pel       <boolean>    E..V....... Enable ME Half Pixel (default true)
  -me_quarter_pel    <boolean>    E..V....... Enable ME Quarter Pixel (default true)
  -aud               <boolean>    E..V....... Inserts AU Delimiter NAL unit (default false)
  -log_to_dbg        <boolean>    E..V....... Enable AMF logging to debug output (default false)

For example, what is "Profile Level" why does it have so many numbers to choose from?

Another example, what exactly is "Latency Constrained Variable Bitrate"?

Google does not show any searches on this.

Thanks.

@rhutsAMD
Copy link
Collaborator

“Profile Level” is an H.264 concept to help specify the maximum data rate and video resolution that a device can use. There is a chart on the Wikipedia page for the H.264 codec with details for each level.
https://en.wikipedia.org/wiki/Advanced_Video_Coding#Levels

"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.

Details on some more AMF encoding properties can be found here:
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/doc/AMF_Video_Encode_API.pdf

psyke83 added a commit to psyke83/sunshine that referenced this issue Nov 7, 2022
The AMD encoder's RC options other than "vbr_latency" are not suitable
for livestreaming.

Ref: GPUOpen-LibrariesAndSDKs/AMF#336 (comment)
'"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.'

Testing with RX 570 on Windows 10, Moonlight-qt client @ 768p / 50Mbps:
* auto: bitrate fails to exceed ~10Mb/s
* const cq: bitrate fails to exceed ~10Mb/s
* vbr_peak: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
* vbr_latency: avg. target bitrate is attained with no excess burst observed.
* cbr: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
psyke83 added a commit to psyke83/SunshineStream that referenced this issue Nov 7, 2022
The AMD encoder's RC options other than "vbr_latency" are not suitable
for livestreaming.

Ref: GPUOpen-LibrariesAndSDKs/AMF#336 (comment)
'"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.'

Testing with RX 570 on Windows 10, Moonlight-qt client @ 768p / 50Mbps:
* auto: bitrate fails to exceed ~10Mb/s
* constqp: bitrate fails to exceed ~10Mb/s
* vbr_peak: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
* vbr_latency: avg. target bitrate is attained with no excess burst observed.
* cbr: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
psyke83 added a commit to psyke83/SunshineStream that referenced this issue Nov 7, 2022
The AMD encoder's RC options other than "vbr_latency" are not suitable
for livestreaming.

Ref: GPUOpen-LibrariesAndSDKs/AMF#336 (comment)
'"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.'

Testing with RX 570 on Windows 10, Moonlight-qt client @ 768p / 50Mbps:
* auto: bitrate fails to exceed ~10Mb/s
* constqp: bitrate fails to exceed ~10Mb/s
* vbr_peak: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
* vbr_latency: avg. target bitrate is attained with no excess burst observed.
* cbr: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
psyke83 added a commit to psyke83/SunshineStream that referenced this issue Nov 7, 2022
The AMD encoder's RC options other than "vbr_latency" are not suitable
for livestreaming.

Ref: GPUOpen-LibrariesAndSDKs/AMF#336 (comment)
'"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.'

Testing with RX 570 on Windows 10, Moonlight-qt client @ 768p / 50Mbps:
* auto: bitrate fails to exceed ~10Mb/s
* constqp: bitrate fails to exceed ~10Mb/s
* vbr_peak: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
* vbr_latency: avg. target bitrate is attained with no excess burst observed.
* cbr: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
psyke83 added a commit to psyke83/SunshineStream that referenced this issue Nov 9, 2022
The AMD encoder's RC options other than "vbr_latency" are not suitable
for livestreaming.

Ref: GPUOpen-LibrariesAndSDKs/AMF#336 (comment)
'"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.'

Testing with RX 570 on Windows 10, Moonlight-qt client @ 768p / 50Mbps:
* auto: bitrate fails to exceed ~10Mb/s
* constqp: bitrate fails to exceed ~10Mb/s
* vbr_peak: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
* vbr_latency: avg. target bitrate is attained with no excess burst observed.
* cbr: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
psyke83 added a commit to psyke83/SunshineStream that referenced this issue Nov 9, 2022
The AMD encoder's RC options other than "vbr_latency" are not suitable
for livestreaming.

Ref: GPUOpen-LibrariesAndSDKs/AMF#336 (comment)
'"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.'

Testing with RX 570 on Windows 10, Moonlight-qt client @ 768p / 50Mbps:
* auto: bitrate fails to exceed ~10Mb/s
* constqp: bitrate fails to exceed ~10Mb/s
* vbr_peak: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
* vbr_latency: avg. target bitrate is attained with no excess burst observed.
* cbr: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
psyke83 added a commit to psyke83/SunshineStream that referenced this issue Nov 17, 2022
The AMD encoder's RC options other than "vbr_latency" are not suitable
for livestreaming.

Ref: GPUOpen-LibrariesAndSDKs/AMF#336 (comment)
'"Latency Constrained Variable Bitrate" is a rate control method. It is used when low latency is required. This tries to reduce the encoder latency as much as possible and is useful in scenarios such as game streaming.'

Testing with RX 570 on Windows 10, Moonlight-qt client @ 768p / 50Mbps:
* auto: bitrate fails to exceed ~10Mb/s
* constqp: bitrate fails to exceed ~10Mb/s
* vbr_peak: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
* vbr_latency: avg. target bitrate is attained with no excess burst observed.
* cbr: avg. target bitrate is attained, but peak rate bursts up to 140Mbps
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