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 DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
DocumentaryTube
Admit one · Blog

OBS Lua Script to Reload a Playlist After All Videos Finish

For an unchanged VLC playlist, OBS’s Loop Playlist option is the simplest answer. Lua can support custom refresh workflows, but media_ended does not guarantee the whole playlist ended, and updating source settings can interrupt playback.
Opened Runtime4 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you only want the same VLC playlist to repeat, enable Loop Playlist in the OBS VLC Video Source; no Lua script is needed. If you need a custom action when playback ends or want to apply changed playlist settings, Lua can connect to OBS’s media_ended signal and update the source—but that update rebuilds the playlist and can interrupt playback. One important distinction: the signal is not documented as proof that the entire playlist, rather than one item, has finished.

Choose between looping and reloading

What you need Use Trade-off
Repeat the same configured list of videos VLC Video Source with Loop Playlist enabled Built in and simplest; it does not by itself describe a custom workflow for re-reading changed files or settings.
Run a custom action after a media-end event or apply changed playlist settings An OBS Lua callback connected to media_ended, followed by a source settings update if needed More control, but updating settings rebuilds/restarts player handling, and the signal is not documented as a unique whole-playlist boundary.

VLC Video Source supports multiple media files in a playlist, but it appears in OBS only when VLC is installed. OBS’s VLC Video Source guide documents Loop Playlist as the control for restarting a source when it runs out of media, and Shuffle Playlist for changing playback order.

Enable the built-in loop for an unchanged playlist

  1. Install VLC if it is not already installed. Restart OBS after installation if the VLC Video Source is not available.
  2. In OBS, add or select a VLC Video Source and configure its media playlist.
  3. Open the source properties and enable Loop Playlist. Leave Shuffle Playlist disabled if you need the list to play in its configured order.
  4. Test playback through the final item and confirm that the first item starts again. Verify behavior with your installed OBS and VLC versions.

Use Lua when you need a custom end-event workflow

OBS includes Lua scripting through the obslua module. Scripts are managed at Tools > Scripts. OBS’s API exposes source lifecycle signals including media_ended, and Lua can connect callbacks to a signal handler using signal_handler_connect(handler, signal, callback). The OBS documentation provides the ingredients for this pattern, but does not establish a tested, drop-in script for every VLC playlist setup.

Implementation outline

  1. In Tools > Scripts, add a Lua script and identify the VLC Video Source by its exact name in the OBS Sources list. Source names are user-defined, so a script must target the name used in your scene.
  2. Obtain the source and its signal handler, then connect a Lua callback to media_ended. The OBS scripting and API references describe the Lua module and signal connection mechanism: OBS scripting documentation and OBS source API reference.
  3. In the callback, determine whether the event represents the end of the whole playlist or only the current item advancing. Do not treat each media_ended event as a confirmed playlist-end event without checking the behavior in your setup.
  4. If a refresh is required, read the current source settings and preserve the existing playlist array and each entry’s value field unless you intend to replace them. The VLC source implementation consumes a playlist settings array and rebuilds player handling when settings are updated: OBS VLC Video Source implementation.
  5. Update the source only when the callback’s end condition is satisfied. Expect playback to restart or be interrupted: a settings update is not documented as a seamless in-place refresh.
  6. Release source and settings objects according to OBS API ownership requirements. OBS warns that incorrect handling of scripting objects can leak memory or crash OBS; consult the scripting documentation before adapting the pattern.

This is an implementation pattern, not guaranteed copy-and-run code. The exact event sequence and update timing should be tested with your operating system, OBS version, VLC version, and source configuration before relying on it during a live production.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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.

Why a playlist update can restart playback

The VLC source implementation reads playlist settings and rebuilds its media-list player during an update. That makes an update consequential: it can stop and restart player handling rather than simply refreshing a file list without disturbance. If you only want continuous repetition of an unchanged list, the built-in loop avoids adding a settings-update step.

Troubleshoot the common failure modes

  • VLC Video Source is missing: Confirm VLC is installed, then restart OBS and check the source list again.
  • The list does not restart: Reopen source properties and check Loop Playlist. Test the complete playlist, rather than inferring behavior from an individual item ending.
  • The script runs between playlist items: The callback may be receiving an event for each item. Add and verify a condition that distinguishes the intended final-item case; the signal documentation alone does not guarantee that distinction.
  • The refreshed list starts over or playback visibly pauses: This can result from the source update rebuilding player handling. Avoid refreshing on every event, and use Loop Playlist instead if the files and settings have not changed.
  • The callback does nothing: Check that the script targets the exact OBS source name and is connected to that source’s signal handler. Confirm the script is loaded under Tools > Scripts.
  • OBS becomes unstable or resource use grows: Review how the script acquires and releases source and settings objects against the OBS scripting documentation; incorrect ownership handling can cause leaks or crashes.
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 the goal is a YouTube channel that keeps uploaded videos playing as a 24/7 live stream, that is a different workflow from an OBS playlist source. StreamNeo runs the uploaded videos from the cloud, so nothing has to stay on at home. Upload your recording or build a playlist, add your YouTube stream key, and go live. 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, and the monthly option is $9.99 per month. StreamNeo is for YouTube streams of uploaded videos, not camera-based broadcasts. See StreamNeo or start the free 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
Bestseller 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.
$29.99
Best Value
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.

Leave a Reply

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

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

More from the Screening Room

  1. YouTube Encoder Keeps Reconnecting After a VPS Network Reset: Recovery SettingsAdmit one · BlogYouTube Encoder Keeps Reconnecting After a VPS Network Reset: Recovery SettingsOpened04 OCT 2026Runtime4 min
  2. How to Add a Countdown Timer to a YouTube Live StreamAdmit one · BlogHow to Add a Countdown Timer to a YouTube Live StreamOpened04 OCT 2026Runtime4 min
  3. How to Migrate a 24/7 YouTube Stream to a New VPSAdmit one · BlogHow to Migrate a 24/7 YouTube Stream to a New VPSOpened04 OCT 2026Runtime6 min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.