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

[Bug]: Unable to produce scaled video with AMF specific methods HQScaler when preanalysis flag is enabled. #456

Closed
DimkaTsv opened this issue Feb 21, 2024 · 2 comments
Labels

Comments

@DimkaTsv
Copy link

DimkaTsv commented Feb 21, 2024

Describe the bug
When i try to use VCEEncC with --vpp-resize [amf_bilinear / amf_bicubic / amf_fsr] when preanalysis is enabled, i am unable to produce video, except case when i toggle log level to trace (per-frame data). I don't know why bug doesn't happen with trace level specifically, it doesn't work even with debug, only trace.

To Reproduce
Steps to reproduce the behavior:

  1. Use VCEEncC as wrapper
  2. Setup command similar to this: %~dp0\VCEEncC64.exe -i %1 -o "%~n1_processed%~x1" --codec hevc --profile main --level 6.2 --output-res 1920x-2 --vpp-resize amf_fsr --preset slow --vbr 20000 --max-bitrate 60000 --pa, Simple --pa means that it will use no heavy parameters, and just enable preanalysis with defaults (but preanalysis with custom parameters will produce same result)
  3. Use basically any sample that is fit to be resized, either up or down in resolution.
  4. AVC is also affected in a same way.

Setup (please complete the following information):

  • OS: Windows 11, 23H2, build 22631.3155
  • Driver Version: 24.2.1 (to be specific 23.40.19.01 pre-release)
  • GPU: RX 7800XT
  • Which component has the issue: Encoder

Debug Log (please upload or paste):
VCEEncC - debug level (nothing was encoded).
debug_vceencc_log.txt

Basically it is getting stuck in this state:

[AMFPreAnalysisImpl] 2024-02-21 03:00:14.525     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.526     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.527     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.529     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.531     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.533     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.534     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.535     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.537     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.538     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.540     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.542     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.544     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.545     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.547     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.548     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()
[AMFPreAnalysisImpl] 2024-02-21 03:00:14.550     97DC [AMFPreAnalysisImpl]   Debug: AMFPreAnalysisImpl::QueryOutput()

VCEEncC - trace level (AMF does actually encode frames)
trace_vceencc_log.txt

Expected behavior
HQScaler should work with preanalysis even without trace level log being toggled on [with trace performance is horrendous].

Screenshots
image

Additional context
Why i said this way for output file should've not been 0 bytes in any case? Because after you cancel encode, VCEEncC formats video so that it could be watched up to moment you stopped the encode (at least for .mkv container). But if file is 0 bytes, meaning there is no data whatsoever.

@DimkaTsv DimkaTsv added the bug label Feb 21, 2024
@MikhailAMD
Copy link
Collaborator

This is likely an app issue as PreAnalysis (PA) requires multiple inputs to start produce outputs but log shows single SubmitInput to encoder which in turn produces single SubmitInput to internal PA. HQScaler gets three inputs but just one output.

@DimkaTsv
Copy link
Author

DimkaTsv commented Feb 21, 2024

Hmm... I know that it did work, and i know that it worked before. Used old application with same result.

Just doublechecked. Holy cow! It actually does work... Occasionally.
But not for every file. Far from it.
I cannot grasp what is a limiter here... It is not bitrate. not container, not resolution, not source codec...
Seems to be some combination of source codec and resolution? No... Not it either...

For example i can turn HEVC ReLive 19201080 source into 4k, but physically unable to do same for AV1 ReLive 19201088 captures. Or AV1 8k sources i have.
Neither i was able to do same with YUV444 RAW, DivX, ProRes, VC-1 and MPEG-2

Hmm... Looks like i figured out trend about it. Every video that couldn't be upscaled with amf scalers was forced to go through avsw decoder pipeline. Yeah, looks like it. On other note... Why VCEEnc even forces --avsw for AV1 codec? For compatability reasons?

Thanks, Mikhail, you were right at this one and helped to rule out reasons.
It is just i found bug at 3AM and did only parametric testing to rule out causations before collecting logs and reporting.

Also trace level log didn't change anything in actuality. Probably i was "lucky" to hit one of the working sources when used trace command.

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