0

OBS allows you to change the pattern for the recordings filenames but there is no simple way to update the file name with any custom string before every recording.

You need to visit the options pane and change settings manualy. The default for the filename formating is: "%CCYY-%MM-%DD %hh-%mm-%ss"

Let's say you've changed the pattern to "MY-HOME-VIDEO %CCYY-%MM-%DD %hh-%mm-%ss" and recorded a file.

Then if you need to make another recording about something else with the prefix "MY-OTHER-VIDEO " you need to change the pattern again, manually.

How to update the filename formating without visiting options pane every time?

0

I've managed to achieve this using obs-websocket and simple/dirty python script. The obs-websocket plugin can get/set the pattern used by OBS to save recording files.

Steps: Install/configure obs-websocket plugin. Then use obs-cli (https://github.com/leafac/obs-cli) or obswebsocket (https://pypi.org/project/obs-websocket-py/).

cli example (under Windows os, beware of double quotes):

obs-cli-win SetFilenameFormatting="{ ""filename-formatting"": ""TESTNAME %CCYY-%MM-%DD %hh-%mm-%ss"" }" && ^
obs-cli-win StartRecording && ^
obs-cli-win SetFilenameFormatting="{ ""filename-formatting"": ""%CCYY-%MM-%DD %hh-%mm-%ss"" }" && ^
obs-cli-win GetFilenameFormatting

python example:

client = obswebsocket.obsws("localhost", 4444, "")
client.connect()
print(client.call(obswebsocket.requests.GetFilenameFormatting()))
client.call(obswebsocket.requests.SetFilenameFormatting("TESTNAME" + " - %CCYY-%MM-%DD %hh-%mm-%ss"))
client.call(obswebsocket.requests.StartRecording())
print(client.call(obswebsocket.requests.GetFilenameFormatting()))
client.call(obswebsocket.requests.SetFilenameFormatting("%CCYY-%MM-%DD %hh-%mm-%ss"))
print(client.call(obswebsocket.requests.GetFilenameFormatting()))
client.disconnect()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.