October 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 NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Install NGINX RTMP on Ubuntu 22.04 for a YouTube Loop Stream

NGINX RTMP provides an RTMP server or relay; FFmpeg handles the prerecorded video and outgoing stream. Here’s how to choose an Ubuntu 22.04 installation route and check YouTube settings and loop reliability.
Length8 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

NGINX RTMP does not loop a video file by itself. For a YouTube loop stream, FFmpeg reads and publishes the prerecorded video; the third-party nginx-rtmp-module can provide an RTMP ingest or relay layer between FFmpeg and YouTube. On Ubuntu 22.04, the available Jammy-specific installation guide is old and version-pinned, so treat a source build as a compatibility-sensitive project—not a current, verified copy-and-paste recipe.

What you need—and what each component does

  • NGINX plus nginx-rtmp-module: an RTMP server/relay layer. The module project documents live RTMP, relaying, recording, H.264/AAC support and FFmpeg integration. Its README includes the feature description “Online transcoding with FFmpeg.”
  • FFmpeg: reads the prerecorded media, prepares or encodes its audio and video, and publishes an outgoing stream. NGINX itself is not the file-looping encoder.
  • YouTube Live Control Room: provides the ingest server URL and stream key for the channel.
  • A server and network connection: if you encode on the Ubuntu server, its CPU must handle the selected encoding workload and its sustained upload connection must support the outgoing stream. The available sources do not establish a server sizing formula or a tested hardware profile.

This guide explains the installation choices and configuration decisions, then shows how to verify a loop-stream implementation. It does not present an unverified endless-loop command as a tested recipe: the available module documentation does not establish a robust loop, timestamp, reconnect or process-supervision setup for Ubuntu 22.04.

Choose an NGINX RTMP installation route

Route What it means Important qualification
Open Source NGINX source build Build NGINX with the third-party module using the module README’s ./configure --add-module=/path/to/nginx-rtmp-module, then make and make install. The upstream project documents this integration. A community page labeled for Ubuntu 22.04.1 pins NGINX 1.23.1 and older dependencies; it is not current compatibility validation. The available sources do not establish a currently supported Ubuntu 22.04 Open Source package name or a tested contemporary NGINX/module combination.
NGINX Plus dynamic module NGINX documentation describes installing nginx-plus-module-rtmp from the official NGINX Plus repository, loading it with a top-level load_module directive, testing configuration with nginx -t, and reloading NGINX. This is specifically the NGINX Plus product path. It is not instructions for installing the module into Ubuntu’s Open Source NGINX package.

For an Open Source build, match the NGINX and module revisions and preserve any configure options needed by your existing NGINX features. Validate the resulting binary and configuration before relying on it. These are prudent build checks, not commands or combinations tested for this article. Do not assume the old Jammy page’s pinned versions are the best current choice.

Build and configure the Open Source module

1. Match the source versions and build options

Use the upstream module’s documented source-build integration as the build model: obtain compatible NGINX and nginx-rtmp-module source trees, then configure NGINX with --add-module=/path/to/nginx-rtmp-module before running make and make install. Replace the example path with the actual module source directory. The exact compatible versions, dependencies and full configure command depend on your chosen source revisions and existing NGINX build; they are not established by the Ubuntu 22.04.1 community page, which is pinned to NGINX 1.23.1.

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.

If an NGINX installation already serves other sites, check its existing configure options and deployment layout first. A source installation can differ from the distribution package in binary location, configuration paths and service integration; do not overwrite a working installation without a rollback plan.

2. Add an RTMP application

The upstream module README’s sample configuration places the RTMP block at the top level, defines a server listening on port 1935 and enables publishing in an application. Conceptually, its example uses an rtmp {} block, an server with listen 1935;, and an application with live on;. The exact deployment configuration should follow the README for the module revision you build.

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.

The README also shows push for relaying to another RTMP host and FFmpeg exec examples. These are project examples, not proof that a particular combination is suitable for a public internet-facing server. Restrict who can publish, protect credentials, and avoid exposing an unauthenticated relay or publish endpoint to the public internet.

3. Check the installation before using it

Confirm that the NGINX binary you intend to run includes the module and that the configuration parses. The documented NGINX Plus workflow uses nginx -t followed by a reload; for a source-built Open Source installation, use the equivalent checks for that build and its service setup. A successful syntax check confirms configuration parsing, not that FFmpeg can publish to YouTube or that an endless loop will remain healthy.

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.

Connect the loop stream to YouTube

  1. Get the endpoint and key: in YouTube Live Control Room, obtain the server URL and stream key for the stream. Use the URL and transport YouTube provides for that stream rather than assuming a fixed ingest address.
  2. Keep the key private: YouTube describes stream keys as password-like. Do not put the key in a public screenshot, repository, shared configuration file or command history. Channel owners or managers can reset a compromised key.
  3. Choose the route: YouTube recommends RTMPS, which is RTMP over TLS/SSL. Get the RTMPS URL from Live Control Room. The ability of a particular FFmpeg, NGINX and module build to use the selected route has not been established here; verify support for your chosen toolchain before relying on it. Standard RTMP and RTMPS are not interchangeable assumptions.
  4. Configure FFmpeg as the media publisher: FFmpeg must read the selected recording, produce audio/video suitable for YouTube, and publish to the selected endpoint with the stream key. NGINX may sit in the middle as an ingest or relay layer, but it does not replace the media reader and encoder.
  5. Test in Live Control Room: start sending a test stream and confirm that YouTube receives stable video and audio before scheduling or relying on a continuous broadcast. YouTube’s encoder guidance says, “Make sure to test before you start your live stream.”

Set an encoder profile YouTube can receive

YouTube’s encoder guidance, accessed in 2026, supports RTMP/RTMPS; H.264, H.265 (HEVC) or AV1 video; AAC or MP3 audio; frame rates up to 60 fps; and constant bitrate (CBR). It recommends a two-second keyframe interval, which should not exceed four seconds. These are platform recommendations, not measurements of NGINX performance or the capacity of a particular server.

H.264 output YouTube-listed minimum YouTube-listed recommendation
720p at 30 fps 3 Mbps 8 Mbps
1080p at 30 fps 5 Mbps 14 Mbps
1080p at 60 fps 6 Mbps 17 Mbps

These bitrate figures are YouTube’s published H.264 guidance accessed in 2026. Choose output based on the source’s actual resolution and frame rate, and the upload capacity you can sustain; the listed bitrate is not a guarantee that your connection or server can hold the stream. YouTube recommends a reliable quality setting appropriate to the connection and an upload speed test.

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
  • Keyframes: target YouTube’s recommended two-second interval and do not exceed four seconds.
  • Audio: for stereo, YouTube recommends a 44.1 kHz sample rate and 128 Kbps bitrate.
  • Advanced video guidance: YouTube lists square pixels, progressive scan, two B-frames, one reference frame, CABAC and Rec. 709 for SDR.
  • Codec choice: select a supported codec and verify that your FFmpeg build and encoding settings can produce it. Do not infer server CPU requirements from YouTube’s bitrate table.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make a loop reliable before calling it 24/7

A file that plays once is not automatically a stable loop stream. The module README demonstrates FFmpeg integration, but the available documentation does not verify an endless-loop command, timestamp handling at loop boundaries, network reconnection policy, a supervisor configuration or recovery after interruption for Ubuntu 22.04.

Before depending on your own implementation, test the exact media file and installed FFmpeg version. Check that timestamps remain acceptable at each loop boundary, that YouTube continues to receive stable audio and video, and that the process manager can restart the encoder if it exits. Test behavior after network interruption as well. These checks are necessary validation steps, not claims that a particular command or setup has passed testing.

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.

YouTube notes that streams under 12 hours are automatically archived. That is an archive behavior, not a promise that a longer stream will be archived or that a stream will stay connected for that duration.

Copyright and YouTube policy checks

Only stream material you have rights to use. A looping video can still trigger copyright claims or other rights issues; repeatedly broadcasting a recording does not grant permission for its music, gameplay, artwork or other included material. Review YouTube’s current live-stream and monetization rules for your channel and content before going live. Technical acceptance by an ingest server is not a determination that content complies with platform policy.

Troubleshoot common failure points

Symptom Likely area to check Next step
NGINX rejects the configuration or does not recognize RTMP directives Module loading, build integration or configuration placement Confirm that the running NGINX binary includes or loads the module, that the rtmp {} block is at the top level, and that the configuration test passes for the binary you intend to run.
FFmpeg cannot publish to YouTube Endpoint, stream key, transport or toolchain compatibility Re-copy the server URL and key from Live Control Room, confirm the key has not been reset, and verify that your chosen FFmpeg/NGINX/module versions support the selected RTMP or RTMPS route.
YouTube receives video but playback is unstable Encoder profile, upload capacity or media timestamps Match resolution and frame rate to the source, use an appropriate sustained bitrate and YouTube’s keyframe guidance, test upload capacity, and inspect timestamps across loop boundaries.
The stream stops when the encoder exits or the connection drops Process supervision and recovery behavior Test your process manager’s restart behavior and network-interruption handling. Automatic recovery is not established by the module examples alone.
Stream works briefly but not as an indefinite broadcast Long-duration behavior and archive expectations Run a controlled test of the full media-loop and recovery setup. YouTube states that streams under 12 hours are automatically archived; do not assume the same archive outcome for longer streams.

Or let it run in the cloud

If your goal is simply to keep prerecorded video live on YouTube, StreamNeo avoids maintaining an Ubuntu server, NGINX build and FFmpeg process yourself. Upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops the uploaded video in the cloud, so nothing has to stay on at home. It supports any quality up to 4K 60fps as uploaded at one flat price per slot, with no re-encode or quality tiers, and automatically recovers if YouTube drops the stream.

The first day is free with no card required, once per account. Monthly billing is $9.99 per month. StreamNeo is for prerecorded video streams to YouTube, not camera broadcasts. See StreamNeo or its plans, then start your free 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 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
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.