Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

OBS Lua Script to Reload a Playlist After All Videos Finish

For an unchanged VLC playlist, enable Loop Playlist. For a custom refresh, OBS Lua can react to media_ended and update source settings, but verify playlist-end behavior and expect playback to restart.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you only want the same VLC Video Source playlist to repeat, turn on Loop Playlist in the source properties—no Lua script is needed. If you mean “reload” as in apply changed playlist settings or run a custom action after playback ends, OBS Lua can connect to a media_ended signal and update the source, but that update rebuilds playback and may interrupt it. A media-ended signal alone is not documented as proof that the entire playlist—not just one item—has finished.

Choose between looping and reloading

Approach Use it when Trade-off
VLC Video Source with Loop Playlist enabled You want the same configured list to start over after it runs out of media. It repeats the configured playlist; it is not a custom workflow for re-reading changed playlist settings. OBS VLC Video Source guide
Lua callback plus a VLC source settings update You need a custom response to a media-ended event or want to apply changed playlist settings. Updating settings rebuilds the VLC source’s playlist/player handling and can restart playback. The signal documentation does not establish that every event marks the end of the entire playlist. VLC source implementation

Set up the VLC Video Source

  1. Install VLC on the computer running OBS. The VLC Video Source is available only when VLC is installed. OBS VLC Video Source guide
  2. In OBS, add or select a VLC Video Source and add the media files to its playlist.
  3. Open the source properties. If your goal is simply to repeat the same list, enable Loop Playlist. Use Shuffle Playlist only if you want playback order randomized.
  4. Test the source through the end of its list. Confirm its behavior in your own OBS and VLC versions before adding a script.

What Lua can detect—and what it cannot assume

OBS scripting uses the obslua module, and scripts are managed under Tools > Scripts. OBS source APIs expose media lifecycle signals, including media_ended, and Lua can connect a callback to a source’s signal handler with signal_handler_connect(handler, signal, callback). OBS scripting documentation OBS source API

As an Amazon Associate I earn from qualifying purchases.

The signal name tells you that media ended; it does not, by itself, establish that the final playlist item ended. A playlist can contain multiple items, and source behavior can vary with the OBS/VLC versions and configuration. Observe the signal behavior in your setup before using it to trigger a full-list reload. Do not refresh on every event unless that is the behavior you actually want.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Lua implementation pattern for a refresh

The following is a version-sensitive implementation outline, not tested, drop-in code. It shows the sequence: identify the VLC source by its OBS source name, obtain its signal handler, connect a callback to media_ended, and update its settings when your own end-of-playlist check says to refresh. The exact source name and the way you determine that the whole list ended must be verified in your setup.

#1 Best Overall
Sale
Elgato Stream Deck MK.2 Studio Controller, 15 Macro Keys
  • 15 Customizable LCD Keys: instantly control your apps, tools and platforms.
  • One-Touch Operation: trigger single or multiple actions, launch social posts, adjust audio, mute mic, turn on lights, and much more.
  • Visual Feedback: know that your command has been executed.
  • Powerful Plugins: Elgato 4KCU, OBS, Twitch, YouTube, Twitter, Discord, Spotify, Philips Hue, and many more.
  • Hotkey Actions: streamline your film editing, music production, photography workflow, etc.
  1. In Tools > Scripts, add a Lua script and load the obslua module as required by the OBS scripting interface.
  2. Find the VLC Video Source using its exact OBS source name. Obtain the source’s signal handler and connect the callback using signal_handler_connect(handler, "media_ended", callback).
  3. In the callback, first determine whether the event represents the end of the entire playlist. Only then proceed with a refresh; the signal itself is not documented as a whole-playlist boundary.
  4. Read the source settings and preserve the existing playlist array and each entry’s value field unless you intend to replace the list. Apply the settings update only when there is a real change or a deliberate restart to perform.
  5. Release OBS data and source objects according to the scripting API’s ownership rules. Incorrect handling can leak memory or crash OBS. OBS scripting documentation

OBS’s VLC source implementation reads the playlist settings array and rebuilds the playlist when settings are updated. That makes a settings update consequential: it can restart player handling, rather than seamlessly refreshing the current playback in place. VLC source implementation

Test and troubleshoot the refresh

  • The playlist never starts over: Check that Loop Playlist is enabled if you want ordinary repetition, and confirm the source is a VLC Video Source with the expected files.
  • The script reacts between items: The callback may be receiving an event for an individual item. Verify event timing in your OBS/VLC setup and add a reliable whole-playlist check before updating settings.
  • Playback visibly stops or restarts: This is consistent with the VLC source rebuilding its playlist/player handling after a settings update. Avoid treating the update as a seamless refresh.
  • The script cannot find the source: Check the exact source name in OBS and confirm the source type is VLC Video Source.
  • The VLC source is missing: Install VLC on the OBS computer, then reopen or recheck OBS.
  • OBS becomes unstable after script changes: Review how the script obtains, retains, and releases OBS source and data objects against the scripting documentation. Remove the script if necessary and verify the source works without it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If your goal is to keep uploaded videos playing as a 24/7 YouTube live stream rather than operate a local OBS playlist, StreamNeo is an alternative: upload your video or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams the uploaded file at its original quality up to 4K 60fps for one flat price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly: $9.99 per month. It streams to YouTube only. Learn more at StreamNeo, or start the free first day.

Quick Recap

SaleBestseller No. 1
Elgato Stream Deck MK.2 Studio Controller, 15 Macro Keys
Elgato Stream Deck MK.2 Studio Controller, 15 Macro Keys
15 Customizable LCD Keys: instantly control your apps, tools and platforms.; Visual Feedback: know that your command has been executed.
$119.99
Bestseller No. 2
8Bitdo Ultimate 2 Wireless Controller for PC, Apple, Steam & Android, Black
8Bitdo Ultimate 2 Wireless Controller for PC, Apple, Steam & Android, Black
TMR Joysticks - Offering higher sensitivity, greater precision, and enhanced durability.
$59.99
SaleBestseller No. 4
Elgato Stream Deck +, Audio Mixer and Studio Controller
Elgato Stream Deck +, Audio Mixer and Studio Controller
Fully Customizable: Use as an audio mixer, studio controller, production console, etc.
$159.99
SaleBestseller No. 5
8Bitdo Ultimate 2C Wireless Controller for Windows PC and Android, with 1000 Hz Polling Rate, Hall Effect Joysticks and Triggers, and Remappable L4/R4 Bumpers (Purple)
8Bitdo Ultimate 2C Wireless Controller for Windows PC and Android, with 1000 Hz Polling Rate, Hall Effect Joysticks and Triggers, and Remappable L4/R4 Bumpers (Purple)
Compatible with Windows and Android.; 1000Hz Polling Rate (for 2.4G and wired connection); Hall Effect joysticks and Hall triggers. Wear-resistant metal joystick rings.
$22.99
Best Value
Sale
8Bitdo Ultimate 2C Wireless Controller for Windows PC and Android, with 1000 Hz Polling Rate, Hall Effect Joysticks and Triggers, and Remappable L4/R4 Bumpers (Purple)
  • Compatible with Windows and Android.
  • 1000Hz Polling Rate (for 2.4G and wired connection)
  • Hall Effect joysticks and Hall triggers. Wear-resistant metal joystick rings.
  • Extra R4/L4 bumpers. Custom button mapping without using software. Turbo function.
  • Refined bumpers and D-pad. Light but tactile.
Rank #4
Sale
Elgato Stream Deck +, Audio Mixer and Studio Controller
  • Tactile Control, Visual Feedback: LCD keys, touch strip, and dials for audio, video, lighting, and more. Know that your command has been executed.
  • Fully Customizable: Use as an audio mixer, studio controller, production console, etc.
  • Multi Actions, Smart Profiles: trigger multiple actions at once or sequentially, automatically switch between interface configurations for different apps.
  • Powerful Plugins: Elgato Wave Link, Camera Hub, Control Center, OBS, Twitch, YouTube, Twitter, Discord, Spotify, Philips Hue, and many more
  • Stream Deck App and Store: drag and drop setup, download plugins, icons, thousands of royalty-free tracks, SFX, and more. Regular updates and new plugins frequently added.
Rank #3
Sale
VSD M18 Macro Pad Programmable Keypad, Stream Controller Streaming Deck, Customizable LCD keys, Gaming shortcut keyboard, USB sound board, Trigger actions in OBS, Twitch, YouTube, Works with PC Mac
  • 18 Programmable Keys Macro Keypad: This stream controller deck comes with 18 customizable macro keys (15 LCD visual keys + 3 physical buttons). Users may program single actions or multi-step sequences for daily operation. The keys support in-game combos, app launch and media playback control for multiple usage scenarios. Each LCD key accepts JPG, PNG and GIF images and animations to mark separate functions
  • Single Tap Control: This USB macro keyboard pad supports single tap commands for quick operation. Users can trigger pre-set macros, input text, open files and web pages, adjust media playback, or switch OBS scenes with one tap. The straightforward layout fits gaming, live streaming and professional office task setup
  • One Tap Multi-Shortcut: This macro controller pad streaming deck supports multi-shortcut macro programming for gamers and content creators. Custom shortcuts simplify game combo inputs, video editing, music production and photography workflows. The Operation Follow function runs multiple macro steps in custom order or simultaneous execution for adjustable task control
  • Adjustable RGB Surround Light Ring - VSD M18 gaming streaming deck features an outer RGB light ring with auto color cycle mode. Custom RGB tones are available via device firmware upgrade. The light ring offers adjustable visual lighting for dim gaming, streaming and night work setups.
  • Wide System Compatibility: This VSDinside macro control board works with Windows 11 and newer, macOS 11.0 and newer systems. Connect via USB-C cable for immediate use. It is compatible with mainstream software including OBS, Streamlabs, YouTube, Twitter, Discord, Excel, Word and Photoshop for daily production work. Native Linux system plug-and-play support is not available, while SDK development documents are provided for custom secondary development
Rank #2
8Bitdo Ultimate 2 Wireless Controller for PC, Apple, Steam & Android, Black
  • TMR Joysticks - Offering higher sensitivity, greater precision, and enhanced durability.
  • 8BitDo Exclusive Wireless Technology - “8Speed”, it delivers an exceptionally stable 2.4G connection with ultra-low latency under 1ms. Engineered for rock-solid reliability, it features strong anti-interference and a 10m range with virtually no lag.
  • Trigger Mode Switch - Easily switch between linear Hall Effect triggers and non-linear tactile triggers for optimal control across different gaming scenarios.
  • 1000Hz Polling Rate (for 2.4G and wired connection). Customizable 6-Axis Motion Control. Turbo function. Rumble vibration. Support 8BitDo Ultimate Software V2.
  • 2 Pro back paddle buttons, extra R4/L4 bumpers, and tactile bumpers & D-pad for enhanced control and faster response. Includes a multifunctional charging dock and USB-C adapter for seamless connectivity.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.