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
DocumentaryTube
FFmpeg

How to Stream a Folder of Videos to YouTube Live with FFmpeg

Use an ordered concat playlist, real-time pacing, and a YouTube-compatible FFmpeg output to loop prerecorded videos as a live stream.

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

To stream a folder of prerecorded videos to YouTube Live, make an ordered FFmpeg concat playlist, loop it with -stream_loop -1, pace file playback with -re, and send the encoded output to YouTube’s ingest server using your stream key. This works best when the files have matching streams and codecs; mixed files may need to be normalized first. The computer running FFmpeg and its internet connection must stay available while the stream runs.

What you need before starting

  • FFmpeg installed with the encoders you intend to use, such as libx264 and AAC. Available encoders depend on your FFmpeg build.
  • Local video files in the playback order you want.
  • A YouTube channel with live streaming enabled. YouTube says first-time activation can take up to 24 hours. See YouTube’s encoder setup guide.
  • A sustained upload connection capable of carrying your selected bitrate, with some capacity left for network variation.

This method sends prerecorded video as a live encoder feed; it does not create a camera broadcast. Exact compatibility depends on the files, operating system, shell, FFmpeg build, network, and YouTube account settings.

1. Put the videos in playback order

Create a plain-text file named playlist.txt in the directory containing the videos. Add one file directive per video, in the order you want them to play:

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

The first line must be exactly ffconcat version 1.0 for automatic format recognition. Relative file names made from portable characters are the simplest choice. FFmpeg’s concat demuxer uses safe path handling by default; avoid disabling it just to accommodate complicated paths. If a name contains spaces or special characters, quote or escape it according to the concat file syntax. See the FFmpeg concat demuxer documentation.

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

Check that the files are compatible

The concat demuxer is a playlist reader, not a general-purpose normalizer. Its inputs need the same streams, codecs, and time bases. For example, a set where one file has no audio and another has audio, or where files use different codecs or incompatible timing, may fail or produce glitches. Normalize such files into a consistent set before concatenating them. The demuxer calculates timestamps using file durations, so damaged or inaccurately probed files can also cause timing artifacts.

2. Choose YouTube-compatible output settings

YouTube’s current encoder guidance calls for RTMP or RTMPS ingest, constant bitrate (CBR), a two-second recommended keyframe interval (no more than four seconds), and frame rates up to 60 fps. Its H.264 recommendations include these examples:

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.
H.264 output profile YouTube recommended video bitrate
720p30 8 Mbps
720p60 6 Mbps
1080p30 10 Mbps
1080p60 14 Mbps

These are YouTube’s listed recommendations, not guarantees of quality or a promise that a particular connection can sustain them. Check the current YouTube encoder settings and bitrate table before a broadcast; recommendations can change. Match resolution and frame rate to the source and your upload capacity. For a two-second GOP, 30 fps corresponds to 60 frames and 60 fps to 120 frames.

YouTube lists H.264, H.265/HEVC, and AV1 for standard encoder streams, but availability depends on your FFmpeg build and, for hardware encoding, your hardware. The example below uses H.264 and AAC. Confirm the selected encoder applies the intended rate-control and GOP settings.

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.

3. Create the looping FFmpeg command

Replace YOUTUBE_INGEST_URL and STREAM_KEY with the server URL and key shown for your event in YouTube Live Control Room. This example assumes 30 fps H.264 output at 10 Mbps and AAC audio at 128 kbps; adapt the profile to your source and connection.

ffmpeg -re -stream_loop -1 -f concat -i playlist.txt 
  -c:v libx264 -preset veryfast -b:v 10000k -maxrate 10000k -bufsize 20000k 
  -r 30 -g 60 -c:a aac -b:a 128k -f flv 
  "rtmps://YOUTUBE_INGEST_URL/STREAM_KEY"

In this command, -stream_loop -1 repeats the playlist indefinitely, while -re reads file input at its native frame rate to pace it in real time. They do different jobs. Both are input options, so place them before -i. FFmpeg documents -re as equivalent to -readrate 1; see its main options documentation.

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 video rate and keyframe settings above are example choices for a 30 fps profile, not universal values. The playlist still needs compatible inputs, and FFmpeg may need different scaling, pixel-format, audio, or encoder options for a particular file set or build. If your source is 60 fps, choose an appropriate frame rate and a two-second GOP such as -g 120; select the bitrate from YouTube’s table and your sustainable upload capacity. The command is illustrative, not a tested configuration for every system.

Keep the stream key private

YouTube treats the stream key as the credential that lets an encoder send a feed to the right stream. Do not publish it in scripts, screenshots, terminal recordings, or logs. If it is exposed, an owner or manager can reset it in Live Control Room. See YouTube’s live stream settings guide. Avoid saving a real key in a script that may be shared or backed up where others can access it.

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

4. Connect FFmpeg to a YouTube event

  1. In YouTube Studio, choose Create → Go Live, then create or schedule a stream. Follow YouTube’s create-a-live-stream guide.
  2. In Live Control Room, copy the server URL and stream key for the event. Use those in the command’s output destination; never paste a real key into public examples.
  3. Run the FFmpeg command. Wait for YouTube’s incoming preview and confirm the picture and sound are correct.
  4. If the event is scheduled, use the Live Control Room controls to start the event when the preview is ready. Set privacy and scheduling options there as appropriate for your channel.

Do not assume one endlessly looping FFmpeg process means YouTube will host one uninterrupted event indefinitely. YouTube’s guidance says streams under 12 hours are automatically archived; it does not promise that one longer broadcast will be archived as a complete video. Plan controlled restarts if you need long-running programming, and check current event behavior in YouTube Studio. See YouTube’s live stream archiving guidance.

5. Test, then monitor the live stream

  • Run a private or unlisted test where appropriate before promoting the broadcast.
  • Include representative audio and scene changes in the test. Check the YouTube preview for the correct image, sound, and timing.
  • Run a speed test and choose a bitrate your upload can sustain. YouTube recommends testing before going live and watching stream health and messages during the event.
  • Keep an eye on both FFmpeg’s terminal output and YouTube’s stream-health indicators once the broadcast is live.

Use YouTube’s encoder setup and troubleshooting guidance for current checks and messages.

Troubleshooting common failures

Symptom Likely cause What to check or change
FFmpeg reports concat errors or stops at a file Inputs have mismatched streams/codecs/time bases, an invalid playlist entry, or a damaged file. Check each file and playlist path; ensure all inputs expose matching streams, codecs, and time bases. Normalize incompatible files before using the concat demuxer.
Video or audio breaks at a transition Inconsistent input formats or inaccurate file duration/timestamps. Inspect the transition and the source file; create a consistent normalized set and test the playlist before broadcasting.
YouTube receives no feed Incorrect server URL or stream key, live streaming not yet activated, or FFmpeg output/connection failure. Copy the event’s current ingest details from Live Control Room, check FFmpeg’s terminal output, and confirm channel live access. First-time activation may take up to 24 hours.
Stream health warns about dropped frames or unstable delivery Upload capacity or network stability is insufficient for the chosen profile. Run a speed test and reduce output bitrate, resolution, or frame rate to a sustainable profile; monitor health after the change.
Output settings are rejected or do not match the intended profile Unsupported encoder in the installed build, or rate-control/GOP settings not applied as expected. Check FFmpeg’s available encoders and confirm its output settings, then compare the result with YouTube’s current encoder table.

Or let it run in the cloud

With FFmpeg, your computer and network connection have to keep running. StreamNeo is a YouTube-only cloud service for looping uploaded videos, so your computer can be off. Upload the video or build a playlist, add your YouTube stream key once, and go live. It automatically recovers if YouTube drops the stream, and sends videos as uploaded at any quality up to 4K 60fps for one flat price per slot. The first day is free with no card. The monthly option is $9.99 per month. See StreamNeo for details, or start your free 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 *

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 the Screening Room

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

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.