You can keep a prerecorded playlist live on YouTube by running FFmpeg on a cloud server and publishing its output to the RTMPS ingest URL and stream key from YouTube Live Control Room. For one playlist and one destination, direct FFmpeg publishing is usually the simplest setup. Add nginx-rtmp only if you need it as a local ingest point, relay, access-control layer, or process launcher.
This guide covers both architectures, the YouTube settings that matter, and the operational checks needed for a stream intended to run unattended. The commands use placeholders: retrieve your own ingest URL and stream key in Live Control Room, and never expose the key.
Choose an architecture before configuring the server
YouTube separates the incoming encoder feed from the viewer-facing broadcast. In the Live Streaming API, the incoming feed is a liveStream; the viewer-facing event is a liveBroadcast. The stream provides the ingest details, including the stream name and primary or backup address. The broadcast is what viewers watch. See the YouTube LiveStreams API reference.
| Option | What runs where | Trade-off | Best fit |
|---|---|---|---|
| Direct FFmpeg publishing | FFmpeg reads the media on the cloud server and publishes to YouTube. | Fewest components; you maintain the encoder, host, credentials, playlist, and monitoring. | One continuous output to YouTube. |
| nginx-rtmp plus FFmpeg | An encoder publishes to an nginx-rtmp application, which relays or launches an external FFmpeg process. | Adds NGINX configuration and another failure point, but supports local ingest, relays, or module-level access controls. | A workflow with a concrete NGINX ingest or relay requirement. |
| Managed cloud playlist service | A provider hosts uploaded media and publishes it to YouTube. | Less infrastructure to maintain, but the provider sets the workflow and limits. | Someone who prefers a managed workflow over server administration. |
For a single prerecorded playlist, start with direct FFmpeg unless an intermediary solves a specific need. nginx-rtmp does not replace YouTube’s ingest URL, stream key, or broadcast configuration.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- 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 YouTube Live Control Room and protect the stream key
- Open YouTube Studio and go to Create > Go live to enter Live Control Room. Create or select the broadcast you intend viewers to watch.
- In the stream settings, retrieve the server/connection URL and stream key. YouTube’s Help Center explains how to use RTMPS in Encrypt your stream using RTMPS.
- Use the RTMPS URL when you want the encoder connection encrypted. Depending on the encoder, the URL and stream name/key may go in separate fields or be joined in the output address. Follow the format expected by the encoder; do not assume every URL field takes the key in the same way.
- Keep the key in a private file or secret store with permissions limited to the service account. Do not put a real key in a public configuration, source repository, tutorial, or screenshot. If you believe it has been exposed, replace or reset it in Live Control Room and update the server configuration.
The API describes primary and backup ingest addresses and a stream name; consult the LiveStreams reference if integrating through the API rather than copying values from the interface. A YouTube ingest connection by itself does not guarantee that the intended broadcast is live to viewers; check the broadcast and its health in Live Control Room.
Stage and validate the playlist files
Put the videos on persistent cloud-server storage, not a temporary directory that may be cleared on restart. Make a playlist file with one media path per line. FFmpeg’s concat demuxer reads a list such as:
file '/srv/stream/media/film-01.mp4'
file '/srv/stream/media/film-02.mp4'
file '/srv/stream/media/film-03.mp4'
Save it as /srv/stream/playlist.txt, adjusting paths to the files on your server. Ensure the service user can read the playlist and every referenced file. Paths containing special characters need correct quoting and escaping; test the playlist as the same user that will run the service.
A concat playlist loops cleanly only when the source files can be concatenated consistently. Differences in codecs, resolution, frame rate, stream layout, or timestamps can cause errors or playback discontinuities. A public setup example describes normalizing files before looping, but it is an implementation example rather than a guarantee for other media. Validate your own files and logs. If formats differ, normalize them into compatible files before relying on an unattended loop.
Rank #2
- 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.
Publish directly with FFmpeg
Direct publishing avoids an extra RTMP hop. The following is a starting pattern, not a universal command: replace the paths and destination placeholder with your own values, and check compatibility and current YouTube recommendations for the content you are sending.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i /srv/stream/playlist.txt
-c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k
-pix_fmt yuv420p -g 120 -keyint_min 120 -sc_threshold 0
-c:a aac -b:a 160k -ar 48000
-f flv 'rtmps://YOUR_INGEST_URL/YOUR_STREAM_KEY'
Use a placeholder in scripts or examples; do not commit a real key. If YouTube supplies the URL and key as separate values, assemble the output address according to its format and FFmpeg’s expected RTMP/RTMPS URL syntax. The sample bitrate, GOP values, and codec choices are illustrative starting values, not a claim that they suit every resolution, frame rate, source, or current YouTube recommendation.
What the important options do
-rereads the input at approximately its intended playback rate rather than sending the whole file as fast as possible.-stream_loop -1repeats the input indefinitely. With the concat demuxer, verify that your FFmpeg build and playlist behave as intended by watching through a complete loop.-f concat -safe 0selects the concat demuxer and permits the absolute paths shown in this example. Only use a playlist you control; do not use permissive path handling with untrusted input.-c:v libx264and-c:a aacencode video and audio. This uses CPU; choose settings based on the output format, source and server capacity.-gand-keyint_minset keyframe spacing in frames. A frame count is not a fixed time interval unless you also know the frame rate. YouTube’s API diagnostics identify keyframe intervals longer than four seconds as a configuration problem; keep the interval at four seconds or less. See the LiveStreams API reference and YouTube’s encoder settings, bitrates, and resolutions.-f flvselects the output format commonly used for RTMP-family publishing. Confirm the output protocol and address against the ingest details YouTube gives your encoder.
For example, a GOP of 120 frames is a four-second interval only at 30 frames per second. If the media has variable or changing frame rates, do not infer the interval from that example; select and verify a configuration appropriate to the actual output. YouTube’s API health diagnostics also flag unsupported audio/video codecs, missing audio or video, bitrate or frame-rate mismatches, too many audio/video streams, and long keyframe intervals. Its codec diagnostics identify H.264 video and AAC or MP3 audio. Check the current YouTube encoder settings for exact recommendations before going live.
Stream-copy only when the files are compatible
Encoding with libx264 and AAC can make a predictable output, but it consumes compute resources. If all files already have compatible codecs, dimensions, frame rates, audio layout, and timestamps, stream-copying may avoid video encoding work. A copy workflow cannot correct incompatible media or add missing streams, and YouTube may reject an output that does not meet its requirements. Test the complete playlist and inspect YouTube’s health status before leaving it unattended.
Rank #3
- 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.
Add nginx-rtmp only when you need an RTMP intermediary
The nginx-rtmp module can accept RTMP publishes, relay to another destination, apply publish/play access rules, and launch external commands. Its documentation describes push, exec_push, exec_static, and process-respawn directives. It is not required for a direct FFmpeg-to-YouTube workflow, and installing it does not supply YouTube credentials or configure a YouTube broadcast.
- Install NGINX with a compatible nginx-rtmp module for your server distribution or build. Verify the module is loaded before adding its directives.
- Define an RTMP application in the NGINX configuration and restrict who may publish to it. Do not expose an unauthenticated publish endpoint to the public internet.
- Configure the local encoder or FFmpeg process to publish to that application, then configure the relay or external process to publish to YouTube’s RTMPS ingest address with the private key.
- Validate the NGINX configuration before reload, then inspect both NGINX and FFmpeg logs. Confirm that YouTube receives the expected stream and that the broadcast is progressing.
The exact configuration depends on the module build, application name, authentication approach, and whether you use relay directives or an external FFmpeg process. The nginx-rtmp directives documentation documents its available directives. In particular, module respawn behavior can relaunch a child process that exits; it cannot establish that the playlist is valid, the network works, or YouTube is showing a progressing broadcast.
The module documentation lists a default RTMP socket timeout of one minute and a default ping timeout of 30 seconds. These are documented module defaults, not universal recommended settings. Change timeout behavior only to address a diagnosed network or workflow requirement, and test the effects on both sides of the relay.
Run it as a service and monitor the actual broadcast
A terminal session is not an operations plan for a 24/7 stream. Use a supervisor such as systemd for the FFmpeg process, configure restart behavior and useful logs, and monitor both the machine and the public stream. A restart policy helps after process exit; it does not guarantee an uninterrupted viewer experience.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #4
- 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
Operational checks
- Process: confirm the service is active and record exit status and restart events.
- Logs: retain enough FFmpeg and, where used, NGINX output to diagnose input read errors, encoder failures, and connection drops.
- Storage: check free disk space and confirm source files remain available to the service user.
- Network: monitor outgoing traffic and connection errors; test the server’s route to the ingest endpoint.
- YouTube: inspect stream health in Live Control Room and confirm the public broadcast is actually progressing, not merely that FFmpeg is running.
- Recovery: test a full playlist cycle and a deliberate encoder restart before depending on unattended operation. If using a backup ingest address, configure and test it rather than assuming it will be used automatically.
A public 24/7 YouTube stream setup and operations example illustrates normalized media, looping playlist lists, direct YouTube output, and systemd restart behavior. Treat it as an example, not a tested drop-in configuration: adapt and verify it on your own server.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Estimate hosting needs and costs from the real output
There is no universal VPS size, bandwidth bill, or uptime figure for this setup. Needs depend on output bitrate, whether FFmpeg transcodes or stream-copies, playlist storage, number of simultaneous outputs, and the cloud provider’s terms. Benchmark the intended media on the server you plan to use rather than assuming a particular CPU will handle it.
For a rough egress estimate, multiply the actual sustained output bitrate by the number of seconds streamed, then convert bits to bytes and allow for protocol overhead. At 4,500 kbit/s, one continuous output is roughly 1.62 GB of payload per hour using decimal units (4,500,000 bits/s Ă— 3,600 Ă· 8); a month of uninterrupted operation is roughly 1.17 TB before overhead. Your actual traffic may differ if the bitrate varies or the connection restarts. Compare this estimate with the host’s included transfer allowance and overage terms. Storage is a separate requirement: allow space for the full media library and any normalized copies.
Compare self-hosting and a managed service on total cost and responsibility, not just the server’s advertised monthly charge: include storage, egress, compute, setup time, monitoring, and maintenance. Managed options reduce infrastructure work but have provider-defined limits and recovery behavior.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteBest Value
- 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 playlists: upload the video, add your YouTube stream key, and go live. Its cloud runs the loop, so nothing has to stay on at home; it describes automatic recovery if YouTube drops the stream. StreamNeo accepts uploads as made, up to 4K 60fps, at one flat price per slot without re-encoding or quality tiers. The first day is free with no card, one free day per account. The monthly plan is $9.99 per month. See StreamNeo for current plan terms and the copyright safety checklist before streaming content.
Start your free StreamNeo day.
Copyright, reused content, and broadcast checks
A technically valid stream is not automatically cleared for YouTube or monetization. You are responsible for having the rights and permissions needed for every video, music track, image, and other element in the playlist. A continuous loop does not change those rights. Check YouTube’s applicable copyright policies and account status, and do not assume that permission to upload a video also grants permission to rebroadcast it continuously.
Reused-content and monetization reviews are distinct from whether an encoder connects. Repeating existing material may raise questions about originality or value under YouTube’s monetization policies even when you have permission to use it. Review the current policy and your channel’s eligibility rather than treating a 24/7 stream as a shortcut to monetization. Confirm visibility, title, audience settings, and the selected broadcast in Live Control Room before promoting the stream.
Quick Recap
Troubleshoot common failures
| Symptom | Likely cause | What to check or do |
|---|---|---|
| YouTube never receives the encoder feed | Wrong ingest URL/key, malformed output address, RTMPS/protocol mismatch, or network failure. | Copy the current connection details from Live Control Room, verify how FFmpeg expects URL and key, inspect FFmpeg logs, and test outbound connectivity. |
| YouTube reports a codec or configuration problem | Unsupported codec, missing audio/video, bitrate or frame-rate mismatch, excessive streams, or keyframes too far apart. | Inspect the actual output and consult the current YouTube encoder settings and API health diagnostics. Ensure keyframes occur at intervals of four seconds or less. |
| Playlist stops at a file boundary | Incompatible media properties, invalid playlist paths, unreadable files, or concat/timestamp errors. | Run the playlist as the service user, inspect FFmpeg logs at the boundary, and normalize files to compatible formats if needed. |
| FFmpeg is running but viewers see a stalled or offline broadcast | The process may be alive while its input, network connection, ingest, or broadcast has failed. | Check logs and YouTube stream health, then confirm the public broadcast is progressing. Do not rely on process status alone. |
| nginx-rtmp child process repeatedly restarts | The launched command may exit immediately because of a bad path, credentials, permissions, or input failure. | Inspect the module and child-process logs, run the exact command under the service account, and correct the underlying error before relying on respawn. |
| Disk fills or the host exceeds its transfer allowance | Media storage, normalized copies, or continuous egress exceed the available quota. | Measure library size and real output bitrate, check provider transfer terms, and remove only files no longer needed after preserving a backup. |
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.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →




