Export fails on AMD GPUs since NV12 fast path (v0.1.142)
Hello. I’m currently on a new system (MX Linux, though don’t think the distro is the problem here) and wanted to do a quick recording. Installed using the install script and all went well. Authenticated youtube and when trying to upload, it fails. I’ve attached the log file found in ~/.local/state/hosaka/
hosaka.log
188.7 KB
Log in to comment and vote
Comments11
Apr 1
PinnedI’m commenting this as fixed in v0.1.153 because it works on an AMD laptop I bought but if it re-occurs (or a different issue occurs!) please comment/create another ticket.
Sujal Gurung
Apr 1
Thanks! Working now
Sujal Gurung
Mar 26
Hmm even regular export failed. Might just be that I don’t have the proper dependencies on this system. Here’s the logs for regular export
2026-03-26 07:15:49 DEBUG hosaka.pipeline.export:592 - Output path: /home/demo/Videos/Hosaka/Indra report feedback | Screencast 2026-03-26 06:44:08.mp4 2026-03-26 07:15:49 DEBUG hosaka.pipeline.export:144 - Creating output directory: /home/demo/Videos/Hosaka 2026-03-26 07:15:50 DEBUG hosaka.pipeline.export:355 - Wrote temp audio: /tmp/hosaka_audio_13291_b8e2d876.wav (11107894 samples, 48000 Hz, 2 ch) 2026-03-26 07:15:50 INFO hosaka.pipeline.export:161 - Using encoder: VAAPI 2026-03-26 07:15:50 DEBUG hosaka.core.ffmpeg:858 - Starting FFmpeg encoder: ffmpeg -y -loglevel warning -f rawvideo -pix_fmt nv12 -s 1366x670 -r 60 -i pipe:0 -i /tmp/hosaka_audio_13291_b8e2d876.wav -vaapi_device /dev/dri/renderD128 -vf hwupload -c:v h264_vaapi -pix_fmt vaapi -qp 18 -g 30 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range tv -map 0:v -map 1:a -c:a aac -b:a 192k -f mp4 /home/demo/Videos/Hosaka/Indra report feedback | Screencast 2026-03-26 06:44:08.mp4 2026-03-26 07:15:50 DEBUG hosaka.core.ffmpeg:879 - FFmpeg encoder started (PID: 17600) 2026-03-26 07:15:50 DEBUG hosaka.pipeline.export:179 - Export initialization complete 2026-03-26 07:15:50 DEBUG hosaka.pipeline.export:602 - Export initialized successfully 2026-03-26 07:15:50 WARNING hosaka.qt:101 - Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures. 2026-03-26 07:15:50 INFO hosaka.effects.gpu_compositor:219 - GPU compositor initialized: AMD AMD Radeon Vega 3 Graphics (radeonsi, raven2, ACO, DRM 3.61, 6.12.63+deb13-amd64) (GL 4.6 (Core Profile) Mesa 25.3.3-1~mx25ahs) 2026-03-26 07:15:50 INFO hosaka.pipeline.export:218 - GPU compositing enabled for export 2026-03-26 07:15:50 DEBUG hosaka.pipeline.export:957 - Re-timing export (GPU): 8996 source frames -> 13885 output frames (duration=231.41s, fps=60, output=1366x670) 2026-03-26 07:15:50 DEBUG hosaka.pipeline.export:1052 - First frame from export decoder: shape=(768, 1366, 3) 2026-03-26 07:15:53 DEBUG hosaka.effects.gpu_compositor:382 - GPU compositor shaders initialized 2026-03-26 07:15:53 DEBUG hosaka.pipeline.export:1222 - FFmpeg stopped accepting frames at 3/13885 (audio stream ended). 2 frames written. 2026-03-26 07:15:53 WARNING hosaka.core.ffmpeg:974 - FFmpeg process has exited (code 218) 2026-03-26 07:15:53 DEBUG hosaka.pipeline.export:1335 - Export complete (GPU): 13885 frames from 8996 source in 3.7s (3793.6 fps). Avg: fetch=81.98ms (3 unique), compose=0.00ms, readback=0.00ms, write=0.04ms, seg_wait=0.00ms (0 calls) 2026-03-26 07:15:53 DEBUG hosaka.pipeline.export:642 - Finishing export... 2026-03-26 07:15:53 DEBUG hosaka.core.ffmpeg:1146 - Waiting for FFmpeg to finish (frames=2) 2026-03-26 07:15:53 WARNING hosaka.core.ffmpeg:1084 - FFmpeg exited with code 218: n not implemented) [vf#0:0 @ 0x55cb9214e380] Terminating thread with return code -38 (Function not implemented) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Could not open encoder before EOF [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55cb92359840] Nothing was written into output file, because at least one of its streams received no packets. 2026-03-26 07:15:53 DEBUG hosaka.pipeline.export:285 - Deleted temp audio file: /tmp/hosaka_audio_13291_b8e2d876.wav 2026-03-26 07:15:53 INFO hosaka.pipeline.export:296 - Deleted incomplete export file: /home/demo/Videos/Hosaka/Indra report feedback | Screencast 2026-03-26 06:44:08.mp4 2026-03-26 07:15:53 ERROR hosaka.ui.workers.export:294 - Export failed: FFmpeg encoding failed: n not implemented) [vf#0:0 @ 0x55cb9214e380] Terminating thread with return code -38 (Function not implemented) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Could not open encoder before EOF [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55cb92359840] Nothing was written into output file, because at least one of its streams received no packets. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/hosaka/ui/workers/export.py", line 248, in _run_file_based exporter.export_recording( ~~~~~~~~~~~~~~~~~~~~~~~~~^ self.frames, ^^^^^^^^^^^^ ...<15 lines>... shadow_config=self.shadow_config, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/lib/python3/dist-packages/hosaka/pipeline/export.py", line 643, in export_recording self.finish_export() ~~~~~~~~~~~~~~~~~~^^ File "/usr/lib/python3/dist-packages/hosaka/pipeline/export.py", line 299, in finish_export raise RuntimeError(failure_reason) RuntimeError: FFmpeg encoding failed: n not implemented) [vf#0:0 @ 0x55cb9214e380] Terminating thread with return code -38 (Function not implemented) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Could not open encoder before EOF [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55cb92359840] Nothing was written into output file, because at least one of its streams received no packets. 2026-03-26 07:15:53 ERROR hosaka.app:1474 - Export failed: FFmpeg encoding failed: n not implemented) [vf#0:0 @ 0x55cb9214e380] Terminating thread with return code -38 (Function not implemented) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Could not open encoder before EOF [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_vaapi @ 0x55cb9235a0c0] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55cb92359840] Nothing was written into output file, because at least one of its streams received no packets. 2026-03-26 07:18:47 DEBUG hosaka.ui.audio_player:434 - Audio seek to 231.40 s (sample 11107414) 2026-03-26 07:18:47 DEBUG hosaka.ui.audio_player:348 - Audio sink created: 48000 Hz, device=Family 17h/19h/1ah HD Audio Controller Analog Stereo 2026-03-26 07:18:47 DEBUG hosaka.ui.audio_player:410 - Audio playback started at sample 11107414 2026-03-26 07:18:47 DEBUG hosaka.ui.preview_controller:526 - Playback started at 231.40 2026-03-26 07:18:47 DEBUG hosaka.ui.audio_player:419 - Audio playback paused at sample 11107894 2026-03-26 07:18:47 DEBUG hosaka.ui.preview_controller:542 - Playback paused at 231.44 2026-03-26 07:18:47 DEBUG hosaka.ui.audio_player:434 - Audio seek to 0.00 s (sample 0) 2026-03-26 07:18:47 DEBUG hosaka.core.ffmpeg:1420 - PyAV fallback: frame 0 (gap=-8998) 2026-03-26 07:18:48 DEBUG hosaka.ui.audio_player:434 - Audio seek to 0.00 s (sample 0) 2026-03-26 07:18:48 DEBUG hosaka.ui.audio_player:410 - Audio playback started at sample 0 2026-03-26 07:18:48 DEBUG hosaka.ui.preview_controller:526 - Playback started at 0.00 2026-03-26 07:18:53 DEBUG hosaka.ui.workers.preview_render_worker:885 - Preview render stats (152 frames, 30.4 fps): total=10.92ms [frame=6.81(sel=0.99, read=2.96, copy=1.09), zoom=0.00, scale=0.00, cursor=0.66, webcam=0.01, compose(upload=3.07, zoom=0.00, bg=0.02, place=0.14, cursor=0.12, pip=0.00), resize=0.05] 2026-03-26 07:18:58 DEBUG hosaka.ui.audio_player:419 - Audio playback paused at sample 475136 2026-03-26 07:18:58 DEBUG hosaka.ui.preview_controller:542 - Playback paused at 9.81Hugo Baldwin
Mar 26
Hi Sujal I’ve included a fix for this in v0.1.147 (along with the new track for changing the recording layout)
It turns out AMD devices are more pedantic about which flags are provided to FFmpeg when encoding than Intel and that’s why the issue wasn’t caught earlier. In your logs there was a compatibility probe which passed and then the encoding itself failed after a few frames. To prevent it occurring again I’ve added test coverage to ensure the args used in the compatibility check and encoding always match. I’ll also see if I can pickup a AMD laptop for testing
Let me know if that fixes the issue for you
Sujal Gurung
Mar 27
Thanks! I had a separate issue with the stop systray icon crashing the app that got fixed by this, though this error still persists.
Some background info: I'm running MX linux off a usb on the same laptop i used to report arch issues before. Haven't updated and tested on arch but I am getting the previously attached errors on MX. Also updated all packages. Here's the latest logs
Sujal Gurung
Mar 27
You can get mx linux here if you wanna test (issue confirmed on both xfce and kde variants:
https://mxlinux.org/download-links/
Also, here's Gemini's take on it. It also gave me a python command to force the app to use the cpu but that just made my laptop freeze
Gemini:
This is definitively an issue with the app itself, not a missing dependency on your new system. You can pass this exact explanation back to the developer—they made a tiny oversight in the app's export pipeline regarding AMD hardware compatibility. Here is exactly what is happening: The Problem: B-Frames and AMD Vega GPUs Your new system is running an AMD Radeon Vega 3 GPU on Debian 13. The hardware video encoder on this specific generation of AMD chips (Raven/VCN 1.0) does not support B-frames for H.264 encoding. The developer actually handled this perfectly during the recording phase, but forgot to apply the same fix to the export phase.
The Recording Phase (Success) If you look at the FFmpeg command the app generates to record your screen, it includes a specific flag:
That -bf 0 explicitly tells FFmpeg to disable B-frames. Because of this, the AMD driver accepts it, and the recording succeeds perfectly. 2. The Export Phase (Failure) When you stop recording and the app tries to export/render the final file, it generates a slightly different FFmpeg command:
Notice that -bf 0 is missing. Because it's missing, FFmpeg falls back to its default behavior (which tries to use B-frames). The AMD hardware driver instantly rejects this because it physically can't do it, resulting in the errors you see:
Task finished with error code: -22 (Invalid argument) (The AMD driver rejecting the encoder settings)
Terminating thread with return code -38 (Function not implemented) (The video filter failing because the encoder crashed) How the Dev can fix it Tell the developer that they need to ensure the -bf 0 flag (or any hardware-specific compatibility flags they are using for the live capture) is also being passed to the FFmpeg builder during the export pipeline for AMD VA-API users. Right now, their app checks the hardware capability for the capture stream but seemingly uses a hardcoded preset for the export stream that breaks on older AMD APUs.
Hugo Baldwin
Mar 27
Can you test again with the latest release? And yes, Gemini's analysis was spot-on. Hopefully this sorts it. TBH because of issues like this I'm glad I haven't done heavy marketing until I'm confident there's reasonably broad device/architecture compatibility.
Sujal Gurung
Mar 28
Hmm still getting those errors. Couldn't upload the lofg file from my phone so here's a google drive link: https://drive.google.com/file/d/1EfZGQ440oFXv12TMVW0GvPJPMeRt8g7V/view?usp=drivesdk
I was trying out a bunch of distros a while back so I guess I should've tested Hosaka on them more. If you do want to test on different distros, using ventoy might be more convenient than spinning up virtual machines.
Hugo Baldwin
Mar 28
Hi Sujal sorry for the trouble, and thank you again for being patient through multiple rounds of AMD-related fixes (it’s definitely an AMD thing, changing distro at the same time was simply a coincidence).
The root cause stems from when I added a direct GPU → encoder NV12 path to speed up export in v0.1.142.
The performance gain is real on most hardware, but AMD's VAAPI driver has a quirk where its hwupload filter advertises RGBA surfaces instead of NV12, causing FFmpeg to silently convert the frames to the wrong format before encoding - the encoder then rejects them with the "Function not implemented" error seen in your logs.
The recording path was unaffected because it goes through a software scale step first, which happens to sidestep the issue. Only export broke.
I’ve deployed a fix in v0.1.149 to probe whether the fast NV12 path works at startup. If it doesn't - as on your system - it falls back to a path that should still work on AMD, while still using hardware (VAAPI) encoding. So you should still get GPU-accelerated exports, just without the NV12 shortcut.
Let me know if you're still seeing issues once it's out.
Sujal Gurung
Mar 30
No worries. Sorry I didn’t get notified of this. Tested and I’m still getting the same issue (on both MX Linux as well as Arch on the same device.
Here’s logs for MX:
hosaka.log
46.2 KB
And for Arch:
hosaka-arch.log
38.8 KB
Hugo Baldwin
Mar 31
I picked up an old Lenovo with AMD CPU/GPU today to squash this bug for good - I’ll push changes up once I’ve tested them myself on AMD