fzwoch / obs-vaapi

OBS Studio VAAPI support via GStreamer
GNU General Public License v2.0
118 stars 3 forks source link

Limited and Full Color Range OBS setting not being passed to encoder. #27

Closed RushingAlien closed 3 months ago

RushingAlien commented 3 months ago

Hello, OBS has a pixel format setting for video in the advanced tab where we can choose between full range (0-255 for 8-bit yuv) or limited range (16-235) color range.

Color Range setting

gambar

FFMPEG VAAPI result

Recording with this state with the ffmpeg vaapi encoders in OBS results in a video with full color range (Levels)

gambar

obs-vaapi result

However the obs-vaapi encoded ones are still encoding in limited while OBS is giving full range frames, causing bad color mapping when playbacked.

gambar

In this image, the top part is what the color should look like, the bottom part is what shows when obs-vaapi encoded video is play-backed.

Additional Information

https://gstreamer.freedesktop.org/documentation/video/video-color.html

looks like this can be set via GstVideoColorimetry

GstVideoColorRange

Possible color range values. These constants are defined for 8 bit color values and can be scaled for other bit depths. Members GST_VIDEO_COLOR_RANGE_UNKNOWN (0) – unknown range
GST_VIDEO_COLOR_RANGE_0_255 (1) – [0..255] for 8 bit components
GST_VIDEO_COLOR_RANGE_16_235 (2) – [16..235] for 8 bit components. Chroma has [16..240] range.

RushingAlien commented 3 months ago

More information: when video is played with gstreamer the color looks accurate, but not if with ffmpeg. Maybe this is because gst looks at colorimetry data directly while ffmpeg relies on metadata?

fzwoch commented 3 months ago

I think this can be added. But note this is almost always not want you want.