October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
FFmpeg

How to Build a Weekly YouTube Live Playlist Rotation with Python and FFmpeg

Use Python to choose each week’s active playlist and FFmpeg to send compatible video files to YouTube Live. This guide covers schedule boundaries, media validation, concat methods, event setup, and reliability.

By VGSources Team 8 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build the rotation in Python, use FFmpeg to play and send the selected videos, and manage the YouTube event separately in YouTube Studio or through the Live Streaming API. YouTube and FFmpeg do not provide a built-in weekly playlist scheduler: the schedule, timezone, and changeover behavior are decisions your automation must implement.

How the pieces fit together

A reliable setup has four jobs: inventory and validate the media, select the correct sequence for the current time, feed that sequence to FFmpeg, and manage the YouTube broadcast and its incoming stream. Treat the weekly schedule as your own Python automation layer, not as a feature of YouTube’s API or FFmpeg’s concat demuxer.

  1. Inventory: Record each video’s path, intended order, duration, and schedule assignment. Confirm that files are readable and have the streams and formats your chosen FFmpeg method expects.
  2. Schedule: In Python, choose the sequence active for a time window. Define the timezone, weekly boundary, and what happens at a changeover.
  3. Playback and encoding: Give FFmpeg a compatible concat list, or use the concat filter to normalize and re-encode inputs that cannot be joined appropriately with the demuxer.
  4. YouTube event and feed: Create or schedule the broadcast in YouTube Studio or through the Live Streaming API, and send FFmpeg’s output to the configured YouTube ingestion endpoint.

A YouTube liveBroadcast is the event; a liveStream is the audiovisual feed. FFmpeg sends the feed; it does not create the event. Keeping those responsibilities separate makes it easier to troubleshoot a playlist problem without confusing it with broadcast scheduling.

Plan the weekly rotation in Python

Represent the schedule explicitly

Store the information needed to build a deterministic playlist: file path, day or playlist name, start and end times, and order. Use an explicit timezone rather than relying on the machine’s local setting. Otherwise a rule such as “Monday at 09:00” can become ambiguous when the server is elsewhere or local clocks change for daylight saving time.

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.

Decide how an active sequence is selected at startup and at each scheduled boundary. A practical design is to generate a stable snapshot of the sequence at startup and again at planned changeovers. Do not rewrite a list file that FFmpeg is already reading unless your integration explicitly supports that kind of dynamic update.

Choose what a boundary means

There is no universal rollover policy prescribed by YouTube or FFmpeg. Choose and document one before the stream runs:

  • Start the new sequence immediately: Stop and restart the FFmpeg input at the boundary. Decide separately whether that requires a new YouTube broadcast or whether your event workflow supports reconnecting the encoder.
  • Finish the current item first: Delay the changeover until the playing video ends. This avoids cutting an item short, but the schedule will not switch at the exact boundary.
  • Keep the encoder process running: Use a design that supplies new media or generated segments to a continuous process. This requires an integration built for dynamic input; simply replacing the concat list does not guarantee FFmpeg will reload it.

Also define behavior for an empty playlist, a missing file, an encoder exit, a network interruption, and a schedule change while a file is playing. These are operating decisions for your implementation, not recovery guarantees from YouTube or FFmpeg.

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.

Prepare and validate the media

Before creating a public event, inspect every scheduled file and test representative transitions. The concat demuxer depends on compatible input streams; files with different codecs, stream layouts, time bases, or other characteristics may not join cleanly with stream copy.

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.
  • Check that each file can be read and contains the expected video and audio streams.
  • Compare codecs, dimensions, frame rates, time bases, and stream layout across files you plan to feed to the concat demuxer.
  • Check duration metadata. Incorrect or missing duration information can affect timestamps for following files and produce transition artifacts.
  • Test transitions between representative files, not just each file in isolation.
  • Verify the installed FFmpeg version and the current YouTube encoder settings for your intended resolution and frame rate before choosing output settings. There is no single bitrate or encoder configuration that is right for every target quality.

Choose how FFmpeg joins the files

Concat demuxer: compatible files in sequence

The concat demuxer reads a text list and treats its files as one sequential input. It can avoid re-encoding when the source files are suitable, but it is not a general-purpose fix for mismatched media. The inputs need matching streams, including compatible codecs and time bases. Duration estimates also matter because FFmpeg uses them when assigning timestamps to later files.

The list can use duration directives to supply or override durations. If durations are inaccurate, later timestamps and transitions can be wrong. Consult the FFmpeg formats documentation for the exact concat syntax and current requirements.

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.

Concat filter: normalize and re-encode

When inputs need normalization or have incompatible streams, the concat filter is the route to consider. It lets you build a filter graph that brings media into a consistent format, but it requires decoding and re-encoding rather than simply passing compatible packets through. Choose the target video and audio properties deliberately and test the resulting output before using it for a long scheduled stream. The FFmpeg FAQ distinguishes the demuxer, filter, and protocol approaches.

Why not use the concat protocol as a playlist?

The concat protocol joins files at the file level for a limited set of container formats; it is not a general playlist scheduler. For a sequence of scheduled videos, use the demuxer when its compatibility requirements are met, or the filter when you need to normalize and re-encode.

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.

Write a safe concat list

For automatic format recognition, the list begins with the exact line ffconcat version 1.0, with no text before it. Following entries use file directives and may include duration directives. Paths containing spaces or special characters need correct escaping.

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

The demuxer’s safe setting is enabled by default and can reject unsafe paths or directives. Prefer appropriate relative paths and review the security implications before changing that setting. Do not assume that disabling safe mode is a harmless workaround.

Configure the YouTube broadcast and ingestion

Choose Studio or API event management

You can keep event scheduling in YouTube Studio and automate playlist selection and encoding in Python, or manage broadcasts through the YouTube Live Streaming API. The API can create broadcasts and streams, bind a broadcast to a stream, and transition broadcast states. FFmpeg alone does none of those event-management tasks.

Reuse a stream or create one per broadcast

YouTube documents two patterns for recurring events. With the same encoder settings, you can reuse one configured liveStream across multiple liveBroadcast events; only one event can be live at a time in this shared-stream arrangement. You can also use a separate stream resource for each broadcast.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
Pattern When it fits Operational consideration
One stream reused across recurring broadcasts Recurring events that use the same ingestion settings Keeps the configured stream consistent; only one event can be live at a time in this arrangement.
Separate stream per broadcast Events that need distinct stream resources or ingestion settings Requires managing separate stream resources as well as their events.

Neither pattern is universally better. Choose based on whether the events need different ingestion settings and whether you want event creation and transitions handled manually in Studio or automatically through the API. See YouTube’s broadcast and stream concepts.

Send the feed with a private stream key

The liveStreams resource contains ingestion information. For RTMPS, use the primary ingestion URL. Depending on the encoder, enter the stream URL and stream name/key in separate fields or combine them in the form the encoder expects. YouTube recommends RTMPS in its encoder guidance. Keep the stream key private: store it in an environment variable or secret store rather than committed code, and avoid printing it in routine logs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Preflight and operate the stream

  1. Run a private or unlisted end-to-end test: Create a test event and confirm that the selected playlist reaches YouTube, audio and video play, and transitions behave as expected. A test is useful but cannot catch every failure.
  2. Check the schedule snapshot: Confirm the timezone, active playlist, ordering, and next boundary before the event begins.
  3. Check the media and list: Confirm that files exist, are readable, and are compatible with the chosen concat method; review duration metadata and paths.
  4. Start the encoder and verify ingestion: Confirm that FFmpeg is running and the YouTube event receives the feed before relying on the public schedule.
  5. Monitor and log: Record the selected playlist, current file, process status, and relevant errors. Define how you detect a stalled process and when you restart it.
  6. Test recovery procedures: Decide what the operator or supervisor process does after an encoder exit or network interruption, and verify the behavior rather than assuming a reconnect will work.

Troubleshooting common failures

Symptom Likely cause What to check or do
FFmpeg rejects a concat list or cannot open a listed file Malformed list syntax, escaping errors, missing file, or a path rejected by the default safe mode Check that ffconcat version 1.0 is the first line when using automatic recognition, validate each file path and its escaping, and prefer suitable relative paths. Review security before changing safe mode.
Playback breaks or shows artifacts at a transition Incompatible streams or inaccurate duration information Probe both files, compare their stream characteristics, verify durations, and test the transition. Use the concat filter and re-encode when normalization is needed.
The wrong playlist starts on a given day or time Implicit timezone, unclear weekly boundary, or undefined changeover behavior Set an explicit timezone, make the boundary and rollover policy explicit, and inspect the generated schedule snapshot.
YouTube does not receive the encoder feed Incorrect ingestion URL or stream name/key, private key handling error, or network problem Check the primary RTMPS ingestion details and the encoder’s field format. Confirm the key is current and entered privately; do not expose it in logs.
The broadcast is not live although FFmpeg is running The event may not be started, bound, or transitioned as expected Check the broadcast separately in Studio or inspect the API-managed event lifecycle. FFmpeg sends media but does not create or start the YouTube event.
The stream stops after a process or network failure No supervisor or restart procedure is defined Use process monitoring, error logs, and a tested restart policy. Decide how the encoder reconnects and how the broadcast should be handled after interruption.

Copyright, reused content, and scheduled playback

Having a weekly rotation or a successful FFmpeg command does not establish that you have rights to stream the videos. Use content you own or are licensed to broadcast, and check YouTube’s current copyright and live-stream rules before scheduling. Repeating or compiling videos also does not by itself establish eligibility for monetization; consider whether the channel’s use adds original value and complies with YouTube’s current monetization policies.

Or let it run in the cloud

If you would rather not maintain a Python scheduler, FFmpeg process, and always-on computer, StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos. Upload a recording or build a playlist, add your YouTube stream key once, and go live; it loops the videos from the cloud, so nothing has to stay on at home. It does not go live from a camera.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Any quality up to 4K 60fps at one flat price per slot; videos stream as uploaded, without re-encoding or quality tiers.
  • Automatic recovery if YouTube drops the stream.
  • The first day is free with no card, once per account.
  • Monthly billing is $9.99 per month.
  • UPI and cards are supported in India; card checkout is available worldwide. Five or more slots: contact support.

Start your free StreamNeo day.

Further references

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 Patch Notes

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.