-
Notifications
You must be signed in to change notification settings - Fork 153
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]: QVBR crashes (and the HQ* versions too) #528
Comments
This sounds like known issue. The fix will be in upcoming driver. If you want a way-around, you will need to disable/minimize AMF tracing in FFmpeg code. I can point you to the code. Or you can get new AMF patches for FFmpeg where this logging is minimized by default: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=13753 |
Ohh, that's fresh! Just a couple days old (ffmpeg patches that is). Ok, fine, i'll patch ffmpeg and see if i can get it running 🙂 I'll report back with my findings! |
Compile error. CC libavfilter/vf_sr_amf.o
In file included from libavfilter/avfilter_internal.h:31,
from libavfilter/vf_sr_amf.c:42:
libavfilter/vf_sr_amf.c:182:24: error: initialization of ‘int (*)(const AVFilterContext *, struct AVFilterFormatsConfig **, struct AVFilterFormatsConfig **)’ from incompatible pointer type ‘int (*)(AVFilterContext *)’ [-Wincompatible-pointer-types]
182 | FILTER_QUERY_FUNC2(&amf_filter_query_formats),
| ^ GCC version, in case it matters:
|
Hmmmm... change it to: |
So, that is in two files: Fixing that does make it compile a little further but... more errors await :) ❯ make
\CC libavcodec/amfenc_av1.o
In file included from /usr/include/AMF/core/Data.h:37,
from /usr/include/AMF/core/Buffer.h:37,
from /usr/include/AMF/core/Context.h:37,
from /usr/include/AMF/core/Factory.h:40,
from libavcodec/amfenc.h:22,
from libavcodec/amfenc_av1.c:23:
libavcodec/amfenc_av1.c: In function ‘amf_encode_init_av1’:
libavcodec/amfenc_av1.c:467:57: error: ‘AMF_VIDEO_ENCODER_AV1_ADAPTIVE_MINIGOP’ undeclared (first use in this function); did you mean ‘AMF_VIDEO_ENCODER_ADAPTIVE_MINIGOP’?
467 | AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_ADAPTIVE_MINIGOP, ((ctx->pa_adaptive_mini_gop == 0) ? false : true));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/amfenc_av1.c:467:57: note: each undeclared identifier is reported only once for each function it appears in
libavcodec/amfenc_av1.c:481:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
481 | AMFVariantStruct is_adaptive_b_frames = { 0 };
| ^~~~~~~~~~~~~~~~
libavcodec/amfenc_av1.c:490:66: error: ‘AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES’ undeclared (first use in this function); did you mean ‘AMF_VIDEO_ENCODER_CAP_BFRAMES’?
490 | res = encoder_caps->pVtbl->GetProperty(encoder_caps, AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES, &var);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| AMF_VIDEO_ENCODER_CAP_BFRAMES
libavcodec/amfenc_av1.c:499:70: error: ‘AMF_VIDEO_ENCODER_AV1_MAX_CONSECUTIVE_BPICTURES’ undeclared (first use in this function); did you mean ‘AMF_VIDEO_ENCODER_MAX_CONSECUTIVE_BPICTURES’?
499 | AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_CONSECUTIVE_BPICTURES, 3);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavcodec/amfenc_av1.c:510:74: error: ‘AMF_VIDEO_ENCODER_AV1_B_PIC_PATTERN’ undeclared (first use in this function); did you mean ‘AMF_VIDEO_ENCODER_B_PIC_PATTERN’?
510 | AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_B_PIC_PATTERN, ctx->max_b_frames);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [ffbuild/common.mak:81: libavcodec/amfenc_av1.o] Error 1 Are you sure that amf-headers 1.4.35 include these constants? ❯ yay -Qs amf-headers
local/amf-headers 1.4.35-1
Header files for AMD Advanced Media Framework And when i grep through these headers: ❯ grep -Ri "ADAPTIVE_MINIGOP" *
components/VideoEncoderVCE.h:195:#define AMF_VIDEO_ENCODER_ADAPTIVE_MINIGOP L"AdaptiveMiniGOP" // bool; default = false; Disable/Enable Adaptive MiniGOP Which does lead me to think that the AMF headers you use are not the ones i use ;) (well.. that's unfair, lol) |
You need to get the latest headers from this repo for these patches. Few parameters were published ahead of time but we didn't change version yet. |
I got it working! Thank you so much @MikhailAMD! I'm just playing with a couple HEVC settings now and will report back in here if i find something crashing. I'm mostly just curious if i can find a suitable desktop streaming for low latency but high quality (bitrate is no concern as it's local). I did thus far find one weird message. When playing with
It's probably not the mode i'm after anyhow but i thought it'd be worth reporting it. |
Thanks for letting know. The patch developer will update the patch. Not sure how it was compiled. |
Hmm, couple observations.
All of it is at the Should i now try AV1.. which last time froze my GPU requiring a reboot... 😛 Joking aside, i try desktop streaming and i need hardware acceleration on both ends for the lowest possible latency. Sadly my other side (AMD too) doesn't have hardware AV1 decoding.. so HEVC is probably my best option here. In general i'm really happy with how it works right now! This begins to get usable for me, sweet! The only thing i really miss is a higher quality YUV. 4:2:0 is... meh.. for desktop purposes. 4:4:4 is best (well and 10 bit). Edit |
Hi, rate control folks have trouble to reproduce vbr_latency issue and are asking for the the exact command line. |
Hmm, it's behavior is now different compared to when i wrote that. It's still weird though. As i can't upload mkv files, i did it on this site: https://limewire.com/d/d55ebc38-5f99-42af-9114-5d9765247470#vOIDj3aFvoj43iAndxJPWn9SRUPMTUBQn_gtPZ8-nLM The arguments i used for this (also in the video but text might be easier):
|
Thanks! |
Command:
error:
Now i just changed the |
This is different. high_quality tries to enable pre-analysis (PA) but is not supported for 10-bit HEVC which is forced by |
Regarding pulsing with vbr_latency: |
Describe the bug
Screen capture and streaming. Just playing with the
hevc_amf
encoder in ffmpeg.To Reproduce
Steps to reproduce the behavior:
ffmpeg -framerate 60 -f x11grab -thread_queue_size 1024 -video_size 2560x1440 -i :0.0+0,0 -c:v hevc_amf -usage lowlatency_high_quality -quality quality -rc qvbr -qvbr_quality_level 28 -preanalysis 1 -log_to_dbg 1 -profile:v main10 -b:v 15M -pix_fmt nv12 -f_strict experimental -syncpoints none -f nut udp://10.0.3.55:5555
Adjust accordingly :)
Setup (please complete the following information):
Debug Log (please upload or paste):
Expected behavior
Don't crash!
Oh and
QVBR
also sometimes gives me this:Additional context
I did add
-preanalysis 1
as i read somewhere that this codec requires that. However, with or without that the encoding just crashes after a couple seconds. I also tried changing between main and main10 but that didn't change anything either.Note that i'm using features that AMF itself advertises within ffmpeg to be options to use! Surely those should work?!
The text was updated successfully, but these errors were encountered: