Reload service.json to make new server URL address effective

nikolaus

New Member
Hi,

We are using OBS in junction with a streaming server, however the server's rtmp URL is different each time creating a stream.
We are thinking to update the service.json on the fly, it seems possible, but the updated json doesn't reload in OBS, is there a way we can force OBS to reload the updated service.json ?
Many thanks.

Regards,
 

HebelHuber

New Member
Hi,

Just registered to add to this. I know i am necroing here, but was there ever a solution?
I have a script to switch between different stream keys by modifing the service.json, but have not found a way to apply/reload those settings.

i tried to set a different profile and back with
Python:
obs.obs_frontend_set_current_profile("temp")
obs.obs_frontend_set_current_profile(profilename)
to force a profile reload, but that also didn't help.

Thanks for any input
 
Last edited:

HebelHuber

New Member
So i managed to do it with a detour using the websockets plugin and Elektordi's python connector.

Python:
    # connect to local websocket plugin
    wsclient = obswebsocket.obsws("localhost", 4444, "")
    wsclient.connect()

    # change key and save to disk
    streamsettings = {"key":newKey,"server":"rtmp://a.rtmp.youtube.com/live2","service":"YouTube / YouTube Gaming"}
    wsclient.call(obswebsocket.requests.SetStreamSettings("rtmp_common", streamsettings, True))   

    # double check
    streamsettings = wsclient.call(obswebsocket.requests.GetStreamSettings()).getSettings()
    print("New streamkey: " + streamsettings["key"])

    wsclient.disconnect()

It seems a bit convoluted, but it works for me, so there's that ;)
 
Top