fzwoch / obs-teleport

An OBS Studio plugin for an open NDI-like replacement. Pretty simple, straight forward. No NDI compatibility in any form.
GNU General Public License v2.0
448 stars 16 forks source link

Color range "Full" on Video capture device doesn't initialize correctly (only a green feed is sent) #34

Closed YorVeX closed 2 years ago

YorVeX commented 2 years ago

OBS 27.2.4 64 Bit on Windows 10 21H2 with Teleport 0.4.1

image

If Color Range is set to Full on a video capture device when initiating the Teleport transmission (i.e. starting the 2nd OBS instance involved in the transmission) the receiving source only shows a green color: image

All of the other settings on the video capture device (e.g. Color Space, Buffering...) don't affect this issue in any way, only Color Range is relevant here.

It can be temporarily fixed by switching the setting to Partial (this immediately makes the cam feed being transmitted instead of just green) and when switching back to Full even this is working (and the color range visually changes).

So it doesn't seem that Color Range set to Full isn't supported in general, it's only some initialization that fails when it is set to Full.

Another interesting thing: applying the workaround of switching to Partial and then back to Full is solving the problem proactively even before any Teleport transmission is active. So if only the sender OBS is started first, then Color Range is switched back and forth and afterwards the receiver OBS is started it will immediately work fine.

fzwoch commented 2 years ago

I'm not sure if that is not an inconsistency originating from the camera source plugin.

Here are some logs from the receiving side:

Initial full range

2022/06/08 08:36:39 {ColorMatrix:[1 0 1.40752 -0.70652 1 -0.345491 -0.716948 0.533303 1 1.778976 0 -0.892976 0 0 0 1] ColorRangeMin:[0 0 0] ColorRangeMax:[0 0 0]}

Switch to partial range

2022/06/08 08:37:36 {ColorMatrix:[1.164384 0 1.596027 -0.874202 1.164384 -0.391762 -0.812968 0.531668 1.164384 2.017232 0 -1.085631 0 0 0 1] ColorRangeMin:[0.0627451 0.0627451 0.0627451] ColorRangeMax:[0.92156863 0.9411765 0.9411765]}

Switch back to full

2022/06/08 08:38:21 {ColorMatrix:[1 0 1.40752 -0.70652 1 -0.345491 -0.716948 0.533303 1 1.778976 0 -0.892976 0 0 0 1] ColorRangeMin:[0.0627451 0.0627451 0.0627451] ColorRangeMax:[0.92156863 0.9411765 0.9411765]}

These values are just copied from the source frame that enter the filter.

Here we see that the color range changes when switching to partial range. Interestingly when switching back to full range the range values stay the same. So I would expect them switch back to 000/000 as in the beginning - or even better actually, include the range for the full range mode.

May be a misunderstanding on my side - does the color matrix compensate for the range? But then why is it inconsistent in the first place?

YorVeX commented 2 years ago

I am no expert on this either but I don't think the color matrix can compensate for anything when it's the same for full the first time and second time, at least it should be different then. And I am quite sure if you keep on switching back and forth it will stay consistent then and never go back to what it had the first time.

Also a range from 0 to 0 at the beginning? That just doesn't sound plausible, how would that supposed to be showing anything at all?

It would be nice if you could open an issue on the OBS GitHub for it with your findings, I don't even know how you gathered that data and couldn't explain it really well.

fzwoch commented 2 years ago

So.. it looks like when there is a full range frame OBS just sets a flag for that and ignores the range values completely. And to make things worse, it does not even reset these values, but they may actually contain garbage.

Weird design decision. While I can see a benefit of a full range flag, I would also assume the correct data being set in the range values as well.

Anyway I feel this should have been fixed with the above commit.

Note that in the above log the color matrices also change.. I hope that has a good reason I don't understand at the moment too..

YorVeX commented 2 years ago

Thanks for this fix, greetings from Berlin to Berlin BTW! 😃

I am always lazy about compiling things myself so hopefully there will also be a binary release soon 😎