exeldro / obs-source-record

GNU General Public License v2.0
333 stars 37 forks source link

[Feature Request] Exposing file output settings to Websocket #75

Open kosukesando opened 1 year ago

kosukesando commented 1 year ago

I'd like to edit the file output using OBS WebSocket, and from what I know I'd be using SetSourceFilterSettings for other filters, but Source Record does not seem to expose settings except for 'record_mode' and 'stream_mode'. Would this be a complicated fix to expose the file output setting to filter settings (and in turn to WebSocket)? If not, it would be very appreciated if someone could patch this.

kosukesando commented 1 year ago

For context on what I've tried, I also saw that the module registers a source with 'source_record_filter_update' set as the callback(?) for updating the source settings. Given this, I thought I could somehow change the settings through SetInputSettings, but I have a suspicion that 'Sources(OBS Studio)' = 'Inputs(WebSocket Protocol)' ≠'Sources(obs_source_t)' since I cannot see the Source Record 'Source' listed when I call GetInputList.

I've also found that calling GetOutputList before starting record does not list the SR output, but calling it after starting record lists the output. I can set the file output through SetOutputSettings but that probably wouldn't work since it's already started recording.

>GetOutputList() >>{'outputActive': True, 'outputFlags': {'OBS_OUTPUT_AUDIO': True, 'OBS_OUTPUT_ENCODED': True, 'OBS_OUTPUT_MULTI_TRACK': True, 'OBS_OUTPUT_SERVICE': False, 'OBS_OUTPUT_VIDEO': True}, 'outputHeight': 1080, 'outputKind': 'ffmpeg_muxer', 'outputName': 'SR', 'outputWidth': 1920}

>GetOutputSettings() >>{'path': 'C:\\Users\\user\\Videos/2023-02-21 11-57-34.mkv'}

Even if it's possible to register the output before starting recording and changing the settings there, I would have to know which output name corresponds to which source, and I imagine everyone using the default 'Source Record' for all their inputs since there's no motivation for changing it otherwise. I'd rather have each source have the same name for its SR filter, and not have to think about renaming the filter(the original request).