DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
FFmpeg

How to Set Up an Automatic Video Playlist for YouTube Live With FFmpeg

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 loop prerecorded videos on YouTube Live with FFmpeg, create a text playlist, use FFmpeg’s concat demuxer to play its files in sequence, pace the input in real time, and send the output to the RTMPS ingest URL and stream key from YouTube Studio. Test the feed privately or unlisted before relying on it: looping the files does not guarantee an uninterrupted stream.

1. Create an encoder stream in YouTube Studio

  1. In YouTube Studio, open Go Live and create or schedule an encoder stream. YouTube’s encoder setup guide explains the workflow.

  2. In Live Control Room, copy the stream URL and stream key. Use the RTMPS URL where available; YouTube recommends RTMPS for encrypted ingest. See YouTube’s RTMPS guidance.

  3. Treat the stream key like a password. Do not publish it in screenshots, public scripts, or source control. If it is exposed, reset it in YouTube Studio and update FFmpeg with the replacement key; see YouTube’s live stream settings guide.

    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.
  4. Choose the stream’s visibility deliberately: public, private, or unlisted. For initial testing, private or unlisted avoids presenting an unverified feed as a public broadcast.

2. Prepare the media and playlist

Put your video files and playlist text file in a known directory. Create a file named playlist.txt with entries in the order you want them played:

ffconcat version 1.0
file 'video-01.mp4'
file 'video-02.mp4'
file 'video-03.mp4'

With relative paths, keep the playlist alongside the media or adjust the paths so they resolve correctly from the directory where you run FFmpeg. The concat demuxer reads entries sequentially, but it does not make dissimilar files match. FFmpeg’s documentation states: “All files must have the same streams (same codecs, same time base, etc.).” See the FFmpeg documentation on the concat demuxer and the FFmpeg formats documentation.

3. Run FFmpeg and send the loop to YouTube

Run this template from the directory containing playlist.txt. Replace the destination with the exact RTMPS ingest URL and stream key shown in Live Control Room. Adjust the encoding settings to match your source material, computer, upload connection, and YouTube’s current guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -c:v libx264 -preset veryfast -pix_fmt yuv420p -r 30 -g 60 
  -b:v 4500k -maxrate 4500k -bufsize 9000k 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "<RTMPS_URL>/<STREAM_KEY>"

The command is an illustrative configuration assembled from documented FFmpeg options, not a tested command or a guarantee for every FFmpeg build, source file, or endpoint. Consult the FFmpeg documentation for option behavior. FFmpeg options apply to the next input or output, so input options belong before -i and output encoding options after it.

What the main options do

  • -re reads the file input at real-time pace, which is appropriate when feeding a live output.

    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.
  • -stream_loop -1 requests that the input loop indefinitely.

  • -f concat selects the concat demuxer, which reads the ordered file list.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • -safe 0 allows paths that FFmpeg’s default safe mode might reject. Do not use it with an untrusted playlist.

  • -c:v libx264 and -c:a aac encode video as H.264 and audio as AAC. -f flv supplies a common RTMP-style output container.

  • -r 30 sets the output frame rate to 30 fps. -g 60 sets a 60-frame GOP; at 30 fps, that is a nominal two-second keyframe interval.

    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
  • -b:v 4500k, -maxrate 4500k, and -bufsize 9000k are sample rate-control values, not universal YouTube requirements.

    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.

Choose bitrate and keyframes for your stream

Do not copy the sample’s 4500 kb/s video bitrate without checking whether it fits your resolution, frame rate, codec, and connection. Use the current resolution- and codec-specific table in YouTube’s encoder settings guidance, and make sure your upstream connection can sustain the chosen bitrate. YouTube recommends a two-second keyframe interval and says not to exceed four seconds. The sample’s -g 60 corresponds to two seconds only because the example sets 30 fps.

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

4. Test the stream and monitor it

Before a public broadcast, start with a private or unlisted test and check the preview and stream health in Live Control Room. YouTube recommends testing with representative audio and movement and monitoring stream health; follow its current encoder settings and stream health guidance.

  • Confirm that video and audio play correctly within each file.

  • Watch at least one transition between files. A stream can play normally within clips but show a gap, artifact, or audio/video mismatch at a boundary.

    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.
  • Confirm that the stream remains healthy after the playlist returns to its first entry.

  • Keep the FFmpeg process running and monitor the host and network. A loop request does not by itself restart a crashed process or guarantee uninterrupted delivery.

5. Troubleshoot common problems

Symptom Likely cause What to check or change
FFmpeg cannot open a playlist file The command is being run from a different directory, a path is invalid, or safe mode rejects a path. Check the working directory and each filename. Prefer simple relative paths; for a controlled list using paths that require it, use -safe 0.
A clip fails to open The playlist entry is misspelled, quoted incorrectly, or points to a missing or unreadable file. Verify the exact path and filename, permissions, and quoting. Test the file individually before adding it back to the playlist.
Video or audio breaks at a clip boundary Files have different codecs, stream layouts, time bases, or inaccurate durations. Normalize the clips to matching codecs, time bases, frame size, frame rate, and audio layout; verify durations and retest the boundary.
YouTube reports poor stream health or buffering The selected bitrate may exceed available upload capacity, or encoding settings may not suit the chosen output. Compare the output bitrate with YouTube’s current recommendations for the resolution, frame rate, and codec, and check that the connection can sustain it.
The stream does not connect The ingest URL or stream key may be wrong, the key may have been reset, or the selected endpoint may not match the encoder configuration. Copy the current URL and key from Live Control Room and update the destination. Keep the key secret; reset it if exposed.
FFmpeg stops and the stream ends The process, computer, or network connection stopped; -stream_loop -1 only loops media while FFmpeg continues running. Check FFmpeg’s output and host/network stability. Plan process supervision and recovery separately if operating your own encoder.

6. Plan around YouTube’s archive limit

YouTube says streams shorter than 12 hours are automatically archived. That rule does not guarantee a single automatically archived replay for a 24/7 broadcast; see YouTube’s encoder stream guidance. If you need an archive, plan a separate recording or shorter stream sessions rather than assuming an endless live stream will produce one complete replay.

Or let it run in the cloud

If you want a YouTube channel to loop uploaded videos without keeping a computer or home connection running, StreamNeo is a cloud alternative. Upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded videos to YouTube; it does not stream from a camera.

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

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 *

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

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
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.