rigaya / VCEEnc

VCEによる高速エンコードの性能実験

Home Page:https://rigaya34589.blog.fc2.com/blog-category-12.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

While using "--vpp-resize amf_point" argument upscaler video stream gets broken to green screen.

DimkaTsv opened this issue · comments

Issue: When using "--vpp-resize amf_point" argument, upscaled video stream gets broken to green screen and basically no bitrate. This doesn't happen with any other type of upscaling, only amf_point. Issue appears even with latest Adrenaline 23.11.1 and both VCEEncC 8.16 and 8.17

Expected behaviour: video stream should be processed properly.

Used command (as drag and drop on top of .bat file):

%~dp0\VCEEncC64.exe -i %1 -o "%~n1_processed%~x1" --codec hevc --profile main --tier high --level 6.2 --preset slow --ref 4 --ltr 3 --vbr 10000 --max-bitrate 15000 --audio-copy --chapter-copy --vpp-resize amf_point --output-res 3840x2160 --log vceencc_log.txt --log-level info
pause

Log file of VCEEncC:
vceencc_log.txt

Resulting video:

General
Complete name                  : C:\Users\-----\Videos\test sample\Aion The Tower of Eternity_2023.10.07-19.06_processed.mp4
Format                         : MPEG-4
Format profile                 : Base Media / Version 2
Codec ID                       : mp42 (mp42/iso2/mp41)
File size                      : 1.46 MiB
Duration                       : 25 s 500 ms
Overall bit rate               : 479 kb/s
Frame rate                     : 60.000 FPS
Writing application            : VCEEnc (x64) 8.17

Video
ID                             : 1
Format                         : HEVC
Format/Info                    : High Efficiency Video Coding
Format profile                 : Main@L6.2@High
Codec ID                       : hvc1
Codec ID/Info                  : High Efficiency Video Coding
Duration                       : 25 s 500 ms
Bit rate                       : 153 kb/s
Maximum bit rate               : 200 kb/s
Width                          : 3 840 pixels
Height                         : 2 160 pixels
Display aspect ratio           : 16:9
Frame rate mode                : Constant
Frame rate                     : 60.000 FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0
Bit depth                      : 8 bits
Scan type                      : Progressive
Bits/(Pixel*Frame)             : 0.000
Stream size                    : 475 KiB (32%)
Color range                    : Limited
Codec configuration box        : hvcC

Audio
ID                             : 2
Format                         : AAC LC
Format/Info                    : Advanced Audio Codec Low Complexity
Codec ID                       : mp4a-40-2
Duration                       : 25 s 408 ms
Bit rate mode                  : Constant
Bit rate                       : 318 kb/s
Channel(s)                     : 2 channels
Channel layout                 : L R
Sampling rate                  : 48.0 kHz
Frame rate                     : 46.875 FPS (1024 SPF)
Compression mode               : Lossy
Stream size                    : 987 KiB (66%)
Default                        : Yes
Alternate group                : 1

image

If issue is related to AMF, just state it, i will redirect bug report to them (they already fixed 2 AMF bugs i reported)
There are 2 more questions about upscaling option.
Also @rigaya sorry for directly tagging you, but this question can only be answered by you as developer?

  1. What specific AMF FSR upscaling command amf_fsr option refers to? AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_0 or AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1? I assume there should be quality difference between them?
  2. Is there any way to set upscaler sharpness through VCEEncC? Question rises because AMF allows it through using AMF_HQ_SCALER_SHARPNESS, but i don't see similar option here? AMF specifies default value as 0.5 and VCEEncC shows that it is set to 0.0 instead. If there isn't, can such feature be implemented?

I also could not make amf_point work properly, I decided to remove it from the help and documents in VCEEnc 8.18.

If issue is related to AMF, just state it

I cannot say whether it is AMF related issue, although I think there is probably no problem in my app as other mode such as amf_fsr works fine, I can never say for certain there is no bug in my app.

amf_fsr option

It uses AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_0.

AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1

Seems to not work, as the same as amf_point. Although not documented, you can select it by amf_fsr_11 from VCEEnc 8.18.

Is there any way to set upscaler sharpness through VCEEncC?

Although not documented, you can use --vpp-scaler-sharpness <float>, but it seems to not work at this time. I'm not sure if it is a bug in the app or simply not yet supported in AMF.

Note
I will keep non-documented options only for experimentation, but will not go into it further at this time.

Seems to not work, as the same as amf_point. Although not documented, you can select it by amf_fsr_11 from VCEEnc 8.18.

Hmm, i should report amf_point issue to AMF repo issue list then. Maybe they will either fix issue if it is on their side, or explain more of a problem... I created separate folder with VCEEncC 8.17 with fixed .bat call just for future testing of amf_point explicitly.

Also thanks for that addition (fsr_11), and i can understand why it won't be in documentation for now. Tried myself, video also resulted in green screen, but unlike amf_point where i have no clue about root of the issue, amf_fsr_11 call got me this error
[AMFHQScalerImpl] 2023-11-09 20:53:28.215 54E0 [AMFHQScalerImpl] Error: ..\..\..\..\..\runtime\src\components\HQScaler\AMFHQScalerImpl.cpp(1096):Assertion failed:YUV input not supported for VideoSR1.1
Meaning this upscaler option cannot understand YUV for some reason? Well they state in documentation that scaler is supposed to work with these formats: BRGA, NV12, RGBA, R10G10B10A2, RGBA_F16, P010. And YUV 4:2:0 is basically NV12, isn't it? I also cannot even find this file in neither VCEEncC nor AMF repos to reference.

vceencc_log_fsr11.txt

Also tried sharpness scalar. Well, on VCEEncC level command works and it reports change in synthesized line
HQscaler: HQscaler: 1920x1080 -> 3840x2160, fsr, sharpness 1.5
But right before this line i also found error in logs related to sharpness... What does invalid argument mean in this case? Incorrect call to function?
[PropertyStorageExImpl] 2023-11-09 20:43:58.993 2304 [PropertyStorageExImpl] Error: c:\constructicon\builds\gfx\six\23.20\drivers\amf\stable\public/common/PropertyStorageExImpl.h(277):AMF_ERROR 4 : AMF_INVALID_ARG: Property=HQScalerSharpness

vceencc_log_sharpness.txt

Sharpness error also appeared in every other log (well, as defaults must be stated anyways)

Created issue in AMF repository.
GPUOpen-LibrariesAndSDKs/AMF#427
Will see response. It is possible that issue is on their side
I also mentioned about videosr_1.1 YUV error, maybe they will clarify reason

I finally found ways to make vpp-scaler-sharpness work fine, it should now have effect on amf_fsr at VCEEnc 8.19.

I finally found ways to make vpp-scaler-sharpness work fine, it should now have effect on amf_fsr at VCEEnc 8.19.

Can confirm --vpp-scaler-sharpness working in VCEEncC 8.19. Also can confirm that it ONLY works for amf_fsr upscaling (tested through hash checks of resulting samples at 0.0 and 2.0 sharpness scalers). Changed context question in AMF repo to reflect current situation.

But calling amf_bilinear and amf_bicubic still show that there is sharpness parameter to them, which will change from calling --vpp-scaler-sharpness but won't do anything. It is just confusing for people who rely on parameter output screen for getting feedback on their actions.
I am talking about this line in output window, which shows sharpness existing for both fsr and amf_bicubic (and amf_bilinear)
VPP HQscaler: 1920x1080 -> 3840x2160, fsr, sharpness 1.0
VPP HQscaler: 1920x1080 -> 3840x2160, bicubic, sharpness 1.0

That said, i am now asking AMF maintainers if other modes of amf upscaling (besides fsr) are supposed to interact with their sharpness scaler, or not, so i guess we can just wait a bit on this bicubic and bilinear stuff in output window.

Also can confirm that it ONLY works for amf_fsr upscaling

Yes, as I have written, it seems to take effect only on amf_fsr (or maybe amf_fsr_11 also in the future).

But calling amf_bilinear and amf_bicubic still show that there is sharpness parameter

Oh, I haven't cared about that, it's simply always printed. Thank you for updating AMF repo, I'll wait till we know if it should take effect on bicubic and bilinear.

I created separate folder with VCEEncC 8.17 with fixed .bat call just for future testing of amf_point explicitly.

I forgot to mention, VCEEnc 8.18 and later still accepts --vpp-resize amf_point so we can test, it's only that I removed it from the help.

AMD acknowledged a bug with point scaler, made an internal fix. Will be resolved with future driver release (which one, i won't be able to tell right now. Will write here again when i tese successful fix)

VideoSR1.1 on other hand working like intended and is unable to take YUV input (which is in line of thrown error). "The incorrect format is reason why algorithm isn't working with VCEEncC". They will update AMF documentation to reflect this. Tbh i don't know what to do with this information as i am not knowledgeable enough, but i am passing it to you.

Seems like i cannot reproduce issue with latest 23.40.19.01 driver (pre-release 24.2.1). Will wait for official release, check again, then close issue if it is not reproducible there either.

Sorry, i used flawed testing case (aka used 4k sample to upscale it to 4k, so HQScaler wasn't utilised and issue wasn't triggered.
Currently at 24.2.1 point scaler still is broken.