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 DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
VGSources
Blog

How to Stream a Continuous YouTube Playlist from a Cloud Server with nginx-rtmp

Run a prerecorded YouTube playlist continuously from a cloud Linux server with FFmpeg. Learn when nginx-rtmp helps, how to protect your stream key, and how to monitor recovery.
Length6 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can keep a prerecorded playlist live on YouTube by running FFmpeg on a cloud Linux server and publishing its output to the RTMPS URL and stream key from YouTube Live Control Room. For one playlist and one destination, direct FFmpeg publishing is usually the simpler setup; nginx-rtmp is optional and is useful when you need a local RTMP ingest point, a relay, or its access-control and process-launch features.

Choose the architecture before you configure it

YouTube separates the incoming encoder feed from the viewer-facing broadcast. Its Live Streaming API calls these resources a liveStream and a liveBroadcast: the stream carries the ingest details, while the broadcast is what viewers watch. YouTube describes the distinction in its LiveStreams API reference.

Direct FFmpeg publishing

FFmpeg reads the media on the server, loops the playlist, and publishes directly to YouTube. This has fewer components to configure and monitor, making it a good default for a single continuous output.

nginx-rtmp as an intermediary

With nginx-rtmp, an encoder publishes to an RTMP application hosted by NGINX, which can relay the stream or launch an external FFmpeg process. The module documents directives including push, exec_push, and exec_static. This adds another service and failure point, so use it when you need a local ingest from another encoder, multiple relays, or module-level access control—not just because nginx-rtmp is in the title. See the nginx-rtmp directives documentation.

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.

Prepare the YouTube destination and media

Get the ingest URL and stream key

  1. Open YouTube Live Control Room and create or select the broadcast you intend to use.
  2. In the stream settings, copy YouTube’s connection URL and stream key. Use the RTMPS URL when you want the encoder connection encrypted; YouTube’s instructions are in Encrypt your stream using RTMPS.
  3. Enter the URL and key in FFmpeg’s output configuration. Some encoders accept them as separate fields; with FFmpeg they are typically combined into the output URL as rtmps://INGEST_HOST/APP/STREAM_KEY. Replace the placeholders with the values YouTube provides for your stream.

Treat the stream key like a password. Do not put a real key in a public configuration file, source repository, tutorial, or screenshot. Restrict access to any server file containing it, and rotate the key in YouTube if it is exposed.

Check media compatibility

Use media with a supported video and audio combination, and decide whether FFmpeg can copy the existing streams or must transcode them. YouTube’s stream diagnostics identify problems such as unsupported codecs, missing audio or video, bitrate or frame-rate mismatches, excess audio/video streams, and long keyframe intervals. The API diagnostics identify H.264 video and AAC or MP3 audio, and specify a keyframe frequency of four seconds or less. Consult YouTube’s current encoder settings and recommendations for exact output settings; supported recommendations can change.

Build a continuous playlist with FFmpeg

Make a playlist file

Place the media on the cloud server and create a text playlist in playback order. For example, an FFmpeg concat-format file can look like this:

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.
file '/srv/stream/video-01.mp4'
file '/srv/stream/video-02.mp4'
file '/srv/stream/video-03.mp4'

Use paths that exist on the server and quote paths consistently, especially if they contain spaces or special characters. Confirm that the server account running FFmpeg can read every file. This list plays once unless the process or playlist is configured to repeat.

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

Publish to YouTube

A basic continuous loop can use FFmpeg’s concat demuxer and stream-copy mode when the files have compatible codecs, stream layouts, and parameters:

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i /srv/stream/playlist.txt 
  -c copy -f flv "rtmps://INGEST_HOST/APP/STREAM_KEY"

Replace the output URL with the RTMPS connection information YouTube supplies. Keep the key private. The -re option reads at approximately the media’s intended playback rate rather than sending a file as fast as possible; -stream_loop -1 repeats the input indefinitely. The FLV output format is used for this RTMP-family publishing workflow.

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.

Stream copying avoids re-encoding but only works reliably when the playlist files are compatible with one another and YouTube accepts their tracks and parameters. If they are not compatible, remove -c copy and configure explicit video and audio encoders, bitrate, resolution, frame rate, and keyframes to match YouTube’s current guidance. Transcoding increases CPU use; benchmark the intended files on the chosen server rather than assuming a particular server size will suffice.

Insert nginx-rtmp when it solves a specific need

For an intermediary, configure an nginx-rtmp application to accept the local encoder, then use a relay or an exec_push/exec_static process to send that input onward. Consult the module’s directive documentation for syntax and process behavior. Keep the YouTube destination key protected in the process configuration, and test that publishing to the local application actually leads to a healthy YouTube input. nginx-rtmp does not replace YouTube’s ingest URL or stream key.

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.

Keep the stream running and verify it

Supervise the encoder

Run FFmpeg under an operating-system supervisor such as systemd, configured to start at boot, restart after an unexpected exit, and retain useful logs. If nginx-rtmp launches FFmpeg, the module also offers child-process respawn controls. These mechanisms restart processes; they do not prove that the playlist is readable, the network is working, or the public broadcast is progressing. A public implementation example describes normalized files, looping lists, direct YouTube output, and systemd restart behavior, but it is an example rather than a guarantee: 24/7 YouTube Stream — Setup & Ops Notes.

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

Monitor the whole path

  • Check that the encoder process is running and review its logs for input, codec, authentication, and network errors.
  • Monitor free disk space, outgoing network traffic, and server resource use.
  • Check stream health in YouTube Live Control Room and confirm that the public broadcast is actually progressing.
  • Test a complete playlist loop and deliberately restart the encoder before relying on unattended operation.

A restart directive cannot guarantee an uninterrupted viewer experience. Confirm recovery in YouTube, not only in the server process list.

Understand nginx-rtmp timeouts

The module documentation lists a default RTMP socket timeout of one minute and a default ping timeout of 30 seconds. These are module defaults, not recommended settings for every deployment. Review them against your encoder, network, and intended behavior rather than treating them as universal tuning values.

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

Estimate the self-hosted cost

There is no universal server size, bandwidth cost, or uptime figure for this setup. Compute depends on whether FFmpeg copies or transcodes, the number of outputs, and the media format; storage depends on the playlist library; network egress depends on the continuous output bitrate and runtime. Estimate egress from the actual stream bitrate and expected hours, and benchmark transcoding with the intended media. Include the hosting bill and the time needed for setup, monitoring, updates, and recovery in the comparison.

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.

Or let it run in the cloud

StreamNeo is a managed option for prerecorded YouTube streams: upload a recording or build a playlist, add your YouTube stream key once, and go live. Its cloud keeps the loop running without a computer, OBS, or home connection staying on. Every slot supports any uploaded quality up to 4K 60fps at one flat price per slot, automatic recovery attempts if YouTube drops the stream, 10 GB storage per slot pooled across active slots, playlists, and team support. It streams to YouTube only; these are StreamNeo-described features, not an uptime guarantee.

The first day is free with no card, one free day per account. Billing options are: 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. Plans have the same product; only the billing length changes. UPI and cards are available in India, and card checkout is available worldwide. For five or more slots, contact support. See StreamNeo for current details.

To start, try StreamNeo’s free first 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 quests from Patch Notes

  1. How To Create Custom Stickers & Shoutouts In Monster Hunter WildsMonster Hunter WildsBlog20min
  2. How to Get XL Gogoat in Pokemon Legends Z-A (An Extra-Large Gogoat)Pokemon Legends Z-ABlog20min
  3. How to Get Rotting Lightbringer in Diablo 4Diablo 4Blog17min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.