Random Playout

OBS Lua Random Playout 2024-01-28

LUA script that converts OBS into a random Playout application. After each show it displays a schedule of the next three upcoming shows with a random background music track. After the schedule it plays a short moment of Zen/interlude video before starting the next show.

Create three scenes in OBS:
  1. TV
    • Scene must have a Media Source object that will display the shows.
    • Recommend using "transform > Fit to screen" (ctrl+F) on the media source if the media you are playing doesn't have the same aspect ratio.
  2. Schedule
    • Scene must have three Text sources and a media source.
    • Text sources are used for displaying the next three shows. Apply a transition to them so they animate when they are displayed.
    • Media source is used to play background music.
  3. Zen
    • Scene must have a Media Source object that will display the interludes.
Create three text files:
  1. TV.txt
    • List of media you want to randomly play.
    • Each line should have a path of the media file followed by a title separated by a semicolon.
    • Example: C:\Users\firetime\Videos\show1.mkv;ShowTitle
  2. Music.txt
    • List of music you want to play in the background.
    • Each line should have a path to a song you want to play.
    • Example: C:\Users\firetime\Music\song.mp3
  3. Zen.txt
    1. List of short clips you want to play before starting a new show.
    2. Could be a station brand animation or funny clip. this can be disabled by creating a file with a single path to an invalid file. The script will skip once it realized it cant load the file after 1 second.
    3. Each line should have a path to a video you want to play.
    4. Example: C:\Users\firetime\Videos\zen\clip.mkv
Add show.lua to the Tools>scripts page with the + button and configure the script by filling out every field.
  • TV List, Music List, Zen List
    • absolute paths to the txt files.
    • Example: C:\Users\firetime\Documents\music.txt
  • TV Scene, Schedule Scene, Zen Scene
    • Exact names of the respective scenes.
  • TV Source, Zen Source, Music Source
    • "Media Source" sources used to play the respective content.
  • Up Next 1,2,3
    • Text sources on the Schedule scene.
    • Up Next 1 is the next show to be played.
    • Up Next 2 is the one after.
    • Up Next 3 is the one after that.
  • Schedule time
    • How long in seconds the schedule is shown for.
  • Prevent repeats checkbox
    • Will attempt to not select a show with the same title as anything on the current schedule.
    • Leave this unchecked if you don't have 4 or more unique titles.
  • Auto Start Stream
    • Automatically start OBS streaming 1 second after script is loaded.
    • Useful when loading OBS in a docker container or VM and want the show to automatically resume after updates.
  • Re-count lists button
    • Press this button when adding or removing items from any of the lists while OBS is running.
    • This will recount the number of rows in the text file that is used in the randomizer.
Example settings:Example Schedule:
Additional notes
If the script cannot find the media for the show or Zen it will auto skip after 1 second.
If not using "Auto Start Stream" select the Schedule scene to kick start the show.
First release
Last update
0.00 star(s) 0 ratings