October 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 PCOctober 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 from a Headless Ubuntu VPS

Use FFmpeg on a headless Ubuntu VPS to stream an ordered folder playlist to YouTube Live, then verify the RTMPS connection, preview, audio, and stream health.

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

You can stream a folder of videos to YouTube Live from a headless Ubuntu VPS with FFmpeg: create an ordered playlist, send its output to the RTMPS ingest URL and stream key from YouTube Live Control Room, then check YouTube’s preview and stream health. A playlist-and-systemd setup is an implementation approach, not a YouTube-prescribed recipe; test your actual files and VPS before relying on it for a long broadcast.

How the setup works

FFmpeg reads video files on the VPS, produces a continuous output, and sends it to YouTube over RTMPS. You do not need a desktop or OBS for this pipeline. The VPS still needs enough upload capacity for the output bitrate, and enough CPU if you transcode instead of copying compatible streams.

A community Ubuntu example describes an FFmpeg-only playlist pipeline and running it as a systemd service. Its commands are examples, not a guarantee that arbitrary files or every Ubuntu FFmpeg build will work. The exact Ubuntu release, FFmpeg build, source files, network capacity, and desired broadcast duration all affect implementation.

Prepare and order the video files

Make the playlist deliberate

Decide the order explicitly. Do not assume a shell wildcard will sort files in the order you intend. Create an FFmpeg-compatible playlist that names each file in sequence, and verify every path from the directory where the service will run. FFmpeg concat-list syntax and quoting requirements depend on the file names and chosen workflow; check the installed FFmpeg documentation before using a particular list format.

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.
#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 compatibility before streaming

Compare the files’ video and audio codecs, dimensions, frame rates, and audio layouts. A playlist made from similar files is simpler to send consistently. If properties differ, test transitions between files; you may need to normalize them to a common output profile. Stream copying compatible encoded streams can reduce VPS CPU use. Re-encoding can give you control over bitrate, frame rate, and keyframes and can help normalize mixed inputs, but it requires more CPU. This is an engineering trade-off, not a guarantee that a given VPS can encode a particular profile.

Choose YouTube-compatible output settings

YouTube’s encoder guidance, accessed in 2026, lists RTMP/RTMPS as protocols; H.264, H.265/HEVC, and AV1 as video codecs; AAC or MP3 audio; and frame rates up to 60 fps. It recommends constant bitrate (CBR), a two-second keyframe interval, and says not to exceed four seconds. For SDR it recommends Rec. 709 color space and 8-bit depth. For stereo audio, its guidance lists 44.1 kHz and 128 Kbps; for 5.1 audio, 48 kHz and 384 Kbps. See YouTube’s live encoder settings for the current table and requirements.

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.

Choose resolution and frame rate to suit the source material and the upload capacity you have measured from the VPS. YouTube’s table gives these examples for 30 fps: H.264 at 1080p has a 5 Mbps minimum and 14 Mbps recommended bitrate; AV1 or H.265 at 1080p has a 4 Mbps minimum and 10 Mbps recommended bitrate; H.264 at 720p has a 3 Mbps minimum and 8 Mbps recommended bitrate. These are YouTube ingest recommendations, not proof that your VPS or route can sustain the rate. Use the current YouTube table for your exact codec, resolution, and frame rate rather than treating one figure as universal.

For a basic SDR output, H.264 video with AAC audio is a conservative supported combination. Match the output profile to the files where practical, and test the VPS under the intended encoding load. Re-encoding mixed files may improve consistency, but a process that starts successfully does not establish that the stream is healthy.

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.

Get the YouTube ingest URL and stream key

  1. Open YouTube Live Control Room and create or select the live stream you intend to use.
  2. In the stream settings, reveal and copy the RTMPS URL and stream key shown for that stream. YouTube recommends RTMPS, which protects the RTMP connection with TLS/SSL. Follow YouTube’s instructions for revealing the URL and retrieving the key: Stream using RTMPS.
  3. Configure FFmpeg with the exact endpoint details. YouTube’s API calls the primary ingest URL ingestionAddress and the assigned stream name streamName. Some encoders accept these separately; others use a combined form such as STREAM_URL/STREAM_NAME. Follow the format your FFmpeg setup expects rather than assuming the two fields are interchangeable. See the YouTube Live Streams API documentation.

Treat the stream key as a password: do not commit it to a public repository or place it in a publicly readable script. Restrict access to any configuration file that contains it, and rotate the key if it is exposed. These are prudent security practices; YouTube’s documentation identifies the key as an encoder credential but does not prescribe a VPS-specific secret-storage method.

If RTMPS connection or certificate errors occur, verify that the URL begins with rtmps. YouTube also says to try port 443 where needed. Confirm that the VPS firewall and network allow the connection and that the installed FFmpeg build supports the TLS/RTMPS protocol; not every package build has identical capabilities.

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

Run the playlist through FFmpeg

The broad pattern is to point FFmpeg at the ordered playlist, choose either compatible stream copy or a deliberate transcode, and direct the output to the endpoint and key from Live Control Room. Exact command flags depend on the playlist format, whether you copy or encode, and how that FFmpeg build accepts the endpoint details. The available official YouTube documentation does not prescribe a universal FFmpeg concat command for an Ubuntu folder playlist, so do not assume one command will work unchanged for mixed files.

Before putting the command into unattended use, run it interactively and watch the FFmpeg output for input, mapping, encoding, and connection errors. Confirm that the output contains the intended video and audio streams. If the files have varying formats, test a transition between each kind of file you expect to include.

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

Keep an unattended process supervised

If the VPS should run without an operator logged in, use a process supervisor such as systemd to start FFmpeg and restart a process that exits unexpectedly. The community example uses systemd restart behavior. Configure the service for the correct working directory and playlist paths, keep secrets out of world-readable files, and inspect the service logs when it fails.

A systemd restart can restart a failed local process; it cannot ensure network continuity, manage every YouTube broadcast lifecycle state, or prove that a resumed stream is healthy. A restart loop can also hide a persistent configuration problem, so check logs and YouTube’s stream status rather than treating “service active” as success.

Preflight and monitor the broadcast

  1. Run a representative test with the same playlist, output settings, VPS, and network path you plan to use. YouTube explicitly advises testing before going live.
  2. Wait for the YouTube preview and check that motion, resolution, frame rate, and audio are present and correct.
  3. Review stream health messages in Live Control Room while the encoder is sending data. YouTube’s API health information can flag issues such as low or high video bitrate, missing audio, unsupported audio codec, audio sample-rate problems, keyframe interval problems, frame-rate mismatch, and unsuitable stream configuration.
  4. Only rely on the setup after checking file transitions and confirming the output remains stable under the VPS’s intended load.

YouTube’s Live Streams API documentation, last updated 2026-09-14 UTC, describes stream status and health diagnostics. A running FFmpeg process is not a substitute for checking those YouTube-side indicators.

Troubleshooting common failures

YouTube does not receive video

  • Recheck the exact RTMPS URL and stream key in Live Control Room; make sure the key belongs to the selected stream.
  • Check that the VPS can reach the endpoint, that firewall rules allow the connection, and that FFmpeg supports RTMPS/TLS. If a certificate or connection issue persists, verify the scheme and try port 443 where needed.
  • Inspect FFmpeg and systemd logs for authentication, connection, or input-file errors.

The preview has no audio

  • Confirm the source file actually contains audio and that the FFmpeg output includes and maps an audio stream.
  • Use an audio codec supported by YouTube’s encoder guidance, and check the sample rate and channel layout against the output profile.
  • Check YouTube’s health messages for missing audio, unsupported codec, or sample-rate warnings.

The stream buffers or YouTube flags bitrate, frame rate, or keyframes

  • Compare the actual output bitrate with YouTube’s current recommendation for the codec, resolution, and frame rate you selected.
  • Use CBR and set a two-second keyframe interval; do not exceed four seconds, per YouTube’s guidance.
  • Reduce the output demands or select a profile the VPS upload path can sustain. A recommendation is not a measured capacity test for your host.

Playback breaks at playlist boundaries

  • Compare codecs, dimensions, frame rates, and audio layouts across the files.
  • Test boundaries before relying on the playlist. If inputs are inconsistent, normalize them to one output profile and retest; transcoding uses additional VPS CPU.
  • Check for bad paths, unsupported media, or a playlist ordering problem if FFmpeg stops or skips a file.

The service keeps restarting

  • Inspect systemd and FFmpeg logs to identify whether the cause is an invalid playlist, missing file, bad endpoint or key, or resource exhaustion.
  • Correct the underlying error before relying on automatic restart; repeated restarts do not repair a configuration error or guarantee a healthy YouTube broadcast.

Or let it run in the cloud

If you do not want to maintain a VPS, playlist, FFmpeg command, and supervisor, StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos. Upload your recording or build a playlist, add your YouTube stream key once, and go live. It loops the uploaded videos from the cloud, so nothing has to stay on at home.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • One flat price per slot for any uploaded quality up to 4K 60fps; it streams the video as uploaded, without re-encoding or quality tiers.
  • Automatic recovery if YouTube drops the stream.
  • The first day is free with no card, one free day per account. The Monthly plan 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 *

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.