obs-websocket-community-projects / obs-websocket-js

Consumes https://github.com/obsproject/obs-websocket
MIT License
661 stars 95 forks source link

How to set sourceName (video file name) #220

Closed toufikwb closed 3 years ago

toufikwb commented 3 years ago

first i'm a noob developer, i want to set custom file name to the video, can i do that? if that possible please show me the code : here is what i'm trying :

const obs = new OBSWebSocket();
    obs.connect({
        'sourceName' : 'newName'
    });
......
obs.send('StartRecording');
......
obs.send('StopRecording');

here is the link i'm trying to follow : https://github.com/Palakis/obs-websocket/blob/4.8.0/docs/generated/protocol.md#setsourcename

i'v also tried the following : obs.send('SetSourceName', { 'sourceName' : 'newName' }); obs.send('StartRecording'); everything works well except that the name of the file is the datetime

zoton2 commented 3 years ago

If you're still curious, you can set the folder the recording is stored in using SetRecordingFolder and set the filename using SetFilenameFormatting. "Source name" that are you are trying to use is completely unrelated to recording file names.