I am trying to detect when OBS starts streaming in a LUA script. I've used a similar approach for recording and there it seems to work reliably.
This is the code I am using:
The issue is, it only works if I load/reload the script in OBS after having streamed. If the current instance of OBS hasn't streamed before loading the script, streaming_output is nil and streaming_start never gets called.
Am I using a wrong approach to detecting when OBS starts streaming, or is there something else going on?
Any help is greatly appreciated!
This is the code I am using:
Lua:
obs = obslua
function streaming_start(calldata)
print("streaming_start called")
end
function script_load(settings)
streaming_output = obs.obs_frontend_get_streaming_output()
streaming_ouput_handler = obs.obs_output_get_signal_handler(streaming_output)
obs.signal_handler_connect(streaming_ouput_handler, 'start', streaming_start)
end
Am I using a wrong approach to detecting when OBS starts streaming, or is there something else going on?
Any help is greatly appreciated!