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

Some parameters having defaults differing from AMF docs and missing options to toggle them? #112

Closed
DimkaTsv opened this issue Sep 13, 2024 · 4 comments

Comments

@DimkaTsv
Copy link

DimkaTsv commented Sep 13, 2024

Used command: C:\Users\-----\Videos\test sample>C:\Users\DimkaTsv\Desktop\Utilites\VCE_Encoder\VCEEncC_x64\\VCEEncC64.exe -i "C:\Users\-----\Videos\test sample\out420.mkv" -o "out420_processed.mkv" --codec av1 --preset slower --vbr 35000 --audio-copy

Unexpected result:

--------------------------------------------------------------------------------
out420_processed.mkv
--------------------------------------------------------------------------------
VCEEnc (x64) 8.23 (r1710) by rigaya, Jul 18 2024 12:57:57 (VC 1940/Win)
OS:            Windows 11 x64 (22631) [UTF-8]
CPU:           AMD Ryzen 7 5800X3D 8-Core Processor [4.45GHz] (8C/16T)
GPU:           AMD Radeon RX 7800 XT [32.0.11037.4004]
AMF:           Runtime 1.4.34 / SDK 1.4.34
Input Info:    avsw: libdav1d(yv12)->nv12 [AVX2], 1512x614, 30/1 fps
Output:        AV1  main @ Level 5.2
               1512x614p 0:0 30.000fps (30/1fps)
               avwriter: av1 => matroska
Quality:       slower
VBR:           35000 kbps
Max bitrate:   52500 kbps
QP:            Min: 1:1, Max: 255:255
VBV Bufsize:   35000 kb
Pre Analysis:  off
Ref frames:    2 frames
LTR frames:    0 frames
Motion Est:    full-pel
Tiles:         1
GOP Len:       300 frames
Temporal Lyrs: 1
ScreenContent: on,palette-mode off, force-integer-mv off
Others:        skipframe:on deblock aq:off cdef:on cdf-update:on cdf-frame-end-update:on

encoded 160 frames, 170.03 fps, 798.85 kbps, 0.51 MB
encode time 0:00:00, CPULoad: 0.4%
frame type IDR   1
frame type I     1,  total size  0.05 MB
frame type P   159,  total size  0.46 MB

Potential issues:

--screen-content is enabled by default for AV1 specifically. And yet, palette-mode and force-integer-mv are both disabled at the same time.
[I assume it should be disabled by default, same as for other encoders?]

--cdf-update is enabled by default and cannot be disabled due to lack of the flag (or boolean value)
[In AMF documentation disabled by default]

--cdf-frame-end-update is enabled by default and cannot be disabled due to the lack of flag (or boolean value)
[In AMF documentation disabled by default... Which is kinda funny, as value to enable it is called AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_ENABLE_DEFAULT, but it is NOT actual default]

Also, how do b-frames related options interact with AV1? Afaik, AV1 does not use I:P:B frame division. And based on quick testing, while VCEEnc parses your inputs and even warns you if --bframes>3, these options had no effect on output.


Now for other options. I recently noticed that AMF docs say that temporal layers are also available for HEVC. Is there reason why VCEEnc only applies them for AV1 only? Granted i don'tsee those parameters in TranscodeHW, so maybe they are related to something else?

https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/doc/AMF_Video_Encode_HEVC_API.md#227-svc-properties
[AMF_VIDEO_ENCODER_HEVC_MAX_NUM_TEMPORAL_LAYERS
Values: 1 … Maximum number of temporal layers supported]
[AMF_VIDEO_ENCODER_HEVC_NUM_TEMPORAL_LAYERS
Values: 1 … Maximum number of temporal layers supported]

@DimkaTsv DimkaTsv changed the title AV1 specific parameters having incorrect defaults and missing options to toggle them? Some parameters having defaults differing from AMF docs and missing options to toggle them? Sep 14, 2024
@DimkaTsv
Copy link
Author

DimkaTsv commented Oct 6, 2024

Will also throw that --skip-frame is always on by default for some reason, even though by VCEEnc docs it supposed to be off by default.

@DimkaTsv
Copy link
Author

DimkaTsv commented Oct 6, 2024

Will also throw suggestion.
Based on AMF docs? implementation? --filler argument does not actually apply unless --enforce-hrd is specified separately (aka it MUST be enabled explicitly). Meaning that just to make CBR into actual CBR you must write both arguments.

Wouldn't it be better if --filler flag automatically enabled --enforce-hrd?

rigaya added a commit that referenced this issue Dec 6, 2024
なぜかそうしないと使えないらしい。
@rigaya
Copy link
Owner

rigaya commented Dec 10, 2024

Thank you for various reports, VCEEnc 8.24 has fixes for the items mentioned in this issue.

--cdf-update / --cdf-frame-end-update

Many options has default value as "auto" (when unspecified), which means the value will be selected by the driver depending on the preset or encode mode used.

Therefore, it is not strange that the option is enabled even if the option is not set. For those options in "--xxx" (such as --cdf-update, --cdf-frame-end-update) form which the default value is "auto" (when unspecified), you can use the undocumented "--no-xxx" (such as --no-cdf-update, --no-cdf-frame-end-update) if you really want to force to disable them.

--screen-content is enabled by default for AV1 specifically. And yet, palette-mode and force-integer-mv are both disabled at the same time.

They are all "auto" by default. You can use --screen-content-tools palette-mode=on/off,force-integer-mv=on/off to specify the value, if you dislike the auto set params.

temporal layers

Added HEVC support in VCEEnc 8.24.

Will also throw that --skip-frame is always on by default for some reason

It was a bug in the log printing, fixed in VCEEnc 8.24.

--filler argument does not actually apply unless --enforce-hrd is specified separately.

Applied in VCEEnc 8.24.

@DimkaTsv
Copy link
Author

Can confirm auto on default options resulting into aligning to AMF documentation defaults.

Therefore, it is not strange that the option is enabled even if the option is not set. For those options in "--xxx" (such as --cdf-update, --cdf-frame-end-update) form which the default value is "auto" (when unspecified), you can use the undocumented "--no-xxx" (such as --no-cdf-update, --no-cdf-frame-end-update) if you really want to force to disable them.

I see... Should they be undocumented?
It's not like they have logical method to be constructed. (Meaning that they will be basically impossible to be figured out by user)

Can confirm HEVC --temporal-layers option working.
Even though it isn't reflected in output, and in PSNR graph, there is definitely difference in output file hash, so it does change something in the end.

Can confirm skip-frame output reporting off by default now.

Can confirm --filler option now working by enabling --enforce-hrd automatically!

..........

I guess issue can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants