Does obs have save file name as feature popping up after clicking stop record?

totess

New Member
Does obs have save file name as, popping up after clicking stop record?
Right now it just saves the files with the date. I would like it to ask me for a file name.
 

koala

Active Member
The file is already written when you click the stop button. It's already done. OBS is just finalizing and closing it. The file name template can be configured in settings->Advanced->Recording->Filename Formatting. Hold the mouse over the input field and you will see a bunch of macro definitions you can use to customize the name.
 

totess

New Member
The file is already written when you click the stop button. It's already done. OBS is just finalizing and closing it. The file name template can be configured in settings->Advanced->Recording->Filename Formatting. Hold the mouse over the input field and you will see a bunch of macro definitions you can use to customize the name.
But its just date and video format, these types of things rather then actually customizable.
 

wwk

New Member
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):
Code:
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:
Python:
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()
 

lucasdep

New Member
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):
Code:
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:
Python:
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()

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.
 

Claude Maurice

New Member
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.
This is also what I need for our lab use. OBS need to have a file name template other than only time & date as suffix, even just a numeric counter would be great as the suffix. Option to enter the file name after the recording would be ideal! OBS would save video in a temp file name then pop-up window would appear to enter new name. I'd like to give your code a try in the mean time. thanks
 

Endcoder

New Member
Hi,

I found your post which should fulfill exactly my needs.
I tried to follow your explanation, but wasn't able to make it work.

I installed Python for Windows (version 3.10.2)
I installed obs websocket by using the Windows Installer version 4.9.1 .
I installed obs websockets python using the pip install command (version 0.5.3)
I created a .py file located in my C:\Users\user\AppData\Local\Python\Python310\Scripts folder with exactly the code you posted.
I start OBS and run the script using the cmd, navigating to the folder mentioned above just with the command "obs-changename.py".

Anything I'm doing wrong? There is no popup or cmd request, where I could insert my filename.
If I change your script from input() to "Test 1" + " - %MM-%DD %hh-%mm" it is working.


Waiting for your feedback!
Have a good one!
Thanks and best regards
 

lucasdep

New Member
This is also what I need for our lab use. OBS need to have a file name template other than only time & date as suffix, even just a numeric counter would be great as the suffix. Option to enter the file name after the recording would be ideal! OBS would save video in a temp file name then pop-up window would appear to enter new name. I'd like to give your code a try in the mean time. thanks
Hi!
I just read your reply. So glad you could do something good with it. Have you made any progress with that idea you had? I was thinking about giving it a try and upgrade the code and instructions, I'll post what I come up with.
Thx in advance!
 

lucasdep

New Member
Hi,

I found your post which should fulfill exactly my needs.
I tried to follow your explanation, but wasn't able to make it work.

I installed Python for Windows (version 3.10.2)
I installed obs websocket by using the Windows Installer version 4.9.1 .
I installed obs websockets python using the pip install command (version 0.5.3)
I created a .py file located in my C:\Users\user\AppData\Local\Python\Python310\Scripts folder with exactly the code you posted.
I start OBS and run the script using the cmd, navigating to the folder mentioned above just with the command "obs-changename.py".

Anything I'm doing wrong? There is no popup or cmd request, where I could insert my filename.
If I change your script from input() to "Test 1" + " - %MM-%DD %hh-%mm" it is working.


Waiting for your feedback!
Have a good one!
Thanks and best regards
Hi there! I'm glad my post helped you!
I just checked the code on another PC installing as you said and worked just fine.
I think that maybe it has something to do with your input, you should try by making another .py file without connecting it to OBS and test the input() function. Let me know if that was the case.
Hope this helps you!
 

smslv

New Member
As OBS v28 uses API 5+, which obs-websocket-py does not understand, I wrote a new version of this script using obs-api-python (and easygui for a popup).

My script asks for a name after the file is finished recording and renames it on disk. It can also remember the last name and automatically increment a number suffix. I added it to the OBS settings to be launched automatically with it.

https://github.com/ismslv/obs-scripts/blob/main/obs_rename_recording.py
 
As OBS v28 uses API 5+, which obs-websocket-py does not understand, I wrote a new version of this script using obs-api-python (and easygui for a popup).

My script asks for a name after the file is finished recording and renames it on disk. It can also remember the last name and automatically increment a number suffix. I added it to the OBS settings to be launched automatically with it.

https://github.com/ismslv/obs-scripts/blob/main/obs_rename_recording.py
I tried using your script but got no popup, am I missing something?
Installed Python, then installed easygui module and I loaded the script on OBS.
 

roniji

New Member
As OBS v28 uses API 5+, which obs-websocket-py does not understand, I wrote a new version of this script using obs-api-python (and easygui for a popup).

My script asks for a name after the file is finished recording and renames it on disk. It can also remember the last name and automatically increment a number suffix. I added it to the OBS settings to be launched automatically with it.

https://github.com/ismslv/obs-scripts/blob/main/obs_rename_recording.py
Ty this worked for me as well obs 28.0.3 python 3.10
 

appy4

New Member
As OBS v28 uses API 5+, which obs-websocket-py does not understand, I wrote a new version of this script using obs-api-python (and easygui for a popup).

My script asks for a name after the file is finished recording and renames it on disk. It can also remember the last name and automatically increment a number suffix. I added it to the OBS settings to be launched automatically with it.

https://github.com/ismslv/obs-scripts/blob/main/obs_rename_recording.py
Possible to do some changes in script to include replay buffer file as well?
 

markbowendesign

New Member
Hi there,

Was wondering if someone could possibly talk me through how to get this working?
I'm on a Mac running OBS Studio 29.1.3.
I installed Python 3.11.4 (latest version) from the Python.org site, set the Python install path within OBS at Tools->Scripts->Python Settings to /Library/Frameworks then installed EasyGui using pip3 install easygui in the terminal and then installed the obs_rename_recording.py script by going to Tools->Scripts in OBS and pressing the + icon, navigating to the script and adding it.
If I now hit record then OBS records as it always has but doesn't come up with a popup asking me for a filename.

I'm seriously a complete newb when it comes to this sort of thing so really no idea what I'm doing so any help would be massively appreciated.

Many thanks,

Mark
 

markbowendesign

New Member
Ah one thing I just noticed is above it mentions obs-api-python. Is this something I need to install to get this working and if so where do I download it and how do I install it? A search on Google didn't really come up with anything for that name so not too sure what that is?

Many thanks,

Mark
 

godlyvex

New Member
I get an error saying
[obs_rename_recording.py] ModuleNotFoundError: No module named 'obs_rename_recording'
How is the script missing itself? That makes no sense.
Edit: I was able to fix this by putting it in the scripts folder in OBS. I also had to put the easygui.py file there. But now this plugin still doesn't work, and nothing appears in the script log anymore. So... that's cool.
 
Last edited:
Top