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: obs-ffmpeg: WebM/VP9 recording with BGRA fails to start (upstream #13785) #310
Upstream OBS bug, reported by PickKali in obsproject/obs-studio#13785 (also nilankadesilva). Code unchanged in this fork.
Location
plugins/obs-ffmpeg/obs-ffmpeg-output.ccreate_video_stream(): for a BGRA output the pixel format is chosen with avcodec_find_best_pix_fmt_of_list(pix_fmts, BGRA, has_alpha=1), which picks the encoder's least-lossy listed format. FFmpeg 8 and later list gbrap for libvpx-vp9, but libvpx-vp9 only opens gbrap with strict experimental compliance ("not widely supported ... use 'yuva420p'"), so avcodec_open2 returns EINVAL.
Class
Output fails to start: a custom FFmpeg recording to WebM/VP9 with the BGRA (alpha) video format fails with "Failed to open video codec: Invalid argument".
How it is reached
Settings → Output → Recording, type Custom Output (FFmpeg), container WebM, video encoder libvpx-vp9, with Settings → Advanced → Video color format BGRA (for a transparent recording): starting the recording fails. It appears as a regression with the newer bundled FFmpeg, which lists gbrap; the ffmpeg CLI fails the same way for BGRA input to libvpx-vp9.
Reproduced with the real ffmpeg_output recording core video at BGRA through libvpx-vp9 into WebM: it fails with exactly that error.
Proposed fix and failing test
Fix: when the chosen format has alpha and the encoder rejects it with EINVAL, drop it and retry with the next-best format that still has alpha (libvpx-vp9 ends on yuva420p), logging which format was rejected. Encoders that open their first choice, non-alpha formats and other errors are unchanged, and alpha is never dropped silently: with no alpha format left it fails as before.
RED test (cmocka, test_ffmpeg_output_alpha): WebM/VP9 from BGRA must record with alpha (fails today); guards that FFV1/Matroska keeps bgra and that VP8 with its default auto-alt-ref still fails instead of losing alpha.
Cause: for a BGRA (alpha) recording OBS picks the encoder's best-matching pixel format, and newer FFmpeg lists gbrap first for libvpx-vp9, but libvpx-vp9 only opens gbrap in experimental mode, so starting failed with "Failed to open video codec: Invalid argument" (the ffmpeg command line fails the same way). Now, when an encoder rejects the chosen alpha format, OBS tries the next format that still has alpha (for VP9 that ends on yuva420p) and logs which one it used; alpha is never dropped silently. The test records BGRA to WebM/VP9 through the real FFmpeg output: before it failed with your error; now it records VP9 with alpha.
Workaround on stock OBS: none for VP9 with alpha; FFV1 in Matroska records with alpha.
obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.
If you try it, a short reply here on whether your WebM recordings work would really help.
Activity
rdoupe commentedon Oct 12, 2026
Claiming: this issue.
test_ffmpeg_output_alpha(1 of 3 failing): the realffmpeg_outputrecording BGRA to WebM/VP9, with FFV1 and VP8 guards.PR today.
test: Record WebM/VP9 from BGRA through ffmpeg_output
rdoupe commentedon Oct 12, 2026
@PickKali you reported this in obsproject/obs-studio#13785, so a heads-up: it's fixed here in obs-rust by #311, merged today with a regression test.
Cause: for a BGRA (alpha) recording OBS picks the encoder's best-matching pixel format, and newer FFmpeg lists
gbrapfirst for libvpx-vp9, but libvpx-vp9 only opensgbrapin experimental mode, so starting failed with "Failed to open video codec: Invalid argument" (theffmpegcommand line fails the same way). Now, when an encoder rejects the chosen alpha format, OBS tries the next format that still has alpha (for VP9 that ends onyuva420p) and logs which one it used; alpha is never dropped silently. The test records BGRA to WebM/VP9 through the real FFmpeg output: before it failed with your error; now it records VP9 with alpha.Workaround on stock OBS: none for VP9 with alpha; FFV1 in Matroska records with alpha.
obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you try it, a short reply here on whether your WebM recordings work would really help.
obs-ffmpeg: Fall back to an alpha format the encoder opens