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
Mountain View desk7 min

How to Set Up SRS on Ubuntu for YouTube Loop Streaming

A practical Ubuntu guide to running SRS with Docker, looping a video into it with FFmpeg, choosing YouTube encoder settings, and distinguishing local SRS ingest from a YouTube broadcast.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can use SRS on Ubuntu to receive a continuously looped video from FFmpeg, but the basic SRS example does not forward that video to YouTube. The documented setup has two separate links: FFmpeg publishes to SRS, while YouTube expects an encoder to publish to its Live Control Room URL and stream key. This guide shows the SRS loop, YouTube’s encoder requirements, and the boundary between them so you do not mistake a working local stream for a YouTube broadcast.

What SRS does—and what it does not do in this setup

SRS (Simple Realtime Server) is a media server; FFmpeg reads a video file and publishes its audio and video to the server. YouTube Live is the final destination in a YouTube broadcast. SRS supports protocols including RTMP, WebRTC, HLS, HTTP-FLV, SRT and MPEG-DASH, and its upstream project recommends Docker. The SRS repository identifies version 8.0, while its separate v7 RTMP guide labels that branch unstable, so do not treat a v7 guide as a universal version instruction. SRS repository · SRS Getting Started · SRS RTMP guide

As an Amazon Associate I earn from qualifying purchases.

The key distinction is that publishing to SRS is not the same as publishing to YouTube. The official SRS getting-started examples document an FFmpeg publisher sending to SRS; YouTube’s instructions document an encoder sending to YouTube. They do not establish the outbound SRS-to-YouTube relay configuration that would join those two steps. Do not expect the basic Docker and FFmpeg examples below, by themselves, to create a YouTube Live broadcast.

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

Start SRS on Ubuntu with Docker

SRS’s Getting Started guide gives this sample Docker command:

docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 ossrs/srs:5

This is an upstream example, not a claim that the 5 image tag is the latest or the right choice for every host. The current SRS repository README shows a different image tag and additional UDP ports. Before deploying, verify the upstream image tag you intend to use. For a persistent service, plan restart behavior and configuration persistence rather than relying on a temporary interactive example. Expose only ports you need: the sample maps RTMP on 1935, 1985, and 8080, but it is not a hardened production firewall recipe. SRS repository examples

Check that the local server responds

The Getting Started example uses http://localhost:8080/ as a lightweight local check. Its documented sample playback paths include:

  • HLS: http://localhost:8080/live/livestream.m3u8
  • HTTP-FLV: http://localhost:8080/live/livestream.flv

These localhost addresses are for a process on the same host or networking context. From another machine, substitute an address reachable from that machine and make sure the relevant port is exposed and allowed by the host and network firewalls. Docker networking details vary by deployment; do not assume a hostname or port mapping works identically on every Ubuntu installation. SRS Getting Started

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
GMKtec G3S Mini PC Intel N95 Processor (Up to 3.4GHz) 8GB RAM 256GB M.2 SSD | Mini Desktop Computer with VESA Mount for Office Home Business HTPC Proxmox, Dual 4K Display, WiFi 5, Gigabit Ethernet
  • 12th Intel Alder Lake N95 Processor – The GMKtec G3 S Mini PC is powered by the 12th Gen Intel N95 processor with 4 cores, 4 threads, 6MB cache and a burst frequency up to 3.4GHz. Compared with N100/N5105/N5100/N5095, the N95 delivers up to 36% overall performance improvement. Perfect for routine tasks, office work, and home entertainment, this compact mini desktop is more convenient than traditional bulky PCs.
  • 8GB RAM & 256GB SSD Storage – Pre-installed with 8GB DDR4 memory and a fast 256GB M.2 2242 SSD, the G3 S mini desktop offers quicker startup, smoother multitasking, and faster file transfers. Enjoy seamless performance whether you’re working on multiple applications, browsing, or streaming content.
  • Rich Interfaces & Connectivity – The G3 S mini computer comes equipped with USB 3.2 (up to 10Gbps), dual HDMI 2.0 (4K@60Hz), and a 3.5mm audio jack. With support for WiFi 5, Bluetooth 5.0, and Gigabit Ethernet (RJ45 1000MbE), it connects easily with monitors, projectors, printers, office equipment, and other peripherals, making it versatile for both home and business use.
  • Dual 4K Display Support – Featuring upgraded Intel UHD Graphics (up to 1000MHz), the G3 S supports 4K video playback and AV1 decoding for a smooth viewing experience. With dual HDMI outputs, you can connect two 4K@60Hz displays simultaneously, enabling efficient multitasking for work and entertainment.
  • GMKTEC WARRANTY - GMKtec offers a 3-year limited warranty (1 year replacement + 2 years parts replacement) for each mini PC, starting from the date of the purchase effective on all sales starting Oct. 2026. All defects due to design and workmanship are covered. With a professional after sales team always ready to attend to your needs, you can simply relax and enjoy your mini PC

Loop a video file into SRS with FFmpeg

SRS documents an FFmpeg example using -stream_loop -1 for indefinite repetition, real-time input pacing with -re, stream copying, and an RTMP destination:

docker run --rm -it ossrs/srs:encoder ffmpeg -stream_loop -1 -re -i doc/source.flv 
  -c copy -f flv rtmp://host.docker.internal/live/livestream

The guide’s doc/source.flv is part of the SRS source repository example; replace it with a file FFmpeg can read. The example’s host.docker.internal hostname depends on the container and host environment and may not work on every Linux installation. Use the correct address for your Docker networking setup. SRS FFmpeg example

Run FFmpeg directly on the Ubuntu host

If FFmpeg is installed on Ubuntu and SRS is listening on the host’s loopback interface at port 1935, this adapted command publishes a local file to SRS:

ffmpeg -stream_loop -1 -re -i /path/to/video.mp4 -c copy -f flv rtmp://127.0.0.1:1935/live/livestream

Here, -stream_loop -1 repeats the input indefinitely, -re reads it at a real-time rate, and -c copy passes the existing audio and video streams through without re-encoding. Copying works only when the input streams are compatible with the destination ingest. It does not make an unsupported codec suitable for YouTube, and the sources cited here do not establish a tested transcoding command for a particular file. Watch FFmpeg’s output for errors and check the receiving service’s playback or stream health.

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.

The command is an adaptation of the SRS documented loop option and publisher pattern, not a verbatim upstream command. The SRS RTMP guide also provides publisher examples, but its v7 branch is marked unstable. SRS Getting Started · SRS RTMP guide

Connect an encoder to YouTube Live

In YouTube Studio, create or schedule a live stream and open Live Control Room. Under Stream settings, copy the server URL and stream key and enter both in the encoder that will publish to YouTube. YouTube recommends RTMPS, which encrypts the stream using TLS/SSL. To reveal the RTMPS URL, use the lock icon under Stream settings; copy the URL shown there rather than assuming a default RTMP address. Keep the stream key private: anyone with it may be able to send a stream to your channel. YouTube: Encrypt your stream using RTMPS

Rank #4
Sale
GMKtec G10 Mini PC Ryzen 5 3500U 1TB SSD 16GB DDR4 Triple 4K Display
  • OFFICE LIGHT GAMING MINI PC - GMKtec Nucbox G10 Series is equipped with the Ryzen 5 3500U, a 64-bit quad-core mid-range performance x86 mobile microprocessor. This processor is based on AMD's Zen+ microarchitecture and is fabricated on a 12 nm process. The 3500U operates at a base frequency of 2.1 GHz with a TDP of 15 W and a Boost frequency of 3.7 GHz. This APU supports up to 32 GB of dual-channel DDR4-2400 memory and incorporates Radeon Vega 8 Graphics operating at up to 1.2 GHz. 35% Performance increase over the similar Intel N-Series N150/N100/N97/N95 processor chips
  • 16GB DDR4 + 1TB SSD - Installed with DDR4 16GB SO-DIMM RAM and a 1TB SSD, the Nucbox G10 mini pc supports memory expansion to 64GB RAM. Featured with Dual M.2 2280 PCIe 3.0 slots, supports dual storage slot expansion to 16TB SSD (2*8TB). (Upgrades not included) This model supports a configurable TDP-down of 12 W and TDP-up of 35 W
  • 2.5GBE ETHERNET FAST NETWORK SPEEDS - Enjoy up to 2500Mbps data transmission speed without worrying about lagging. Ideal for working, gaming, and surfing the internet. Great for Untangle, Pfsense or as a server office PC
  • MINI DESKTOP COMPUTER WITH TRIPLE DISPLAY SCREEN - Nucbox G10 integrates AMD Radeon Vega 8 1200 MHz GPU to deliver powerful graphics processing power to easily handle video editing, and playback, or casual gaming. And it can connect to 3 display screens simultaneously via HDMI 2.1 TMDS/ DPv1.4/ TYPE-C
  • FAST WIRELESS INTERNET WIFI 5 + BT5.0 - Enjoy blazing WiFi 5 & Bluetooth 5.0 alongside a powerhouse selection of ports - dual USB 3.2, USB 2.0, stunning 4K@60Hz HDMI 2.1 TMDS, Full Function USB-C (PD/DP/Data), dedicated DisplayPort, 3.5mm audio, and PD Power Supply for seamless multitasking and premium connectivity

These instructions describe the direct encoder-to-YouTube connection. They do not configure SRS to relay the FFmpeg publication onward. To use SRS as an intermediate server, you need an explicitly configured and verified outbound push/forward path for your chosen SRS version and deployment. The cited SRS examples do not provide that complete configuration, so this guide does not invent a relay directive or claim the end-to-end SRS-to-YouTube route is configured.

The documented simpler alternative: publish directly to YouTube

If you do not need SRS for local ingest or playback, a simpler architecture is an encoder publishing the looped file directly to YouTube using the server URL and key from Live Control Room. YouTube documents encoder-based streaming, but the exact FFmpeg command and file compatibility depend on your input and chosen settings. The direct path avoids an intermediate SRS relay; it does not use SRS. YouTube: Create a live stream with an encoder

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

Choose YouTube-compatible encoder settings

YouTube’s encoder guidance lists RTMP/RTMPS, H.264, H.265/HEVC or AV1 video, frame rates up to 60 fps, AAC or MP3 audio, and constant bitrate (CBR) encoding. YouTube recommends a two-second keyframe interval and says not to exceed four seconds. Its bitrate recommendations depend on resolution, frame rate and codec; the figures below are YouTube’s published recommendations, not audience-performance guarantees. The retrieved page does not state a publication year. YouTube encoder settings, bitrates, and resolutions

Example format YouTube-listed minimum YouTube-listed recommendation
720p at 30 fps, H.264 3 Mbps 8 Mbps
1080p at 30 fps, H.264 5 Mbps 14 Mbps
1080p at 30 fps, AV1 or H.265/HEVC 4 Mbps 10 Mbps

Choose a bitrate for the actual resolution, frame rate and codec rather than copying a figure from a different format. YouTube recommends testing upload bitrate with a speed test, testing representative audio and video motion, and monitoring stream health. Leave headroom on the upload connection so other network use or fluctuations do not consume the entire stream bitrate. YouTube encoder guidance

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

Choose between direct streaming and an SRS relay

Approach What the documented setup establishes What to consider
Direct encoder-to-YouTube YouTube’s Live Control Room supplies a server URL and key; YouTube recommends RTMPS. An encoder can publish to YouTube without SRS. Fewer components. Verify the file’s codecs and your upload connection, then monitor YouTube stream health.
FFmpeg into SRS The SRS examples establish a local RTMP publication and sample HLS/HTTP-FLV playback paths. Useful if you need SRS’s local ingest or playback, but this alone does not send the stream to YouTube.
SRS intermediate relay to YouTube The cited examples do not establish a complete outbound SRS-to-YouTube configuration. Verify the forwarding configuration for your specific SRS version before relying on this architecture. Account for the host’s network path and upload capacity.

Troubleshoot the common failure points

  • YouTube never shows the stream: identify which connection is actually running. An FFmpeg publisher pointed at SRS proves only that it is sending to SRS, not that YouTube receives anything. Confirm that an encoder is publishing to the YouTube URL and key, or that a separately configured SRS relay is active. SRS Getting Started · YouTube RTMPS setup
  • RTMPS reports an SSL or connection problem: verify that you copied the RTMPS URL revealed with the lock icon in Live Control Room, rather than using an RTMP URL by assumption. YouTube says to try port 443 if needed and compatible with the provided URL. YouTube RTMPS guidance
  • It works locally but not from another machine: check that the client uses an address reachable from its network, the right port is mapped by Docker, and firewalls permit the intended traffic. localhost always refers to the machine or network context where the command runs, not automatically to your remote Ubuntu server. SRS Getting Started
  • The file fails to publish or YouTube flags stream health: inspect FFmpeg’s error output and YouTube’s stream-health status. Confirm that the input codecs, frame rate, bitrate and keyframe interval match an accepted configuration. Stream copying does not convert incompatible media; the cited setup examples do not test every input file. YouTube encoder guidance

Copyright, repeated video and monetization

Before looping a recording, confirm you have the rights needed to stream its video and audio on YouTube. A file that you may watch privately is not automatically cleared for public livestreaming. YouTube’s encoder setup pages explain connection and technical settings, not whether a particular recording is copyright-safe or eligible for monetization. Check YouTube’s current policies and any applicable rights before going live; technical success does not establish permission or monetization eligibility.

Or let it run in the cloud

If you want a prerecorded YouTube stream without maintaining an Ubuntu server and relay, StreamNeo is a cloud service for uploaded videos and playlists. Upload a recording or build a playlist, add your YouTube stream key once, and go live. The cloud keeps the stream running, so nothing has to stay on at home. Every slot streams the upload as made, up to 4K 60fps, at one flat price per slot; StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. It streams to YouTube only, and is for uploaded videos rather than a live camera feed. Start your free day with StreamNeo.

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.

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 from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
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.