I tried your method and I get this error:Hey, I created an account just for thanking you. I made some tweaks to your Python example and it worked great!
I want to clarify some things in case anyone wants to do exacly what the OP wanted. You should follow these steps:
1. Install the obs-websocket plugin
2. Install the obs-websocket-py which is the Python tool for the plugin (you can do this using pip)
3. Create a new .py file wth this code:
Python:import obswebsocket from obswebsocket import obsws, events, requests client = obswebsocket.obsws("localhost", 4444, "") #Change this if you have a different name, port or password client.connect() client.call(obswebsocket.requests.GetFilenameFormatting()) print("Hi! I'm your new video\nWhat's my name?\nFilename:") client.call(obswebsocket.requests.SetFilenameFormatting(input() + " - %MM-%DD %hh-%mm")) #Custom name + date. The best of two worlds client.call(obswebsocket.requests.StartRecording()) print(client.call(obswebsocket.requests.GetFilenameFormatting())) client.call(obswebsocket.requests.SetFilenameFormatting("-%MM-%DD %hh-%mm-%ss")) print(client.call(obswebsocket.requests.GetFilenameFormatting())) client.disconnect()
4. Open OBS and execute the code
And voilà! A new window will open and it should ask you for your video's name and then start recording.
I wanted to write this bc it took me a lot of time to figure this out. So let me know if it helped you too.
[OBSrename.py] Traceback (most recent call last):
[OBSrename.py] File "C:\Users/godly/Desktop\OBSrename.py", line 3, in <module>
[OBSrename.py] import obswebsocket
[OBSrename.py] ModuleNotFoundError: No module named 'obswebsocket'
I don't understand how this is the case, I installed obswebsocket using the installer, which should be foolproof. I also installed obswebsocket-py.