Mission Live – Native Scheduler for OBS (Lua, no WebSocket)
A lightweight, pure-Lua scheduling script for OBS 28+ that starts and stops your streams on a timetable — with scene switches, optional on-screen countdown, and custom RTMP service application. Built to be simple, resilient, and self-contained (no OBS WebSocket required).What it does
- Lets you define up to 10 fixed “slots” (events) for today.
- Each slot has:
- Start time and End time (HH:MM or HH:MM:SS – seconds optional).
- Countdown scene + text source (optional) to show a timer before “On Air”.
- Live scene to switch to when the countdown finishes (or immediately if disabled).
- Closing scene then Stop Streaming after a delay.
- Custom RTMP: server URL, stream key, and optional auth (applied before starting).
- Catch-up tolerance (minutes): if OBS was opened late, it can still start a slot that recently began.
- One-click 10s test: applies RTMP, shows countdown, starts for 10s, then stops.
- Export/Import JSON of all slots to reuse on other machines/profiles.
- Password inputs for stream key and password fields.
- Daily reset at midnight so slots can be reused next day without editing.
Requirements
- OBS Studio 28+ (Windows/macOS/Linux)
- (Optional) LuaJIT cjson module. If not present, the script falls back to a simple JSON encoder/decoder.
Installation
- Save the file as agendador.lua.
- In OBS: Tools → Scripts → + → select agendador.lua.
- The script starts ticking immediately (1s interval).
Quick setup
- Create (or pick) scenes:
- A countdown scene (optional).
- A live/on-air scene.
- A closing scene (e.g., “FIM”).
- Create a Text source (GDI+ on Windows / FT2 on macOS/Linux) to display the countdown.
(Optional – leave blank to skip on-screen countdown.) - In Scripts → agendador.lua, for each slot you’ll use:
- Toggle Active.
- Set Name, Start, and End time (HH:MM or HH:MM:SS).
- Pick Countdown Scene and Text Source (if you want a timer).
- Set Countdown seconds.
- Pick Live Scene and set Transition (ms) if desired.
- Pick Closing Scene and Delay before Stop (s).
- Fill RTMP URL and Stream Key (and User/Pass if your endpoint requires it).
- Set Catch-up tolerance (minutes) if OBS might be opened a bit late.
- (Optional) Use Slot for Test + Test slot (10s) to verify everything.
- Leave OBS open — the scheduler will do the rest.
How scheduling works (today only)
- Every second the script checks the current time.
- If now is exactly the Start time (or within the tolerance window) and the slot hasn’t fired today:
- Applies the custom RTMP service (server/key[/auth]).
- Switches to Countdown Scene (if set) and runs the countdown on the Text Source.
- Switches to the Live Scene (or straight to Live if countdown is 0/disabled).
- Marks the slot as started for today.
- When now reaches Endtime (and the slot hasn’t been stopped yet):
- Switches to Closing Scene (if set).
- Waits the Stop delay, then calls Stop Streaming.
- Marks the slot as stopped for today.
- At midnight (based on system time), the script resets the “fired today” flags so slots can run again next day without edits.
Export / Import
- Export JSON: choose a path and click Export JSON — saves all 10 slots (active/inactive, fields, etc.).
- Import JSON: choose a file and click Import JSON — replaces current slots with the file contents.
Notes & tips
- Seconds are optional in start/end: 09:30 is fine; 09:30:00 also works.
- If a Text Source is missing or renamed, the log will warn and the countdown will simply be skipped.
- The script won’t change RTMP service while you’re already streaming (prevents OBS errors).
- The stream key/password fields are masked in the UI but are stored in your OBS profile data (like any other script setting).
- If you adjust a slot after it already started/stopped today, it won’t re-fire until tomorrow (by design).
Troubleshooting
- Didn’t start at the time
- Check the system clock and time zone.
- Confirm the slot is Active and times are valid (HH:MM or HH:MM:SS).
- Verify RTMP URL/Key are set (the script ignores slots without them).
- Increase Catch-up tolerance if launching OBS a bit late.
- Countdown text didn’t update
- Ensure you selected an actual Text source (GDI+/FT2) and it’s present in the chosen scene.
- Didn’t stop
- Confirm End time format and that Delay before Stop isn’t huge.
- Check if any other automation (macro/plugin) is interfering with Stop Streaming.
- Changing times doesn’t retrigger
- That’s expected for the same day. Re-run tomorrow or duplicate to a new slot with a later time.
Tested with
- OBS 28+ on Windows. (Should work on macOS/Linux as well — feedback welcome!)
- Works with cjson or the built-in lightweight JSON fallback.
Download
Attach agendador.lua to your post (or link your repo).I’m happy to iterate — suggestions and PRs welcome!
Changelog (highlights)
- Slots: up to 10, with Active toggle.
- Seconds optional in time fields.
- Dropdowns for Scenes and Text sources.
- Custom RTMP apply at start (non-intrusive while live).
- Countdown runs asynchronously (doesn’t block UI).
- Closing scene + delayed Stop.
- Catch-up start window.
- 10s test, Export/Import JSON.
- Daily auto-reset of fired flags.
- YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.