Confused about the purpose of BGRA

Athenya

New Member
I don't understand what is the purpose of the option under Advanced -> Video since from all my testing no matter what you do, when the Colour Format is set to BGRA the video files will still be recorded in YUV 4:2:0. Shouldn't it be recording in BGRA under this mode or the very least record in YUV 4:4:4
 

prgmitchell

Forum Moderator
1755632182187.png
 

koala

Active Member
If the encoder isn't able to encode color format BGRA, it will encode in some format it knows. So you need to choose a proper encoder. If you use simple output mode and as quality "lossless quality", the utvideo software codec will be used, and this will record the full video data. I don't know if the A layer is included (transparency), but the visible colors definitely will.
 

Athenya

New Member
If the encoder isn't able to encode color format BGRA, it will encode in some format it knows. So you need to choose a proper encoder. If you use simple output mode and as quality "lossless quality", the utvideo software codec will be used, and this will record the full video data. I don't know if the A layer is included (transparency), but the visible colors definitely will.
That's what confuses me because my understanding is that either you do that or specifically pick custom output (FFmpeg) and add "colorspace=0" to the video encoder settings which is two really obtuse ways to get it to actually do something, and otherwise it seem to always just default back to recording in YUV 4:2:0, instead of something like YUV 4:4:4 which would be closer.
 

Suslik V

Active Member
Code:
01:19:01.844: [x264 encoder: 'advanced_video_recording'] settings:
...
01:19:01.857: [ffmpeg muxer: 'adv_file_output'] Writing file 'W:/Game Capture/OBS/2025-08//Dag 20 01-19-01.mp4'...
Neither selected x264 encoder nor mp4 media container doesn't support BGRA.

Advanced settings in OBS is not for casual (or everyday) use. Default in OBS is NV12 format. This is best for compatibility. In my opinion, if user made mistake - it should be easily visible, not masked with "very close by its features".
 

Athenya

New Member
I'm still just confused because as far as I can tell every single video encoder I have available always just seem to default the recording back to NV12 4:2:0. Would have at least expected it to default it to some kind of 4:4:4 format
 

Athenya

New Member
If you want 4:4:4, use color format i444.
Well I wanted to record something completely uncompressed and now I'm just confused on what the BGRA setting does and why it also choose to record in 4:2:0 when it's picked. Still haven't gotten an answer on either thing
 

Suslik V

Active Member
About lossless recordings.
I wanted to record something completely uncompressed
recommendation:
...use simple output mode and as quality "lossless quality"

Also, there are guides. There you can find other suggestions for lossless recordings with OBS:

About the setting.
what the BGRA setting does...
it sets OBS canvas pixel format to "packed uncompressed format" similar to AV_PIX_FMT_BGRA in FFmpeg and matches GS_BGRA for graphics processing (texture formats list: https://docs.obsproject.com/reference-libobs-graphics-graphics ). OBS uses graphics acceleration to compose its final image. OBS prepares all frames as textures, combines them and gets final texture that either matches the final format of the output or OBS converts it to requested YUV format. Canvas - is black empty space of specified size where you placing all your graphic sources.

About fallback mechanism.
...why it also choose to record in 4:2:0 when it's picked...
Most popular encoders, media containers and streaming services stores videos as YUV, not RGB. You are using "x264" encoder - it cannot record RGB-like pixel formats. The ".mp4" media container cannot store data that uses RGB-like pixel formats (".mkv" can) - this is by ISO standard for MP4 container. See ISO/IEC 14496-12 for details.

Maybe you want to ask why OBS instead of rising the error attempts to record at least "something"? There are many factors:
  • similar fallback mechanism in other utils (re-encoding with FFmpeg - it chooses best compatible pixel format even when format is not specified);
  • streaming to popular platforms (no RGB support, only YUV 4:2:0, because RGB-like or YUV 4:4:4 requires a lot of bandwidth);
  • developer about custom output: "Video format handling has also changed; it will now attempt to use the closest format to the current format if available for a given video codec." (source: https://github.com/obsproject/obs-studio/commit/d3f92ca5d6bea05f9659cec7524f2a34d03e8c16 was in OBS v0.8.0 long time ago, and there is other examples from other developers: https://github.com/obsproject/obs-studio/pull/3439 that protects this fallback mechanism in other parts of OBS);
  • my own opinion: users complains (it doesn't work! fix it! *ing program! I cannot stream! I streamed yesterday but now there is error! etc).
If you only want to know the answer to the question "why 4:2:0 and not 4:4:4?" then here is the code:
This is very simple algorithm "IF not valid THEN...".
When invalid pixel format specified for the x264 encoder, then it will be substituted with NV12 (4:2:0).
 
Last edited:
Top