Zingabopp / OBSControl

A Beat Saber mod to control and monitor OBS in-game.
Other
42 stars 4 forks source link

SRT file rename? #39

Open xtex404 opened 2 years ago

xtex404 commented 2 years ago

I'm betting this plugin doesn't do actual file renaming -- it's telling OBS to do it -- so this probably isn't possible, but I figured I'd ask... when using the OBS plugin "Cloud Closed Captions", you can configure it to write SRT files, since OBS doesn't embed subtitles into the MKV for some dumb reason... I then use ffmpeg to cram these into the resulting MP4 during remuxing.

Problem is... matching the SRT file up to the MKV. For now, I look at the mtimes -- any SRT that has a modification time within 2 seconds of the MKV, I assume that's the SRT file that should be with that video file. As a fallback, I then look at the filenames -- I configured OBS to use the same timestamp format as this plugin, and it usually matches up until the seconds. This (mostly) works. Usually. :)

In my screenshot you can see why this is kind of weird... the timestamp in the filename doesn't match... but the underlying file modification time does (within a few miliseconds, which I can see via python).

image

If this isn't possible, I'd normally ask if maybe OBSControl could call an external script/app with the filename parameters, and I could do the matching myself... but kicking off external processes from inside Beat Saber sounds like a great way to make a PC explode and burn down someone's house.

So... final compromise... maybe write a JSON file, with the original name and the renamed-name, somewhere I can get to it? :)

Zingabopp commented 2 years ago

OBSControl does just go through the file system, so it's possible.