David White
New Member
Currently it is easy to automate starting a live stream with the --startstreaming command-line option. However there is no easy way to automate stopping a live stream.
- Ideally, there would be an "obs64 --stopstream" CLI option that would cause OBS to find the currently-running obs64.exe project and terminate its stream (rather than launching a new obs64 instance, of course). There is currently no such option.
- In Windows, one might try running "taskkill /IM obs64.exe". However, since this only sends a "soft" terminate request, the only result is that OBS pops up an "OBS is currently active... are you sure you want to shut down?" box. Repeated calls to "taskkill" cannot get past this box.
Note that the Settings -> General option "Show confirmation dialog when stopping streams" does not affect this issue. Even when the box is unchecked, the "Are you sure?" dialog box will still be shown if the user attempts to exit OBS while a stream is running.
- Due to this (again in Windows), one might be tempted to try "taskkill /F /IM obs64.exe" to forceably kill OBS. While this works, it has the unfortunate side effect of preventing OBS from releasing its lock on the video capture card (if that is the stream source). Therefore if one launches OBS a second time, it will be unable to acquire the capture card and begin streaming again until the PC is rebooted.
- Therefore the only solution we've gotten to work is a rather clunky, not-always-reliable AutoHotKey script that pushes the right buttons and clicks the right dialog box buttons (if it works like it it's supposed to, and if nobody is actually using the PC when it runs.)
- Add a --stopstreaming option to the CLI. (This is how Adobe Flash Media Live Encoder works, which makes it easy to create Windows Scheduled Tasks that call FMLECmd.exe to both start and stop streams)
- Add an option to disable the "OBS is currently active... are you sure you want to shut down?" as a Settings -> General option. (Possibly this setting should simply be rolled into "Show confirmation dialog when stopping streams") Alternatively, add a checkbox to the "Are you sure?" dialog box labeled "Do not ask about this again".