Hello everyone,
I would like to change the storage name of my recording via websocket.
I am using OBS 30.2.3.
I have a python script which connects well to the server and can stop/start recordings and more.
But what I can't do is change the recording name or location.
My script looks like this:
import time
from obswebsocket import obsws, requests
# Connection settings
host = "localhost"
port = 4455
password = ""
# Connect to OBS
ws = obsws(host, port, password)
ws.connect()
prefix = 'Test'
filename_format = f'{prefix}%CCYY-%MM-%DD_%hh-%mm-%ss'
print(filename_format)
recdir = ws.call(requests.GetRecordDirectory())
print(recdir)
ws.call(requests.SetRecordDirectory(RecordDirectory='C:\\VIDEO\\Test'))
recdir = ws.call(requests.GetRecordDirectory())
print(recdir)
profilepar = ws.call(requests.GetProfileParameter(ParameterCategory='Output', parameter_name='FilenameFormatting'))
print(profilepar)
ws.call(requests.SetProfileParameter(ParameterCategory='Output', parameter_name='FilenameFormatting', ParameterValue='1234'))
And this is what I get back:
Test%CCYY-%MM-%DD_%hh-%mm-%ss
<GetRecordDirectory request ({}) called: success ({'recordDirectory': 'C:\\VIDEO'})>
<GetRecordDirectory request ({}) called: success ({'recordDirectory': 'C:\\VIDEO'})>
<GetProfileParameter request ({'ParameterCategory': 'Output', 'parameter_name': 'FilenameFormatting'}) called: failed ({})>
If anyone can help or has an example of how you implemented this, I would be happy to read from you.
I would like to change the storage name of my recording via websocket.
I am using OBS 30.2.3.
I have a python script which connects well to the server and can stop/start recordings and more.
But what I can't do is change the recording name or location.
My script looks like this:
import time
from obswebsocket import obsws, requests
# Connection settings
host = "localhost"
port = 4455
password = ""
# Connect to OBS
ws = obsws(host, port, password)
ws.connect()
prefix = 'Test'
filename_format = f'{prefix}%CCYY-%MM-%DD_%hh-%mm-%ss'
print(filename_format)
recdir = ws.call(requests.GetRecordDirectory())
print(recdir)
ws.call(requests.SetRecordDirectory(RecordDirectory='C:\\VIDEO\\Test'))
recdir = ws.call(requests.GetRecordDirectory())
print(recdir)
profilepar = ws.call(requests.GetProfileParameter(ParameterCategory='Output', parameter_name='FilenameFormatting'))
print(profilepar)
ws.call(requests.SetProfileParameter(ParameterCategory='Output', parameter_name='FilenameFormatting', ParameterValue='1234'))
And this is what I get back:
Test%CCYY-%MM-%DD_%hh-%mm-%ss
<GetRecordDirectory request ({}) called: success ({'recordDirectory': 'C:\\VIDEO'})>
<GetRecordDirectory request ({}) called: success ({'recordDirectory': 'C:\\VIDEO'})>
<GetProfileParameter request ({'ParameterCategory': 'Output', 'parameter_name': 'FilenameFormatting'}) called: failed ({})>
If anyone can help or has an example of how you implemented this, I would be happy to read from you.