Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober 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 Scan×
Skip to content
VGSources
FFmpeg

How to Rotate Video Playlists on a 24/7 YouTube Stream Using Linux Cron

Run FFmpeg as a supervised service and use cron for controlled playlist updates and health checks—not as the sole keeper of a 24/7 YouTube stream.

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

Use FFmpeg to send a playlist of local video files to YouTube Live, keep FFmpeg running under a service manager such as systemd, and use cron for bounded jobs such as refreshing the playlist or checking a watchdog. Cron alone is not a reliable way to keep a long-running stream alive: it schedules commands, while a service manager supervises the encoder process.

How the pieces fit together

  • FFmpeg reads the video files and sends audio and video to YouTube Live.
  • systemd owns the long-running FFmpeg process and can restart it if it exits.
  • A playlist script can build or update the list of clips available to the encoder.
  • Cron runs specific maintenance or health-check jobs on a schedule.
  • Monitoring checks both local encoder progress and the public YouTube playback. A running process by itself does not prove viewers are receiving fresh video.

This division is a practical Linux pattern, not a YouTube requirement. A community setup illustrates systemd supervision with cron watchdog and restart jobs, but its choices are not guarantees of uninterrupted delivery (cooscreations’ 24/7 YouTube Stream setup and operations notes).

Prepare compatible video files

Choose an FFmpeg playlist method

Store the clips on disk accessible to the Linux host, then choose an FFmpeg input or playlist format that suits those files. FFmpeg documents formats including concat demuxing, but does not provide a ready-made cron recipe for rotating YouTube videos (FFmpeg Formats Documentation).

Check media before relying on unattended playback

Inspect each file’s video and audio codecs, dimensions, frame rate, audio streams, and duration. Clips with substantially different properties may need to be normalized before streaming, or require a playlist approach that handles those differences. There is no single encoding profile established for every channel or collection of files.

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.

Test the exact playlist with your installed FFmpeg version. Verify clip order, transitions, and audio/video synchronization rather than assuming that a list of valid files will play seamlessly.

Configure YouTube Live

  1. In YouTube Studio, open Live Control Room and create or select the live stream.
  2. Copy the stream server URL and stream key supplied for the encoder into your FFmpeg configuration.
  3. Keep the key private. Do not commit it to a public repository or put it in a world-readable configuration file or logs.
  4. Start the encoder and follow the Live Control Room workflow to check its preview and go live as applicable.

YouTube’s encoder instructions explain where to get the server URL and key and how to start the encoder (Create a YouTube live stream with an encoder). Treat the stream key like a password: anyone who obtains it may be able to send a feed to your stream.

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.

Keep FFmpeg running under systemd

Configure FFmpeg as a long-running system service rather than launching it from an interactive shell that may close. A service manager can bring the process back after an exit; the service definition should use the paths and environment required by your FFmpeg command.

A community operations example uses a systemd restart policy, a watchdog that checks for stalled progress, and a periodic scheduled restart. Those are one operator’s choices, not established requirements or a proven restart interval for other installations. A preventive restart deliberately interrupts the outgoing feed, so use one only when you understand its effect on the broadcast.

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.

Use cron for playlist updates and maintenance

Refresh the playlist in a controlled way

Have a script generate the updated playlist after new files arrive, then schedule that script with cron if a fixed schedule suits your workflow. Use explicit paths and a predictable environment; cron jobs do not necessarily inherit the same shell environment as an interactive login. Write useful logs and make sure the script cannot accidentally start a second FFmpeg process.

Do not assume that editing a playlist file changes what an already-running FFmpeg process is reading. Whether a live process notices an update depends on the playlist type and command. Test the behavior you intend to use. If your chosen approach requires restarting FFmpeg to load a new list, schedule or trigger that restart knowingly: the outgoing feed will be interrupted.

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

Schedule health checks without duplicating the encoder

Cron can invoke a health-check script or watchdog at a fixed interval. Design it to detect a stalled encoder and coordinate with systemd rather than blindly launching another FFmpeg instance. The exact cron syntax, locking method, and reload behavior depend on your Linux distribution, shell, FFmpeg command, and playlist format; no universal configuration is established for this setup.

Validate the stream before leaving it unattended

  • Run a short test and confirm that clips play in the intended order.
  • Watch at least one playlist boundary for missing video, audio problems, or a failed transition.
  • Change the playlist and confirm whether the running encoder actually picks up the change.
  • Force a controlled FFmpeg exit and verify that the service manager recovers it.
  • Confirm that the watchdog does not create duplicate encoder processes.
  • Check the public YouTube playback, not only the local process or log output, to confirm that viewers receive current video.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Understand YouTube’s broadcast and archive behavior

YouTube distinguishes the incoming media connection, called a stream, from the viewer-facing live broadcast. Its API documentation describes a 24/7 feed used alongside a separate interview broadcast, illustrating that the incoming stream and the broadcast event are distinct concepts (YouTube Live Streaming API: Understanding Broadcasts and Streams).

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.

YouTube Help says streams under 12 hours are automatically archived. Do not assume that a continuous stream lasting longer than 12 hours will be archived in full (YouTube Help: Create a YouTube live stream with an encoder).

Alternatives if you do not want to operate Linux

  1. StreamNeo keeps a YouTube stream running from the cloud, with uploaded videos or playlists, any uploaded quality up to 4K 60fps at one flat price per slot, and a free first day; your computer does not need to stay on. It is a managed YouTube-only option, not part of the cron setup. Details are at StreamNeo.
  2. Self-hosted FFmpeg with systemd and cron gives you direct control over files, scripts, and scheduling, but you operate the Linux host, playlist behavior, process recovery, and monitoring yourself.
  3. Gyre is listed by YouTube as a cloud-based service for 24/7 prerecorded-video streaming. It is a hosted workflow rather than a component required for cron-based FFmpeg streaming (YouTube’s encoder list).

Or let it run in the cloud

With StreamNeo, upload your recording or playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; uploaded video streams at its original quality up to 4K 60fps for one flat price, and StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month.

Start your free StreamNeo day.

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 *

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.

More from Patch Notes

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.