Closed AWilco closed 3 years ago
First of all, thank you for asking this question.
To start an OBS output successfully, its encoder must be configured correctly. The current version configures the encoder when the output is started, so if you want to start the output programmatically, you must refer to the code in rtspOutputHelper
for initialization.
As for use with OBS-websocket, I'm still studying it. I will also consider solving this problem in a later version.
Hi iamscottxu,
I am working to combine OBS-RTSPServer with OBS-Websocket, to remotely start and stop the RTSP server.
RTSP server is installed and working, I can start and stop it using the Tools Menu dialog box. I have not enabled the autostart option.
OBS-Websocket has command build in to start and stop outputs. This calls
obs_output_start()
. If I try and run this after starting OBS, the command fails withcan't begin data capture
Looking into your code, before you call
obs_output_start()
you call:I'm currently assuming that this isn't called when the websocket plugin tries to start the RTSP output and this is what is causing it to fail. Is there are reason this is not called either in
rtsp_output_create
orrtsp_output_start
? I assume if it was called in one of these functions it would be created if the output was programmatically created by the websocket.My alternative option is I'm going to edit
rtsp_output_auto_start
to always update the encoders even if it does not automatically start streaming. Hopefully this will mean they are available when the websocket startsI'm not necessarily asking you to make a change to accomodate this. If there are drawbacks to either of the options I'm going to try then I'll look to just make it work for my use case. Just wanted to make you aware of my use case and see if you had any advice on the best way to make the change.
Thanks.