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 DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
DocumentaryTube
FFmpeg

How to Stream a Folder of Videos to YouTube with FFmpeg on Ubuntu Server

A practical Ubuntu Server guide to playlist setup, FFmpeg looping, YouTube Live settings, secure stream keys, testing, and common playback problems.

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

Use FFmpeg’s concat demuxer to play an ordered playlist of compatible video files, then send the output to the YouTube Live ingest URL and stream key from Live Control Room. You’ll need a verified channel eligible to livestream, a supported FFmpeg build, and enough upload bandwidth. The steps below show how to prepare the playlist, protect the key, configure the encoder, test the feed, and troubleshoot gaps or a black preview.

Before you start

  • Your YouTube channel must be verified and must not have had a live-streaming restriction in the previous 90 days. YouTube’s current guidance also sets a minimum age of 16 for livestreaming. See YouTube’s live-streaming eligibility requirements.
  • You need an Ubuntu Server with FFmpeg installed, readable source files, and a stable internet connection with sufficient upload capacity.
  • Plan to stream content you have the rights to use. A livestream is subject to YouTube’s copyright rules; using a video file you possess does not itself grant the right to broadcast its music, footage, or other material. Review YouTube’s copyright guidance and copyright safety checklist.

The exact Ubuntu package version and FFmpeg build capabilities depend on your server. Check the installed build and confirm it supports the required input formats and RTMPS/TLS protocol before scheduling an event.

Create or select a YouTube Live stream

  1. Open YouTube Studio and go to Create → Go live to open Live Control Room.
  2. Create a stream or select the stream you intend to use. Copy its current server URL and stream key from the stream settings. YouTube describes the key as password-like; keep it secret and do not expose it in shell history, public scripts, logs, or screenshots. See YouTube’s encoder setup instructions.
  3. Use the ingest protocol configured for that stream. YouTube recommends RTMPS for typical encoder streams. RTMPS is RTMP carried over TLS/SSL. Confirm your FFmpeg build supports the selected protocol.

For a scheduled event, start the encoder and check the incoming preview before selecting Go live where Live Control Room presents that separate action. Starting FFmpeg sends the feed to YouTube; it does not necessarily publish a scheduled event by itself.

Prepare an ordered folder playlist

Make the playlist file

Create a text file named playlist.ffconcat in the folder of videos. The first line must be exactly ffconcat version 1.0. Add one file directive for each clip, in the order you want them played:

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.
ffconcat version 1.0
file 'clip-01.mp4'
file 'clip-02.mp4'
file 'clip-03.mp4'

Use paths relative to the playlist file when possible. The FFmpeg concat demuxer reads the listed files in sequence and adjusts timestamps as it proceeds. Consult the FFmpeg concat demuxer documentation for playlist syntax and options.

Check that clips are compatible

The concat demuxer is not an automatic converter. For reliable concatenation, clips should have the same stream layout, codecs, and time bases. Differences such as a missing audio stream, a different frame rate, or different codec parameters can cause errors, artifacts, or gaps. Incorrect or estimated durations can also affect transitions between clips.

If the files do not match, normalize them to a common profile before streaming or use a decode/filter/re-encode workflow. Stream-copy concatenation avoids re-encoding and its associated quality loss, but is stricter about compatibility; re-encoding can accommodate differences at the cost of more CPU and possible quality loss. See FFmpeg’s concat documentation.

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.

Use safe paths deliberately

The concat demuxer’s safe-path option defaults to 1, which restricts paths to relative paths and a portable character set. Keep that protection for ordinary playlists. Do not disable path checks for a playlist you did not create or trust. See the FFmpeg format options.

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

Keep the stream key out of command history

A literal command containing the stream key can be saved in shell history or exposed to other users through process listings and diagnostics. Store the key in a protected environment file or secret store, restrict access to it, and avoid logging a command after the secret has been expanded into the URL. Rotate the key in YouTube Studio if it is exposed.

For example, create a private environment file readable only by the account that runs FFmpeg, and load the key into that process environment. Do not commit the file to source control or place it inside a publicly served directory. The URL format must follow the current server URL and key format shown in Live Control Room; do not substitute a guessed endpoint.

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.

Choose YouTube-compatible output settings

YouTube’s current encoder guidance recommends H.264 video, CBR, AAC or MP3 audio, and a keyframe interval of two seconds (no more than four seconds). Recommended bitrate depends on resolution and frame rate; for H.264, YouTube lists 10 Mbps for 1080p at 30 fps and 12 Mbps for 1080p at 60 fps. These are examples from its settings table, not universal values. Select settings for your intended resolution and frame rate from YouTube’s encoder settings and bitrate recommendations.

  • Video: H.264, constant bitrate, a resolution and frame rate appropriate to your source and planned stream, and a two-second keyframe interval.
  • Audio: AAC or MP3. Map the intended audio stream rather than assuming every clip has one.
  • Ingest: Prefer RTMPS for a typical encoder stream when available and supported by your FFmpeg build. YouTube’s HLS ingest is a separate option intended for HDR or codecs unsupported by RTMP and requires an HLS-configured stream key; use it only when the channel and encoder setup call for it. See YouTube’s encoder settings and HLS ingestion guidance.

Do not choose a bitrate based only on download speed. YouTube says total stream bitrate must fit within available upload bandwidth and recommends 20% spare capacity. Include other simultaneous traffic—and both feeds if you configure a primary and backup—in your capacity estimate. Check upload speed, not only download speed; YouTube’s streaming tips explain the headroom recommendation.

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

Use the upload-time calculator if you need to estimate how long moving your source files to a server will take; it is not a substitute for checking the server’s live upload capacity.

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

Start the folder stream with FFmpeg

The command below is a template, not a tested command for every Ubuntu release or media set. Replace the playlist path and output settings to match your files and YouTube’s current settings. Load the stream key securely and construct the output URL without printing the expanded secret. Confirm the required FFmpeg options and protocol support with the documentation for your installed build.

ffmpeg -re -stream_loop -1 -f concat -safe 1 -i /srv/videos/playlist.ffconcat 
  -map 0:v:0 -map 0:a:0? 
  -c:v libx264 -preset veryfast -b:v 10M -minrate 10M -maxrate 10M -bufsize 20M 
  -r 30 -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "$YOUTUBE_RTMPS_URL_WITH_KEY"

This example illustrates a 1080p30-style H.264 output target; set the actual resolution, frame rate, bitrate, GOP/keyframe interval, and audio settings deliberately. The example assumes the playlist inputs can be decoded and encoded by the installed build. It re-encodes video and audio, so expect CPU use. If you instead use stream copy, the inputs and output must already be compatible with the target stream.

-re paces stored media approximately in real time. -stream_loop -1 requests infinite input looping; FFmpeg documents this option, but it does not guarantee a seamless boundary for every ordered playlist and media combination. Validate loop behavior using the actual playlist and installed build before relying on it. Read the FFmpeg input stream-loop documentation, the concat demuxer documentation, and FFmpeg’s FLV/RTMP format 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.
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.

The optional audio map in the template skips audio mapping when no audio stream exists in the input, but it does not repair a playlist whose clips have inconsistent layouts. For the most predictable continuous output, normalize the clips so each one presents the same video and audio streams.

Test before publishing and monitor the feed

  1. Start FFmpeg with an unlisted or otherwise appropriate test stream.
  2. Open the stream’s preview in Live Control Room. Confirm that both picture and sound arrive and that the image is not black.
  3. Let the playlist pass through at least one clip boundary and, if it is meant to repeat, one loop boundary. Watch for freezes, gaps, timestamp errors, or audio changes.
  4. Check FFmpeg’s output for connection or encoding errors and monitor server CPU, memory, disk access, and upload usage.
  5. For an event, YouTube recommends setting up the encoder at least two hours beforehand and starting it at least 15 minutes before the event. These are readiness recommendations, not technical requirements for every personal stream. See YouTube’s streaming tips.

When ending a stream, stop the encoder and use the end-stream controls appropriate to the stream type in Live Control Room. YouTube says streams shorter than 12 hours are automatically archived after the encoder stops; an online archive is not a substitute for retaining your own source files. See YouTube’s encoder instructions.

Why the stream shows a black screen or stops between videos

Black preview or no picture

  • Wrong video stream mapped: Confirm the files contain a video stream and that -map selects it. Inspect each file rather than assuming every clip has the same layout.
  • Unsupported or inconsistent media: Test the clips individually. Normalize files with mismatched codecs, dimensions, frame rates, or stream layouts before concatenating them.
  • Ingest not connected: Check the current server URL and key in Live Control Room, the selected protocol, and FFmpeg’s connection output. Never paste a secret key into a public log when diagnosing the issue.
  • Scheduled stream not published: If the preview is arriving but viewers cannot see the scheduled event, check whether Live Control Room still requires you to select Go live.

Playback gap or failure at a clip boundary

  • Confirm that the playlist starts with the exact required header and that every listed path resolves from the playlist’s location.
  • Check that files have compatible streams, codecs, and time bases. Re-encode or normalize unlike clips.
  • Validate durations and loop behavior with the actual files. The concat demuxer does not promise gapless transitions for every mixed playlist.
  • For trusted files stored outside the playlist directory, adjust paths carefully; do not disable safe-path checks on untrusted playlist input.

Stream disconnects, buffering, or unstable quality

  • Compare the configured total bitrate with measured server upload capacity and restore YouTube’s recommended 20% headroom.
  • Check competing uploads, network congestion, and whether a primary/backup configuration is consuming additional bandwidth.
  • Confirm the encoder uses the current stream settings, including CBR, suitable bitrate, and the recommended keyframe interval.
  • Check whether FFmpeg reconnects after an interruption and whether the stream key or ingest configuration has changed. Test recovery before a critical event.

Or let it run in the cloud

If you do not want an Ubuntu server or home computer to keep the encoder running, 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 uploaded video from the cloud, so no computer or home connection has to stay on.

  • Each slot streams the uploaded file as made, up to 4K 60fps, at one flat price per slot; there are no quality tiers or re-encoding.
  • It includes 10 GB storage per slot, pooled across active slots, 24/7 looping and playlists, and automatic recovery if YouTube drops the stream.
  • The first day is free with no card, one free day per account. Billing options are a day, a week, a month, 6 months, or a year; cancel any time. UPI and cards are supported in India, with card checkout worldwide. For five or more slots, contact support.
  • Every plan has the same product; only the billing length changes. StreamNeo streams uploaded videos to YouTube, not live camera footage.

Monthly: $9.99 per month. See StreamNeo for details, or start your free first day.

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

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

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.