-
Notifications
You must be signed in to change notification settings - Fork 152
Description
Describe the bug
Disclaimer: I am not familiar whatsoever with the AMF codebase and am reporting and describing this from the POV of a tech-savvy user and programmer. I am reporting it here as an AMF issue as both OBS and ffmpeg experience the same errors under very similar conditions.
Running an AV1 encode with PreAnalysis enabled using the hardware encoder on RDNA4 graphics cards results in semi-random AMF_INPUT_FULL errors from AMF depending on GPU and encoder load. I was never able to reproduce the issue with PreAnalysis disabled.
How the issue presents itself:
OBS 31.0.4 and older
In OBS it presents itself as the inability to record content with AV1 + PreAnalysis or AV1 HQCBR/HQVBR. Upon starting the recording, sooner or later (in a matter of a few captured frames) the encode process fails with a pop-up "An encoder error occurred while recording.", followed by an AMF_INPUT_FULL error message in the OBS logs. I originally ran into this when trying to capture 1440p 60 FPS content but it happens at 1080p60 and 720p60 too.
I originally created a bug report for OBS here but then later ran into the issue with ffmpeg too, which leads me to AMF.
ffmpeg gyan.dev full nightly build 2025-06-28-git-cfd1f81e7d and older
In ffmpeg the AMF_INPUT_FULL error appears to not be treated as a fatal error, so the encoding process just drops the frame (or at least sometimes it does as some recordings with errors are choppy) this error occurred on and keeps going, resulting in many such errors depending on the resolution of the encode. It happens practically every frame at 8K, very often at 1440p-4K and often enough to be a problem at 1080p60 but seems to be fine at 1080p30. I understand there is possibility for the encoder to be overloaded at times, but not being able to capture 1080p60 properly with AV1+PA seems more like AMF returning early while the encoder is still busy and then failing to submit further work or something along those lines, as I've been using h264+PA at 1440p60 to record desktop captures in OBS just fine and the encoder still has some headroom there. Furthermore these ffmpeg tests are not real-time so running into encoder overload issues here definitely isn't right, it can take as long as it needs.
To Reproduce
Steps to reproduce the behavior - OBS:
- Install and launch OBS
- Set the canvas to 1080p or higher with framerate set to 60
- Set recording settings to Advanced -> AMD HW AV1
- Switch rate control to HQCBR or HQVBR
- Save and click record
- Observe error.
Steps to reproduce the behavior - ffmpeg:
- Download a recent build of ffmpeg with AMF
- Run the following command:
ffmpeg.exe -y -r 60 -f lavfi -i testsrc=rate=60:size=3840x2160 -t 10 -pix_fmt yuv420p -an -c:v av1_amf -preset:v high_quality -profile:v main -quality:v high_quality -usage:v high_quality -preanalysis true -max_b_frames 3 -b:v 4M test.webm
- Observe the following messages in the output:
[av1_amf @ 00000166ef91b380] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen
Note: high_quality preset makes it more likely, but at high enough resolution/framerate or GPU load I can get the errors with the standard quality preset too, such as at 8K.
Setup (please complete the following information):
- OS: Windows 11 24H2 build 26100.4351 (completely fresh testbench install with no user software/apps)
- Driver: AMD Software Adrenalin Edition 25.6.1
- GPU: AMD Radeon RX 9070 XT
- Which component has the issue: AV1 Encoder
Debug Log (please upload or paste):
For ffmpeg:
Output #0, webm, to 'test.webm':
Metadata:
encoder : Lavf62.1.101
Stream #0:0: Video: av1, yuv420p(tv, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 4000 kb/s, 60 fps, 1k tbn
Metadata:
encoder : Lavc62.4.100 av1_amf
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen
Last message repeated 2 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen:01.03
Last message repeated 3 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen01.54
Last message repeated 7 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen02.06
Last message repeated 9 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen02.58
Last message repeated 8 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen03.10
Last message repeated 10 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen03.63
Last message repeated 10 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen04.13
Last message repeated 10 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen04.65
Last message repeated 7 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen05.17
Last message repeated 4 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen05.70
Last message repeated 8 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen06.21
Last message repeated 6 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen06.73
Last message repeated 8 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen7.24
Last message repeated 3 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen07.76
Last message repeated 6 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen08.28
Last message repeated 9 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen08.79
Last message repeated 6 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen09.31
Last message repeated 5 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen09.82
Last message repeated 8 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen10.36
Last message repeated 6 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen10.88
Last message repeated 5 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen11.40
Last message repeated 7 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen11.92
Last message repeated 6 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen12.43
Last message repeated 6 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen12.95
Last message repeated 6 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen13.47
Last message repeated 7 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen13.99
Last message repeated 8 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen14.51
Last message repeated 8 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen15.03
Last message repeated 5 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen15.55
Last message repeated 4 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen16.07
Last message repeated 5 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen16.60
Last message repeated 8 times
[av1_amf @ 00000281f82fad80] Data acquired but delayed SubmitInput returned AMF_INPUT_FULL- should not happen17.13
Last message repeated 1 times
[out#0/webm @ 00000281f82f0bc0] video:1592KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.146746%
frame= 356 fps= 20 q=-0.0 Lsize= 1595KiB time=00:00:09.98 bitrate=1308.7kbits/s speed=0.559x elapsed=0:00:17.86
For OBS (more details/logs can be found in this OBS issue):
17:14:55.331: [texture-amf-av1: 'advanced_video_recording'] settings:
17:14:55.331: rate_control: HQCBR
17:14:55.331: bitrate: 2500
17:14:55.331: cqp: 20
17:14:55.331: keyint: 250
17:14:55.331: preset: quality
17:14:55.331: profile: main
17:14:55.331: width: 1920
17:14:55.331: height: 1080
17:14:55.331: params: (none)
17:14:55.972: ---------------------------------
17:14:55.972: [FFmpeg aac encoder: 'Track1'] bitrate: 160, channels: 2, channel_layout: stereo, track: 1
17:14:55.972:
17:14:55.979: ==== Recording Start ===============================================
17:14:55.979: [ffmpeg muxer: 'adv_file_output'] Writing file 'C:/Users/testbench/Videos/2025-07-01 17-14-55.mkv'...
17:15:01.055: [texture-amf-av1: 'advanced_video_recording'] amf_encode_tex: SubmitInput timed out: AMF_INPUT_FULL
17:15:01.055: Error encoding with encoder 'advanced_video_recording'
17:15:01.057: [ffmpeg muxer: 'adv_file_output'] Output of file 'C:/Users/testbench/Videos/2025-07-01 17-14-55.mkv' stopped
17:15:01.057: Output 'adv_file_output': stopping
17:15:01.057: Output 'adv_file_output': Total frames output: 0
17:15:01.057: Output 'adv_file_output': Total drawn frames: 305
17:15:01.057: ==== Recording Stop ================================================
Expected behavior
For OBS: I expect 1440p60 recording with HQCBR/HQVBR to work out of the box. High resolutions I expect framedrops as the encode takes too long and OBS starts dropping frames. In either case I do not expect an actual AMF error to bring down the whole recording.
For ffmpeg: I expect it to just encode, maybe slowly depending on settings or resolution, but again an AMF error is unacceptable, especially when ffmpeg throws away the frame the error occurred on without retrying, resulting in a choppy output depending on how many errors occur.
Screenshots
ffmpeg error output with high_quality 4K60 with PA enabled:
Additional context
As already stated in the description section, I am not using AMF programmatically and I am not familiar with its codebase or API, so I'm reporting this based on similar error behavior from 2 programs (OBS and ffmpeg) that do use AMF internally. I can not provide and further internal details as for how they implement it, only how it behaves from a user POV.