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.

To switch videos automatically in an OBS YouTube stream, use a Lua or Python script that detects when a media source finishes and then changes the active scene. OBS includes a Tools > Scripts interface, but playback-end switching is not a default OBS control: it requires a suitable script and a setup tested with your installed OBS version. One community example, Media Switch Scene, also requires Audio Status Monitor and was last updated in 2021.

Choose what should trigger the switch

First decide what “automatically” means for your stream. A playback-ended trigger suits a sequence of clips: when one video finishes, OBS moves to the scene for the next. A timer, schedule, hotkey, or external signal is a different behavior and needs a script designed for that trigger. OBS documents scripting callbacks and media-source signals, but that does not mean every switching pattern has a current, ready-made script.

  • One video per scene: The script detects the ending clip and changes the program output to the next video’s scene.
  • Playlist playback: VLC Video can play playlists, but VLC must be installed. This may be simpler than changing scenes for each clip, depending on the behavior you need.
  • Timed or scheduled changes: Use a script made for a timer or schedule; a playback-ended script will not provide that behavior by itself.

Set up videos and scenes in OBS

  1. Create the output scenes. In OBS, add a scene for each video you want to show, or set up a playlist using VLC Video. Give scenes and sources clear names so you can select the right ones when configuring a script.
  2. Add the media. Use a Media Source for a local supported video or audio file, and configure its playback properties as needed. If you use VLC Video for a playlist, install VLC first; OBS specifically calls for 64-bit VLC when using 64-bit OBS.
  3. Check the scene flow. Decide which scene should be active after each clip ends. A media file ending and the program changing scenes are separate operations: the script must connect the playback event to the destination scene.

OBS describes scene transitions as the mechanism that moves between scenes in the output. Confirm that the transition you want is selected and that the destination scene contains the intended video and audio sources.

Add a Lua or Python switching script

OBS Studio supports LuaJIT 2 and Python 3 scripting through Tools > Scripts. OBS says scripting can extend or automate the program without building a native plugin. Choose a script that matches your trigger and the media setup rather than assuming one script works for every scene or playlist.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  1. Open Tools > Scripts in OBS.
  2. Use the Scripts window to add the Lua or Python script file, then review any script-specific properties it exposes.
  3. Set the source or scene names and other options to match your OBS setup exactly. Check the script’s instructions for required dependencies. The Media Switch Scene community example, for instance, requires Audio Status Monitor.
  4. Verify how the script handles the end of playback and which scene it selects. If you modify or write a script, account for media-source signals and scene selection explicitly; do not assume that stopping a file automatically changes the program scene.
  5. Run a complete test before relying on the automation in a live broadcast.

Lua or Python?

Option Runtime setup Good fit when
Lua OBS embeds LuaJIT 2. The script you plan to use is written in Lua, or you are comfortable configuring Lua scripts.
Python On Windows or macOS, OBS requires a compatible Python installation and a configured path. The installed Python must match OBS’s architecture. The script you plan to use is written in Python, and you can provide the runtime OBS expects.

Neither language is universally better for this task: the available script, its dependencies, and your familiarity with the language matter more. OBS warns that poorly written scripts can leak memory or crash OBS. If you write or modify one, follow the API’s object-reference guidance, including releasing references to objects you acquire or create.

About the Media Switch Scene example

The OBS forum’s Media Switch Scene example is specifically intended to change scenes after a selected media file ends. Its forum page lists Audio Status Monitor as a dependency and shows a last update of December 20, 2021. Treat it as a starting point, not a compatibility guarantee: check it against your current OBS release and test the full sequence on your own system.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Connect OBS to YouTube separately

Scene automation controls OBS; YouTube delivery is configured separately. In YouTube Studio’s live-stream setup, obtain the stream URL and stream key, then enter them in OBS’s streaming settings as the encoder destination. YouTube says first-time live-stream enablement can take up to 24 hours. A stream key works like a password, so keep it private and do not include it in a script, screenshot, or public post.

Encoder settings to check

These settings affect the video sent to YouTube, not the scene-switching trigger. YouTube’s current RTMP/RTMPS guidance accepts H.264, H.265/HEVC, or AV1 video, up to 60 fps; AAC or MP3 audio; and CBR bitrate encoding. YouTube recommends a two-second keyframe interval and says it should not exceed four seconds. Select a bitrate appropriate to the resolution, frame rate, and codec you use, while ensuring your upload connection can sustain it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Test the complete stream before going live

YouTube advises testing before starting and monitoring stream health and messages during the event. Its live-stream tips recommend setting up the encoder at least two hours ahead and running it at least 15 minutes before the scheduled event. YouTube’s streaming tips recommend leaving upload-bandwidth headroom, with 20% as a recommendation; these are platform recommendations, not a guarantee of quality.

  1. Start a private or unlisted test stream and check the YouTube Live Control Room preview.
  2. Play every clip through its ending. Confirm the expected scene becomes active, the transition looks right, and audio neither cuts out nor continues unexpectedly.
  3. Watch YouTube’s stream-health messages and OBS for errors while the stream runs. Confirm the encoder remains connected through multiple switches.
  4. Repeat the test after changing OBS versions, scripts, dependencies, source names, or scene names.

Troubleshoot missed or incorrect switches

  • The video ends but the scene does not change: Confirm the script is loaded, its selected source matches the actual media source name, and the script is designed to react to playback ending. Check any required dependency.
  • The wrong scene appears: Recheck destination scene names and the script’s mapping from the ending source to the next scene. Small naming mismatches can prevent the intended selection.
  • The playlist plays but does not switch scenes: Playlist advancement and scene changes are distinct behaviors. Check whether the script supports VLC Video or only a particular media-source setup.
  • Python script will not load: On Windows or macOS, verify that a compatible Python version is installed, matches OBS’s architecture, and is selected in the OBS Scripts settings.
  • VLC Video is unavailable or behaves unexpectedly: Confirm VLC is installed; for 64-bit OBS, use 64-bit VLC.
  • OBS crashes or becomes unstable: Disable the script and test OBS without it. A script can introduce crashes or memory leaks, and a community example may not match the installed OBS version or current API assumptions.
  • YouTube does not receive the stream: Check the stream URL and key in the encoder settings, confirm live streaming is enabled for the channel, and inspect YouTube’s stream-health feedback. Do not reveal the key while troubleshooting publicly.
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 stream rather than operate OBS on a computer, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams the upload as made, up to 4K 60fps at 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. See StreamNeo or start the free first day.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

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.