Schedule Livestream (PT/EN) – OBS Lua Script

OBS Lua Schedule Livestream (PT/EN) – OBS Lua Script 1.0

Schedule Countdown Slots (EN)​

Multi-slot scheduler for OBS that runs countdowns before your shows, switches scenes, starts/stops the stream, and syncs recording — all on a schedule.
Designed for churches, podcasts, radio, webinars, and 24/7 channels.

Highlights​

  • Up to 5 scheduled slots per day (configurable in code).
  • Countdown scene → LIVE scene flow per slot.
  • Start stream: at countdown start, on zero, or never.
  • Global Stop (time/scene/delay) and per-slot Stop, each with optional recording post-roll (keep recording X sec after the stream ends).
  • Per-slot transitions (dropdown; use any installed transition) + duration.
  • Audio controlswith checkboxes:
    • Duck specific sources during countdown (set % level).
    • Mute sources during countdown.
    • Auto-unmute sources when LIVE.
    • Optionally include global Mixer sources in the lists.
  • Overlap policy for conflicts: Skip, Queue (default), or Interrupt.
  • Studio Mode Assist: auto-sets Preview and triggers the transition for you.
  • Scene lock during countdown to avoid accidental scene changes.
  • Recording partition per slot: Normal / Pause (resume on LIVE) / New file on LIVE.
  • Export / Import the whole schedule (JSON + CSV), with file pickers.
  • Daily state persistence (avoids retriggering the same slot twice).

Requirements​

  • OBS Studio 28+ (Windows/macOS/Linux).
  • Works with any countdown-capable text source (the script can auto-create one named “Countdown”).

Installation​

  1. Save the script file (PT: agendar_countdown_slots.lua or EN: schedule_countdown_slots_en.lua) anywhere you like.
  2. In OBS: Tools → Scripts → “+” → select the .lua.
  3. The panel will appear with Global Settings and Slot 1..5.

Quick Start (2 minutes)​

  1. In Slot 1:
    • Enable slot.
    • Set Start time (HH:MM).
    • Pick COUNTDOWN Scene and LIVE Scene.
    • Leave Auto-create “Countdown” text ON (or pick an existing text source).
    • Set Duration (e.g., 5 minutes).
    • Start the stream: “When COUNTDOWN starts” (or) “When COUNTDOWN hits zero”.
  2. (Optional) Audio:
    • Tick sources to Duck or Mute during countdown.
    • Tick sources to Unmute on LIVE.
  3. (Optional) Stop:
    • For a global stop: enable Global Stop time; select Scene BEFORE stopping and Delay.
    • Or per-slot stop inside the slot (different end scenes per show).
  4. Click Test now (start immediately) to simulate.
  5. Done. The script will trigger every day at that time (respecting days of week if you change them).

How It Works​

Countdown text​

  • If you select a text source, the script writes the ticking time into it.
  • If you leave it blank and keep Auto-create ON, it will create a text source named “Countdown” inside the COUNTDOWN Scene.
  • The format (show days/hours/minutes/seconds) is global in “Show units in timer.”

Scene switching​

  • At the scheduled time, the slot:
    1. Applies audio profile for countdown (duck/mute).
    2. Shows the COUNTDOWN Scene immediately, or X seconds before zero (prezero mode), or keeps it hidden (you can cut manually).
    3. At zero, it switches to LIVE Scene, restores audio, and optionally starts the stream (if you set start = “on zero”).
  • Transitions: you can select a specific transition and duration per slot (or “Use current transition”).

Stream start retry​

  • If OBS fails to start streaming, the script retries (global setting: attempts + interval).

Overlaps (conflicting slots)​

  • Skip: ignore the new one.
  • Queue (default): wait until the current slot finishes, then start the next.
  • Interrupt: stop the current countdown and start the new slot immediately.

Stop (Global and Per-slot)​

  • Global Stop: at the specified time, the script optionally switches to a scene, waits Delay, then stops streaming.
    You can also keep recording running for X seconds after the stream ends (post-roll) — then the script stops recording (if “Stop recording when the stream stops” is enabled).
  • Per-slot Stop: same as global but scoped to that slot (lets you use a different end scene per show).

Recording sync & partition​

  • Record together with the stream (global) — start/stop recording in sync with the stream.
  • Per-slot “Record start/stop” overrides global.
  • Partition:
    • Normal — no split.
    • Pause on COUNTDOWN, resume on LIVE — if your OBS supports recording pause.
    • New file when entering LIVE — clean file just for the live portion.

Studio Mode Assist​

  • If Studio Mode is ON and Assistis enabled:
    • The script sets Preview → Countdown beforehand (or “prezero” seconds before) and triggers the transition for you.
    • On zero, it prepares Preview → LIVE and transitions to Program.

Audio selection (checkboxes)​

  • The lists show audio sources found in your selected COUNTDOWN/LIVE scenes (plus Mixer sources if “Include global Mixer” is enabled).
  • Change scenes → click Refresh lists if needed.
  • Duck level (%) controls the reduced volume during countdown for the checked sources.

Export / Import​

  • Use the file pickersat the bottom:
    • Export creates a JSON (for import) and a CSV (human-readable) next to the chosen path.
    • Import applies the JSON into memory (no OBS restart needed).

Daily Persistence​

  • The script writes a small JSON next to the .lua with today’s state, so the same slot won’t fire twice in the same minute.

Buttons you’ll use a lot​

  • Test now (start immediately) — simulates the slot without waiting for the clock.
  • Refresh lists — repopulates scenes, transitions, and audio checkboxes.
  • Open script folder — opens the folder where exports and the daily state file live.

Best Practices​

  • Keep Overlap policy = Queue (default) for back-to-back shows (10:00, 11:00, 12:00…). It behaves like a scene/show manager, never cutting a live show abruptly.
  • Use Per-slot Stop to end each show on its own end scene; leave Global Stop as a safety.
  • Prefer prezero mode (e.g., 10–30 seconds) if you want the countdown to appear right before zero but keep a different scene earlier.
  • If your stream VOD should not contain the countdown, use Recording partition → New file on LIVE.

Troubleshooting / FAQ​

Nothing happens at the scheduled time.
• Check your PC clock/timezone.
• Ensure Enable slot is checked and Start time is HH:MM (24-hour).
• If you opened OBS a few minutes late, increase Global tolerance.

Export/Import shows no popup.
• It’s normal. Use the file pickers to choose the JSON path. The script logs success in Scripts → Log.

My transition list is empty / missing names.
• Click Refresh lists. Make sure the transitions exist in OBS.

No audio sources in the checkboxes.
• Select your COUNTDOWN/LIVE scenes first, then click Refresh lists.
• Enable Include global Mixer to add device-level sources.

Recording didn’t pause.
• Your OBS build may not support recording pause; the script falls back gracefully.

Will it interrupt an ongoing show when the next slot time comes?
• Only if Overlap policy = Interrupt. With Queue (default), it waits and starts right after.


Credits & License​

  • Script by Missão Live.
  • Free to use and modify. Please keep attribution and share improvements with the community.
Author
gumedina
Downloads
102
Views
420
First release
Last update
Rating
0.00 star(s) 0 ratings
Top