You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: libobs/obs-ffmpeg: VAAPI texture encoder crashes on non-NV12/P010 color formats (upstream #12731) #206
gpu_encode_available() (obs-encoder.c:219) is only true for an encoder with OBS_ENCODER_CAP_PASS_TEXTURE when the video mix produces NV12/P010 textures. Otherwise add_connection() (:380-383) connects the encoder to raw frames, and do_encode() calls info.encode, which texture-only encoders leave NULL. NVENC (plugins/obs-nvenc/nvenc.c:973) and QSV (obs_qsv_create_tex) reroute to their CPU encoder from create() in that case; the VAAPI texture encoder (plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c, vaapi_create_tex_internal) doesn't.
Class
NULL function pointer call (crash).
How it is reached
Settings → Advanced → Color Format set to I444, I420 or BGRA (anything other than NV12/P010), with a VAAPI texture encoder (ffmpeg_vaapi_tex, hevc_ffmpeg_vaapi_tex) for recording or streaming. Starting the output crashes.
Reproduced headlessly on a Radeon 680M (radeonsi): NV12 records; I444, I420 and BGRA segfault. The backtrace matches the report: #0 0x0 in ?? () ← do_encode (obs-encoder.c:1483) ← receive_video ← video_output_cur_frame / video_thread.
Proposed fix and failing test
Fix, at both layers:
obs-ffmpeg: vaapi_create_tex_internal reroutes to ffmpeg_vaapi / hevc_ffmpeg_vaapi / av1_ffmpeg_vaapi when NV12/P010 textures aren't active, like NVENC and QSV.
libobs: in obs_encoder_initialize_internal(), after create(), a video encoder with no encode callback and no GPU textures available is shut down with a clear last error ("The selected encoder can only encode GPU textures, which are not available for the I444 color format. Use the NV12 or P010 color format, or a different encoder."), so the output refuses to start instead of crashing. This also covers any third-party texture-only encoder that doesn't reroute.
RED test (cmocka, test_texture_encoder_raw_format): registers a fake texture-only encoder (encode = NULL, encode_texture2 set, CAP_PASS_TEXTURE) and a fake encoded output on a video output with no GPU textures; each case runs in a forked child. Today I444, I420, BGRA and NV12-without-textures each crash with signal 11 (4 of 5 fail); the control encoder with a CPU encode starts and encodes. With the fix all 5 pass, and on the 680M both VAAPI texture encoders record on NV12, I444, I420 and BGRA ("falling back to ffmpeg_vaapi encoder"; the I444 file is valid h264).
RED: test_texture_encoder_raw_format (4 of 5 failing).
GREEN: VAAPI texture encoders reroute to their CPU encoder without NV12/P010 textures, and libobs refuses a texture-only encoder with a clear error instead of calling a NULL encode.
PR within the hour.
Cause: texture-only encoders (the VAAPI _tex ones) have no CPU encode path. With a color format other than NV12/P010, OBS feeds them raw frames and calls a NULL encode function. NVENC and QSV reroute to their CPU encoder in that case; VAAPI didn't. Now VAAPI falls back to its CPU-side VAAPI encoder, and libobs refuses any texture-only encoder that can't get textures with a clear error instead of crashing.
Workaround on stock OBS: set Settings → Advanced → Color Format to NV12 (or P010), or pick the non-texture "FFmpeg VAAPI" encoder.
obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.
If you get a chance to try it, a short reply here on whether it fixes it for you would really help, especially if it does not.
Activity
rdoupe commentedon Oct 11, 2026
Claiming: this issue.
test_texture_encoder_raw_format(4 of 5 failing).encode.PR within the hour.
obs-ffmpeg: Fall back to CPU VAAPI without GPU textures
test/cmocka: Add RED texture-only encoder on raw video test
libobs: Refuse texture-only encoders without GPU textures
rdoupe commentedon Oct 11, 2026
@tomben13 @v0l you reported or commented on this in obsproject/obs-studio#12731, so a heads-up: it's fixed here in obs-rust by #207.
Cause: texture-only encoders (the VAAPI
_texones) have no CPU encode path. With a color format other than NV12/P010, OBS feeds them raw frames and calls a NULL encode function. NVENC and QSV reroute to their CPU encoder in that case; VAAPI didn't. Now VAAPI falls back to its CPU-side VAAPI encoder, and libobs refuses any texture-only encoder that can't get textures with a clear error instead of crashing.Workaround on stock OBS: set Settings → Advanced → Color Format to NV12 (or P010), or pick the non-texture "FFmpeg VAAPI" encoder.
obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you get a chance to try it, a short reply here on whether it fixes it for you would really help, especially if it does not.