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
FFmpeg

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

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, put compatible files in a concat playlist, pace playback in real time, loop the input, encode it for YouTube, and send it to the RTMPS address and stream key from YouTube Studio. Test privately or unlisted before relying on the stream: looping the input does not guarantee a fault-free 24/7 broadcast.

What you need before you start

  • FFmpeg installed on a computer that can stay on and connected to the internet for the duration of the stream.
  • Your video files and a text playlist file in a known directory.
  • A YouTube channel with live streaming enabled, plus the stream URL and stream key from Live Control Room.
  • An upload connection that can sustain the output bitrate you choose.

This is a command-line workflow for prerecorded video, not a camera broadcast. FFmpeg reads the files on your computer, so the computer and its network connection must remain available while it streams.

Create the YouTube stream and protect its key

  1. In YouTube Studio, open Go Live and create or schedule an encoder stream. Choose the visibility—public, private, or unlisted—that suits your purpose. See YouTube’s encoder setup instructions and live stream settings.
  2. In Live Control Room, copy the stream URL and stream key. You will combine them as the destination in FFmpeg’s command.
  3. Treat the key like a password: do not publish it in a script, screenshot, or source-control repository. If it is exposed, reset it in YouTube Studio and update FFmpeg with the replacement.

Prepare a compatible playlist

Place the playlist file alongside your media where practical. Save a file named playlist.txt in this format, using filenames that match your own files:

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

The concat demuxer reads entries in order and adjusts timestamps. FFmpeg’s documentation cautions: “All files must have the same streams (same codecs, same time base, etc.).” See the FFmpeg documentation on concat and FFmpeg formats. In practice, matching codecs, stream layouts, frame dimensions, frame rates, audio layout, and reliable durations reduces the risk of gaps, artifacts, or abrupt transitions at clip boundaries.

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.

If clips do not match, transcode them to a consistent format before adding them. Files with inaccurate durations or mismatched audio and video lengths can cause timestamp discontinuities when the next segment begins. Use simple relative paths where possible; FFmpeg’s safe mode rejects some paths by default. The example below uses -safe 0 to allow paths in a playlist you control. Quote or escape filenames with spaces or special characters, and never use an untrusted playlist with that setting.

Run FFmpeg as a real-time YouTube encoder

Use this as a starting template, not a universal preset. Change the bitrate and frame rate to suit the media, encoder capacity, connection, and YouTube’s current guidance:

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.
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>"

Replace <RTMPS_URL>/<STREAM_KEY> with the exact RTMPS ingest URL and stream key shown in Live Control Room; do not include the angle-bracket placeholders. FFmpeg options apply to the next input or output, so input options belong before -i and output encoding options after it.

  • -re reads file input at real-time speed for live use; -stream_loop -1 requests indefinite looping.
  • -f concat selects the concat demuxer, and -safe 0 permits the controlled playlist paths.
  • -c:v libx264 and -c:a aac encode video and audio; -pix_fmt yuv420p is a common compatibility choice. -preset veryfast trades some compression efficiency for lower encoding workload.
  • -r 30 requests 30 output frames per second. At that frame rate, -g 60 sets a nominal 60-frame, two-second GOP (keyframe interval).
  • -b:v sets target video bitrate, -maxrate its maximum rate, and -bufsize the rate-control buffer. -b:a 128k sets audio bitrate and -ar 44100 sets audio sample rate.
  • -f flv selects the output container commonly used with RTMP-style ingest. YouTube recommends encrypted RTMPS; see YouTube’s RTMPS guidance.

Do not copy 4500 kb/s blindly. YouTube’s recommended bitrate depends on codec, resolution, and frame rate; check its current encoder settings and bitrate table for your chosen output. The connection must sustain the selected rate. YouTube recommends a two-second keyframe interval and says not to exceed four seconds; at 30 fps, the example’s -g 60 corresponds to two seconds. The command is an illustrative configuration assembled from documented options, not a tested command or a guarantee for every FFmpeg build, media file, or endpoint.

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.
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 stream and verify the loop

  1. Start with a private or unlisted test stream.
  2. Watch the Live Control Room preview and confirm that video and sound are present and the stream health is acceptable.
  3. Use representative movement and audio, and let the test run across at least one playlist boundary. Check for silence, black frames, timing jumps, or other discontinuities between clips.
  4. If a boundary fails, normalize the files to matching codecs, time bases, frame size, frame rate, audio layout, and dependable durations, then test again.

YouTube recommends testing and monitoring stream health; the encoder settings guidance explains its recommendations. A looping FFmpeg process does not itself monitor every failure mode or ensure uninterrupted operation.

Know what happens to long broadcasts

YouTube says streams shorter than 12 hours are automatically archived. That does not promise a single automatically archived replay for a 24/7 stream. If you need a replay, plan how you will record or preserve the source separately and check the archive behavior in your own channel’s Live Control Room. See YouTube’s encoder live-stream guidance.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and fixes

  • YouTube does not receive the stream: Check that the destination uses the exact ingest URL and current key from Live Control Room, and that the key has not been reset. If exposed, reset it and replace it in the command.
  • Playback is too fast or too slow: Confirm that -re appears before the playlist input. It paces file reading for real-time output.
  • The stream stops at the end of the list: Confirm that -stream_loop -1 is present before -i playlist.txt and that FFmpeg has not exited with an input or encoding error.
  • Files fail to open: Run the command from the directory containing the playlist or use correct paths. Check spelling, quoting, and whether safe mode rejects a path; only use -safe 0 with a playlist and files you control.
  • Audio, video, or timing breaks at a clip boundary: Check that files have matching stream layouts, codecs, time bases, and accurate durations. Transcode mismatched clips to a consistent format, then retest.
  • Stream health is poor or frames drop: Compare the configured bitrate with YouTube’s current recommendations for the selected resolution, frame rate, and codec, and verify the upload connection can sustain it. If the encoder cannot keep up, reduce output demands or choose a faster preset.
  • The machine or network goes offline: FFmpeg on a local computer cannot continue sending when that computer or connection is unavailable. Restore the host and connection, then restart and verify the feed in Live Control Room.

Or let it run in the cloud

If you want the prerecorded playlist to keep running without leaving a computer on at home, StreamNeo runs a YouTube stream from the cloud: upload your recording or build a playlist, add your YouTube stream key, and go live. It streams the uploaded video as made, up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers, and automatically recovers if YouTube drops the stream. The first day is free with no card; the Monthly price is $9.99 per month.

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.

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.

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

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
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.