Open wanderingcode opened 1 year ago
Hi,
I also notice a difference in colors, but it happens both for RTMP and WebRTC for version 27.2.4 as well as for 28.1.2.
Settings:
I stream using the following static image as source:
Received image displayed in Chrome 109.0.5414.119
sent from OBS 27.2.4 using WebRTC
sent from OBS 27.2.4 using RTMP
sent from OBS 28.1.2 using WebRTC
sent from OBS 28.1.2 using RTMP
Received images are identical, whether they have been streamed using RTMP or WebRTC, OBS 27.2.4 or OBS 28.1.2. There is a color difference from the original static image.
Trying to stream the same static image to Facebook using regular OBS.
Settings:
Source image:
Received image displayed in Facebook in Chrome 110.0.5481.177
sent from OBS 27.2.4
sent from OBS 28.1.2
sent from OBS 29.0.2
For comparison, this is the image received in Chrome when streaming from OBS WebRTC 28.1.2:
There is a color difference from the original static image, both when streaming using regular OBS and WebRTC OBS.
I am able to get a slight difference in colour rendering by selecting a different colour format.
This is my source static image:
Streaming using colour format I420 (no difference when streaming with WebRTC, RTMP, OBS 27.2.4 and 28.1.2)
We can notice that:
Streaming using colour format NV12
We can notice that there is a tiny difference for cyan and green when using colour format NV12 or I420.
============= Here is what happens for your streaming.
Your source image:
Streaming with RTMP:
We can notice that all colours and greys are different between source image and streamed image.
Streaming with WebRTC:
We can notice that all colours and greys are different between RTMP streamed image and WebRTC streamed image.
What are your settings (colour format, colour range, codec):
In our tests the following combo has always produced accurate results and my tests were run with:
codec: VP8 ColorSpace: Rec 601 Pixel Format: NV12 Color Range: Partial (On OBS 28) SDR White Level 300 nits HDR Peak Level 1000 Nits
From your FB tests it looks like this may be an issue in the original OBS and not the WebRTC implementation?
Using these settings I see accurate color reproduction in OBSWebRTC-27.2.4, but not in V28.
The screenshots below shows OBS window on the bottom, and Chrome 110.0.5481.177 on top. Running on MacOS 13.2.1
Below is a screen shot using OBS-WebRTC 27.2.4 (Release 1.3.2)
And here is a screen shot with OBSWebRTC-28.1.1
I reproduced the problem with your settings.
Source image:
Stream from OBS 1.3.2-27.2.4:
Stream from OBS 1.4.1-28.1.1:
Key setting is color space: Rec 601 With color space 709, received images from streaming with OBS 27 and OBS 28 are identical. But with color space 601, received images from streaming with OBS 27 and OBS 28 are different as shown above.
I am investigating the origin of this difference for color space 601.
Thank you for your efforts on this. VP8 spec lists Rec601 as the correct color space, and so far that's the only way I've been able to get accurate color rendering is with the above settings.
I never fully understood why h264 and other codecs don't render the colors correctly in this workflow. (Side note) So far I haven't found a listed color space in the specs for VP9 or AV1. If you happen to see those anywhere I'd love to discover that!
The problem is in OBS 28 Rec601 is no longer is accurate. At first I thought it was incorrectly using Rec701 color space, but my tests show a different color rendering for 601 and 709, both of which are incorrect.
In these photos, top row is via chrome, middle row is OBS window, and bottom row is the source PNG I used.
OBS 27.2.4 Rec601:
OBS 27.2.4 Rec709:
OBS 28.1.1 Rec601:
OBS 28.1.1 Rec709:
I confirm there is an issue in OBS 28 about color space 601. I saved raw frames delivered by OBS before encoding to compare them.
Color management in OBS 28 has been modified a lot as compared to OBS 27. I have not yet identified how they changed management of color space for delivery of raw frames to encoder.
Thank you for doing the raw frame comparison. Let me know if there is more I can do to help discover the root of the issue.
Root of the issue has been identified as a difference in default format of raw frames to be delivered to libwebrtc for encoding.
Excellent! Thank you so much for your efforts in tracking this down and getting it corrected.
Any word on when this fix will be implemented? Thanks
Since upgrading to OBS 28 the video color is lifted when streaming with WebRtc.
If I switch the stream to Millicast RTMP then the colors are accurate. This was not an issue with OBS 27.2.4 via WebRTC.
In the photos below, the top color chart is Resolve which is the source. That's fed through a Black Magic UltraStudio Mini and received into OBS via a BLack Magic UltraStudio Mini. The bottom color chart is the received stream in a web browser. See the photos below to highlight the color shift when using WebRTC.
Streaming via RTMP![Screenshot 2023-02-17 at 1 26 20 PM-ResolveAndRTMP](https://user-images.githubusercontent.com/87335215/219797766-1b3fdedb-0f34-478d-bb9a-87f64df87e6e.png)
Streaming via WebRTC