[Bug]: Using amf_point hqscaler function causes video stream to be corrupted into green screen
Describe the bug While using amf_point upscaling resulting video gets it's video stream compressed into constant green screen with about 155 kbps bitrate at 1080p60. All other implemented algorithms work properly (except VideoSR_1.1 which is not officially implemented yet for reason stated at
To Reproduce Steps to reproduce the behavior:
- To see it more easily, use VCEEncC as command line application for AMF. Latest available version - 8.18
- Use
--vpp-resize amf_pointparameter, also set--output-res????x???? to be upscaled. For me it is 1920x1080 source, output res was 3840x2160 (4k) - Transcode video source. (i used HEVC Adrenaline screen capture of game as source)
- Watch resulting video (i use MPC-HC, D3D11 HW acceleration). Video stream gets corrupted.
Setup
- OS: Windows 11 22H2 build 22621.2506
- Driver Version: 23.11.1
- GPU: RX 6750 XT
- Which component has the issue [e.g. Encoder, Decoder]: Encoder, presumably
Source video metadata:
General
Complete name : C:\Users\-----\Videos\test sample\Aion The Tower of Eternity_2023.10.07-19.06.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/mp41)
File size : 153 MiB
Duration : 25 s 500 ms
Overall bit rate mode : Variable
Overall bit rate : 50.3 Mb/s
Frame rate : 60.000 FPS
Writing application : Lavf59.27.100
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : [email protected]@Main
Codec ID : hev1
Codec ID/Info : High Efficiency Video Coding
Duration : 25 s 500 ms
Bit rate : 50.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 60.000 FPS
Minimum frame rate : 60.000 FPS
Maximum frame rate : 60.235 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Bits/(Pixel*Frame) : 0.402
Stream size : 152 MiB (99%)
Color range : Limited
Transfer characteristics : BT.709
Matrix coefficients : BT.709
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 409 ms
Bit rate mode : Variable
Bit rate : 320 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 (1%)
Default : Yes
Alternate group : 1
Resulting output 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.18
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : [email protected]@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
Debug Log: vceencc_log_amfpoint.txt
Expected behavior Video stream should not be lost, but upscaled instead.
Screenshots
That's how resulting video looks like.
Additional context
~There is error with call to HQScaler sharpness feature, which i notified VCEEncC developer about recently, so this one is under investigation.
[PropertyStorageExImpl] 2023-11-09 20:53:21.927 54E0 [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~
Looks like incorrect call to sharpness filter was fixed in VCEEncC 8.19, but it also looks like it only works for AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_0 (aka --vpp-resize amf_fsr) right now. Is it supposed to be like that?
There is another error with call to AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1 algorithm which is much more suspicious (used argument --vpp-resize amf_fsr_11 which is available in VCEEncC 8.18)
[AMFHQScalerImpl] 2023-11-09 20:53:21.999 54E0 [AMFHQScalerImpl] Error: ..\..\..\..\..\runtime\src\components\HQScaler\AMFHQScalerImpl.cpp(1096):Assertion failed:YUV input not supported for VideoSR1.1
Which is strange, as other AMF upscalers work properly (well, except amf_point mentioned above), despite same used video source
Both issues in additional context were mentioned here https://github.com/rigaya/VCEEnc/issues/99
Thanks for reporting this issue, I created an internal ticket to the corresponding developers.
Thanks for forwarding issue. I assume that you forwarded problem with amf_point, so can i still ask an advice on that error i get while trying to use VideoSR1.1? Or are both of these issues linked to each other? (As using VideoSR1.1 does also produce green stream as output in the end)
[AMFHQScalerImpl] 2023-11-09 20:53:21.999 54E0 [AMFHQScalerImpl] Error: ..\..\..\..\..\runtime\src\components\HQScaler\AMFHQScalerImpl.cpp(1096):Assertion failed:YUV input not supported for VideoSR1.1
The issue was reproduced with an internal test application and verified will be resolved in the upcoming public driver release. Please stay tuned.
As for VideoSR1.1, the assertion is behaving correctly. YUV is not supported for VideoSR1.1 and the AMF documentation will be updated to reflect this. The incorrect format is the reason why this algorithm is not working in VCEEncC as you mentioned.
Seems like in 23.40.19.01 (pre-release 24.2.1) issue ceased to persist. Will wait for official release to confirm, then close issue.
Oops, scratch statement above... I was being genuinely dumb. Automatically used fast, but upscaled to 4k video to test if upscaler worked properly... Of course it didn't corrupt video, because video already was of this resolution. Still, will wait for fix in future release.