For a YouTube loop stream, NGINX RTMP and FFmpeg do different jobs: NGINX’s third-party RTMP module can accept or relay a stream, while FFmpeg reads your prerecorded video and sends the live encoder output to YouTube. On Ubuntu 22.04, the available documentation does not establish a current, verified Open Source package-and-module installation recipe or a tested endless-loop command. The safest path is to choose an installation method deliberately, match NGINX and module versions if building from source, then test the complete stream and recovery behavior before relying on it.
What you need—and what each component does
- NGINX with 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 describes “Online transcoding with FFmpeg.” nginx-rtmp-module README
- FFmpeg: the media-processing component that reads a file and produces the outgoing audio/video stream. It may publish directly to YouTube or send to an intermediate RTMP layer, depending on your design.
- YouTube Live Control Room: provides the ingest server URL and stream key. YouTube describes stream keys as password-like credentials; keep them private and reset a compromised key. YouTube: Set up your encoder for live streaming
NGINX itself is not the media-file looping encoder. Installing its RTMP module alone will not make a video repeat. The module’s example configuration includes an RTMP server on port 1935, an application with live on;, relay directives and FFmpeg examples, but examples are not a security review or a guarantee that every directive suits a public-facing server. nginx-rtmp-module README
Choose an installation route on Ubuntu 22.04
Open Source NGINX with the third-party module
The module’s upstream README documents compiling NGINX with the module source using ./configure --add-module=/path/to/nginx-rtmp-module, followed by make and make install. This is a source-build outline, not a complete contemporary Ubuntu 22.04 recipe: the currently supported Open Source package name, compatible module revision and tested build combination are not established here. nginx-rtmp-module README
If you build from source, select and match the NGINX and module revisions. Preserve any configure options needed by your existing NGINX features; replacing an existing binary with one built using different options can remove capabilities you rely on. Verify the resulting binary and configuration before use, and do not assume an older Jammy guide proves current compatibility.
#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.
NGINX Plus dynamic module
NGINX documents installing nginx-plus-module-rtmp from the official NGINX Plus repository, loading it with a top-level load_module directive, validating with nginx -t and reloading NGINX. This is specifically an NGINX Plus route, not instructions for installing the Open Source Ubuntu package. NGINX Plus RTMP module documentation
Why an old Jammy build page is not enough
A community wiki page labeled for Ubuntu 22.04.1 describes a source build pinned to NGINX 1.23.1 and older dependencies. Treat it as historical evidence that a Jammy source build has been documented, not as a current, verified installation recipe. Building on Ubuntu 22.04.1
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.
Configure the RTMP layer carefully
The upstream sample places an rtmp {} block at NGINX’s top level, defines an RTMP server listening on port 1935 and adds an application with live on;. Its README also demonstrates push relaying and FFmpeg execution examples. Use those as configuration concepts, then validate against your actual NGINX build and deployment rather than copying a public-ingest configuration without reviewing access controls. nginx-rtmp-module README
- Restrict who can publish to any RTMP application you expose; an open publish endpoint can be abused.
- Keep the YouTube stream key and other credentials in protected configuration. Do not put them in public screenshots, a repository, or shell history.
- For a source build, confirm the installed NGINX binary, module and configuration are compatible before reloading or replacing a working service.
For NGINX Plus, the documented dynamic-module sequence includes adding a top-level load_module directive, running nginx -t to test configuration, and reloading NGINX after validation. Those instructions apply to NGINX Plus as documented, not automatically to an Open Source build. NGINX Plus RTMP module documentation
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →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.
Set the YouTube endpoint and encoder profile
- In YouTube Live Control Room, create or select the live stream and retrieve the server URL and stream key.
- Enter the endpoint and key in the encoder or relay configuration you have chosen. Treat the key as a password; channel owners or managers can reset it if it is exposed. YouTube encoder setup
- Choose a video profile that matches the source and your sustained upload capacity. YouTube’s encoder guidance 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 and says not to exceed four seconds. YouTube Live encoder settings
- For stereo audio, YouTube recommends a 44.1 kHz sample rate and 128 Kbps bitrate. Its advanced guidance includes square pixels, progressive scan, two B-frames, one reference frame, CABAC and Rec. 709 for SDR. Match the settings to your encoder’s capabilities and source; these are platform recommendations, not a guarantee that every combination is supported by a particular FFmpeg build. YouTube Live encoder settings
- Test the stream before scheduling or depending on it. YouTube’s guidance says, “Make sure to test before you start your live stream.” YouTube Live encoder settings
| H.264 profile in YouTube guidance | Listed minimum bitrate | Recommended bitrate |
|---|---|---|
| 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 are YouTube’s published encoder recommendations, accessed in 2026, not independent performance measurements. They do not specify the CPU or memory needed to encode a particular source. YouTube advises choosing a reliable quality setting for the connection and testing upload speed. YouTube Live encoder settings
RTMP or RTMPS?
YouTube recommends RTMPS, which is RTMP over TLS/SSL, and directs creators to obtain the RTMPS URL from Live Control Room. Confirm that the specific FFmpeg, NGINX and module build you choose can use the selected outbound route before relying on it; compatibility of a particular Ubuntu toolchain was not verified here. YouTube: Stream using RTMPS
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
Build and validate the repeating media pipeline
Use FFmpeg to read the prerecorded file and publish its encoded output. NGINX RTMP can sit between FFmpeg and YouTube as an ingest or relay layer, but it does not by itself make the file loop. The module project documents FFmpeg integration and publishing examples; the documentation available here does not establish a current, fully tested command for an indefinite file loop, timestamp handling, reconnect policy or service supervision. nginx-rtmp-module README
Before depending on your implementation, verify it against your installed FFmpeg version and actual media file:
Free tools Windows power users keep installed
One-click scans. No signup required.
Best 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.
- Confirm the audio and video timestamps remain acceptable when playback returns to the beginning.
- Check that YouTube receives a stable stream at the selected resolution, frame rate, bitrate and codec.
- Test what happens when the source file ends, the network drops, YouTube disconnects, or the encoder process exits.
- Use an appropriate process supervisor if you need a failed encoder process restarted, and verify the restart behavior rather than assuming it.
- Check the YouTube Live Control Room status and playback output during a test session before using the stream for a scheduled audience.
YouTube says streams under 12 hours are automatically archived. That is an archive behavior, not a promise that an uninterrupted loop can run indefinitely; plan and test around the platform’s stream lifecycle. YouTube encoder setup
Troubleshoot common failures
| Symptom | What to check |
|---|---|
| NGINX rejects the configuration or fails to start | Confirm the RTMP module is actually present in the chosen build, that directives are in the correct context, and that the configuration matches the installed NGINX/module combination. For the documented NGINX Plus route, run nginx -t before reloading. |
| FFmpeg cannot publish to the endpoint | Check that the server URL and stream key were copied from the current Live Control Room stream and that the encoder’s chosen RTMP or RTMPS transport is supported by the exact toolchain. |
| YouTube reports unstable or poor-quality input | Compare the configured codec, CBR bitrate, keyframe interval, resolution and frame rate with YouTube’s guidance; test sustained upload capacity rather than relying on a short speed peak. |
| Video plays once and stops, or breaks at the loop boundary | The module is not the loop encoder. Validate the FFmpeg loop implementation and timestamp continuity with the chosen file; the available documentation does not establish a tested universal looping command. |
| The stream stops after a process or network interruption | Test the encoder restart and reconnection path, and verify whether YouTube receives a valid resumed stream. Do not treat an RTMP relay directive as proof of automatic recovery for every failure. |
| Unexpected publishing appears on your RTMP server | Restrict publish access and rotate exposed credentials. Never place the YouTube key in public configuration or logs. |
DIY costs and operational trade-offs
The software-centered setup can involve a machine that stays online, network capacity for the outgoing stream, storage for source media and enough compute for the encoding profile if FFmpeg transcodes. The sources cited here do not establish server sizing, resource use or a current compatible Ubuntu Open Source build, so estimate and test for your own source and workload rather than relying on a universal VPS specification. YouTube’s bitrate figures are encoder recommendations, not hardware requirements.
Or let it run in the cloud
If you want a YouTube loop without maintaining an Ubuntu host, StreamNeo is a cloud service that plays uploaded videos on a YouTube channel. Upload a recording or make a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; the stream runs from the cloud, at the quality you uploaded up to 4K 60fps for one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month. Start your free StreamNeo day.
Quick Recap
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.




