NDI Preview Tally sent if Multiview is opened.
Hello OBS-NDI-contributers,
NDI supports Tally-Lights for Preview and Program, so the camera can display if it is on air or about to go on air. OBS-NDI sends these Tally-Notifications, but it also sends a preview tally in multiview when the NDI Source is not in preview.
I have taken a few screenshots to visualize: https://imgur.com/a/wY3MyvX
Log (not that helpful, but anyways): https://obsproject.com/logs/5UST8pBwz6zkrs3K
Thanks in advance and have a nice day, Kevin
I think this is related:
When you have 3 scenes:
- NDI
- Color green
- Color white
and you have 2 in preview and 3 in program:
- NDI still showing up green preview frame on NDI HX app.
When i remove NDI source from scene 1 - NDI HX app hide green frame.
So my conclusion is that obs-ndi plugin send preview state always.
After studying a while the current situation, I posted a feature request/idea on OBS Studio dedicated area.
In fact, the incriminated line is https://github.com/Palakis/obs-ndi/blob/adcf4f09acd02cf355c7f9a2541232adbb480d1a/src/obs-ndi-source.cpp#L495 that returns true for all the source in Multiview.
The user WBE suggested to check if the source is in preview this way: (code is in Python and not tested)
preview_scenesource = obs.obs_frontend_get_current_preview_scene()
if preview_scenesource is not None:
preview_scene = obs.obs_scene_from_source(preview_scenesource)
obs.obs_source_release(preview_scenesource)
if preview_scene is not None:
all_scene_items = obs.obs_scene_enum_items(preview_scene)
if all_scene_items is not None:
for curr_scene_item in all_scene_items:
curr_source = obs.obs_sceneitem_get_source(curr_scene_item)
obs.sceneitem_list_release(all_scene_items)
This is a "frontend" solution, and the alternative would be to make a Pull Request on the OBS Studio project implementing a function like obs_source_showing, which also requires some modifications in all the places where a Scene get added or Removed to Preview.
I just implemented the python code to test it. The code works fine to test, but some other things had to change. The plugin also sets the tally light status in ndi_source_shown. This is usually where the tally light is set as ndi_source_update only gets called when settings change, or on load. It seems that the ndi_source_shown function is NOT called when the multi view is open, as it is shown once on open, and the state never changes. The only working solution I have found so far is to use the video_tick hook and only update the tally light on state change.
This overall solution has the added benefit of lighting up the preview light when the source is only on preview and not on program. Before if the source was on program, both lights would be on.
As stated by @tt2468 in #609 (comment), this issue will be solved with an appropriate solution implemented in OBS Studio, as suggested in my comment above.
This is a "frontend" solution, and the alternative would be to make a Pull Request on the OBS Studio project implementing a function like obs_source_showing, which also requires some modifications in all the places where a Scene get added or Removed to Preview.
I am not sure what is the plan for the rewrite branch, and if the solution proposed at https://github.com/Palakis/obs-ndi/pull/609#issuecomment-968260490 is still planned, but the issue is still present.