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
FFmpeg

How to Use FFmpeg to Stream a Playlist from a VPS to YouTube over RTMPS

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

To stream a playlist from a VPS to YouTube Live over RTMPS, enable live streaming on your channel, copy the RTMPS ingest URL and stream key from YouTube Live Control Room, prepare a compatible playlist, and send it with FFmpeg. The example below uses FFmpeg’s concat demuxer for local files and loops the input; it is a template, not a tested command for every VPS or media set.

Before you start

YouTube says live streaming must be enabled for an eligible, verified channel. The channel must have had no live-streaming restrictions in the preceding 90 days, and the streamer must be at least 16 years old. See YouTube’s live-streaming eligibility requirements.

  • A VPS with the media files accessible to the FFmpeg process.
  • An FFmpeg build that includes the required input demuxer, video and audio encoders, and RTMPS protocol support. Builds can differ; check the capabilities of the build installed on your server.
  • A playlist format suited to your source. The command below covers a local text file used with FFmpeg’s concat demuxer; an M3U/M3U8 URL or another format may need a different input approach.
  • Upload bandwidth and CPU or hardware-encoding capacity sufficient for the chosen output.

Get the YouTube RTMPS URL and stream key

  1. Open YouTube Studio and go to Live Control Room. Create or select the encoder stream you intend to use.
  2. Copy the stream URL and stream key shown for that stream. If the default endpoint shown is not RTMPS, explicitly retrieve the RTMPS endpoint; YouTube notes that it may not be the default URL displayed. Consult YouTube’s RTMPS guidance.
  3. Keep the key private. YouTube describes stream keys as a password and address for a stream: they let YouTube identify and accept the encoder feed. If a key is exposed, reset it in Live Control Room and update the sender configuration. See YouTube’s stream-key guidance.

RTMPS is RTMP over a TLS/SSL connection, providing encryption between the encoder and ingest endpoint. Use the exact RTMPS URL supplied by YouTube and append or configure the key as required by the URL format; do not guess the host or path.

Build a local playlist for FFmpeg

For a local playlist using the concat demuxer, create a text file such as playlist.txt with one entry per file:

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.
file 'path/to/first-video.mp4'
file 'path/to/second-video.mp4'
file 'path/to/third-video.mp4'

Use paths the FFmpeg process can read on the VPS. Concat demuxing works best when the files have matching stream properties, such as compatible codecs and stream layouts. FFmpeg warns that inaccurate durations can cause gaps or artifacts. See the FFmpeg concat demuxer documentation.

The example command uses -safe 0 to relax concat path checks. Only use it with a playlist and paths you control and trust. Playlist syntax, quoting, timestamps, and compatibility can vary with the files and shell environment; confirm your particular list before relying on it.

Choose YouTube output settings

For RTMP/RTMPS, YouTube’s encoder guidance lists H.264, H.265/HEVC, and AV1 video; AAC or MP3 audio; and frame rates up to 60 fps. It recommends constant bitrate (CBR), a two-second keyframe interval, and advises not to exceed four seconds. Use the bitrate range in YouTube’s encoder settings for your chosen resolution and frame rate; there is no single right bitrate for every stream.

The command below is an illustrative 30 fps H.264 SDR configuration, not a universal YouTube bitrate prescription. Its 4,500 Kbps video bitrate is an example value: select a value from YouTube’s current range for the output resolution and frame rate you actually intend to send. At 30 fps, -g 60 requests a 60-frame GOP, corresponding to a two-second interval. The command sets stereo AAC audio to 128 Kbps and 44.1 kHz, values YouTube lists in its advanced audio recommendations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

For ordinary SDR, YouTube lists Rec. 709 and 8-bit color. HDR requires a separate configuration: YouTube recommends HEVC for HDR and notes that AV1 is not supported for HDR. Do not use the basic SDR example as an HDR recipe.

Start the playlist stream from the VPS

Substitute your own local playlist path and the RTMPS endpoint/key from Live Control Room. Avoid putting a real key in shell history, a world-readable script, or a public repository.

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt \
  -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k \
  -r 30 -g 60 -c:a aac -b:a 128k -ar 44100 \
  -f flv 'rtmps://INGEST_HOST/APP/STREAM_KEY'

Replace the placeholder URL with the exact RTMPS URL and key information YouTube provides; the displayed shape is illustrative and URL/key formatting can differ. The FFmpeg documentation covers the RTMPS protocol, the concat demuxer, and input options including stream looping. The -stream_loop -1 input option requests indefinite looping; FFmpeg documents -1 as looping indefinitely. Place it before the relevant -i.

This assembled command has not been validated against a particular VPS, FFmpeg build, or set of files. In particular, verify that libx264 is available in your build and that the server can encode the selected output in real time. If not, choose a supported encoder or reduce the workload.

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.

Validate and operate the stream

  1. Start FFmpeg and check its output for input, encoder, and connection errors.
  2. Wait for the incoming preview in Live Control Room. Confirm that the picture and audio are correct before relying on the stream; YouTube’s encoder workflow uses the preview before starting a scheduled stream.
  3. For a scheduled stream, click Go live in Live Control Room once the preview is ready.
  4. Monitor audio, video, network continuity, and the FFmpeg process while streaming. YouTube recommends monitoring stream quality continuously.
  5. When finished, end the stream in YouTube and stop the encoder. YouTube says streams under 12 hours are automatically archived; do not assume an indefinitely running stream will be one complete archived video.

Plan VPS bandwidth and cost

YouTube recommends upload bandwidth 20% above the combined bitrate of the primary and any backup stream. That headroom is in addition to the feed bitrate, not a replacement for checking actual VPS network capacity. See YouTube’s network guidance. A VPS must also sustain the encoding workload; the sources do not establish a universal instance size or hosting cost for this command.

For a long-running channel, account for the VPS rental, outbound bandwidth terms, storage, and the operational work of keeping FFmpeg alive and monitoring it. Your actual cost depends on provider, instance, region, and data-transfer pricing; check the host’s current terms rather than assuming a fixed monthly total.

Troubleshoot common failures

No incoming preview

  • Re-copy the RTMPS URL from Live Control Room and confirm you selected the RTMPS endpoint.
  • Check that the key is current and belongs to the selected stream, and that it has not been incorrectly combined with the URL.
  • Confirm the FFmpeg build supports RTMPS and that outbound connectivity from the VPS permits the connection. Firewall and provider-specific causes vary.

Playlist stops after one pass

Make sure -stream_loop -1 appears before the playlist’s -i. It is an input option and must apply to the relevant input.

Gaps, glitches, or audio changes at file transitions

Check that concat-listed files have compatible streams and that their listed durations are accurate. Mismatched stream properties or duration errors can create artifacts; a mixed media set may need to be normalized before using a concat-demuxer playlist.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

Dropped frames, buffering, or an overloaded VPS

Check FFmpeg’s output and the Live Control Room preview. Reduce encoding load or output bitrate to fit the server and its actual uplink, while preserving YouTube’s recommended bandwidth headroom. A lower resolution or frame rate may be preferable if the server cannot encode the intended output in real time.

The stream key may have been exposed

Reset the key in Live Control Room, then update the FFmpeg configuration with the new key. Treat the replacement as a secret as well.

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

Or let it run in the cloud

If you want a YouTube playlist to stay live without maintaining a VPS and FFmpeg process, StreamNeo runs uploaded videos from the cloud. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Your computer and home connection do not have to stay on. StreamNeo streams the upload as made, up to 4K 60fps, at one flat price per slot, with no re-encode or quality tiers; it automatically recovers if YouTube drops the stream. The first day is free with no card.

Each slot includes one always-on YouTube stream, 10 GB storage per slot pooled across active slots, 24/7 looping and playlists, and StreamNeo team support. The same product is included on every plan; only the billing period changes. Daily $0.99 per day · Weekly $2.99 per week · Monthly $9.99 per month · 6 months $49.99 for 6 months · Yearly $89.99 a year. UPI and cards are available in India; card checkout is available worldwide. For five or more slots, contact support. Learn more at StreamNeo.

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.

To try it, start the free first day with no card at StreamNeo registration.

Frequently Asked Questions

Can FFmpeg stream an M3U or M3U8 playlist with the same command?

Not necessarily. The example uses a local concat-demuxer text file; an M3U/M3U8 source may need different input handling, so check its format and FFmpeg support.

Will an indefinitely looped stream become one YouTube archive?

Not necessarily. YouTube’s encoder instructions say streams under 12 hours are automatically archived; they do not establish that an indefinite session will be archived as one complete video.

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.

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.