DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober 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
DocumentaryTube
FFmpeg

How to Install FFmpeg on Ubuntu Server for a Continuous YouTube Stream

A practical guide to installing FFmpeg on Ubuntu Server and keeping a YouTube stream running with a continuing source, suitable encoder settings and systemd supervision.

By DocumentaryTube Team 6 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install FFmpeg from Ubuntu’s configured repositories with sudo apt update and sudo apt install ffmpeg, then verify the installation with ffmpeg -version. To keep a YouTube stream running, you also need a source that continues or loops, YouTube’s stream URL and key, suitable encoder settings, and a supervisor such as systemd. Installing FFmpeg alone does not make a stream continuous.

Install FFmpeg from Ubuntu’s repositories

Ubuntu’s standard package is the simplest starting point. The available FFmpeg version depends on your Ubuntu release and enabled repositories; check it before relying on a specific feature or encoder.

  1. Refresh the package index: sudo apt update.

  2. Install FFmpeg: sudo apt install ffmpeg.

  3. Verify the program and version: ffmpeg -version.

  4. Check the encoders available in that build: ffmpeg -encoders. Confirm that the codec you plan to use is listed.

Ubuntu documents package management with apt; its package index lists FFmpeg, and the Ubuntu FFmpeg manpage documents the command. Google Cloud also uses sudo apt install ffmpeg in its FFmpeg live-stream example. Avoid adding a third-party PPA just to obtain a newer build unless you have checked its provenance, maintenance and compatibility; Ubuntu advises researching non-standard repositories.

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.

Choose a source and create a YouTube stream

Make sure the source will continue

For prerecorded documentaries or other videos, FFmpeg must be given a repeating file or a playlist that supplies the next item. For a camera, capture card or network feed, the source itself must remain available and recover from interruptions. A looping example can illustrate the pattern, but an example command is not a universal recipe: input format, audio tracks, desired output and FFmpeg build all matter.

Before configuring a service, test the exact media you intend to stream. Confirm that it has the expected video and audio, plays through its end, and behaves correctly when repeated. A missing file, an exhausted playlist or an unavailable network source will stop useful output even if FFmpeg is installed.

Get the ingest URL and stream key

In YouTube Studio, open Live Control Room, create or select the stream, and copy its server URL and stream key into your encoder configuration. Follow YouTube’s instructions for connecting an encoder for the current interface and stream setup. The URL and key are used by FFmpeg to send the stream to YouTube.

Treat the key like a password. Do not publish it in a script repository, screenshot, support post or log. Store configuration with restrictive file permissions and avoid putting secrets in a world-readable systemd unit. If the key is exposed, replace it in YouTube Studio and update the server configuration.

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

Set FFmpeg output to match YouTube and your connection

For a conventional FFmpeg-to-YouTube setup, RTMPS is the sensible default. YouTube recommends RTMPS for this ingest mode. Its encoder guidance specifies H.264, H.265 (HEVC) or AV1 video; AAC or MP3 audio; constant bitrate encoding; and frame rates up to 60 fps. YouTube recommends a 2-second keyframe interval and says not to exceed 4 seconds. Check the current YouTube encoder settings before settling on a configuration.

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.

Use a bitrate your server can sustain

YouTube’s H.264 recommendations vary with resolution and frame rate. These are platform recommendations, not evidence that a particular server or network can sustain the rate:

H.264 output YouTube recommended bitrate YouTube minimum bitrate
1080p at 30 fps 5 Mbps 4 Mbps
720p at 60 fps 8 Mbps 3 Mbps

Measure sustained upload capacity from the server and leave headroom for normal variation. Select a stable bitrate below what the connection can reliably carry, then test with content whose motion and audio resemble the real stream. A speed-test peak is not a guarantee of continuous upload capacity.

Set audio and keyframes deliberately

For stereo audio, YouTube’s guidance recommends 44.1 kHz sampling and a 128 kbps audio bitrate. Use a constant video bitrate, set keyframes every 2 seconds, and keep the interval at or below 4 seconds. Check that the selected audio encoder is available in your installed FFmpeg build.

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

Do not mix RTMPS and HLS settings

YouTube also supports HLS ingest for certain cases, including HDR or codecs not supported through RTMP. HLS uses HTTPS and segmented output, has higher latency, and has separate playlist and segment requirements. It is not interchangeable with an RTMPS output URL or command. Use the distinct YouTube HLS setup guidance if your use case calls for HLS; otherwise, keep the configuration on RTMPS.

Keep FFmpeg running with systemd

A process supervisor can start FFmpeg at boot and restart it after a process failure. Use a dedicated, unprivileged account where practical, and do not enable automatic startup until the source, key handling, output and logs have been tested. Ubuntu’s systemd guidance explains service management; consult the systemd documentation for the unit syntax supported by your Ubuntu release.

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.

Create a unit for your own command and paths rather than copying an unverified generic example. The service should run FFmpeg in the foreground, use the intended working directory and configuration, and have a deliberate restart policy. Keep the stream key in a protected configuration mechanism rather than exposing it in a broadly readable unit file. A community operations example illustrates the general pattern of looping media under service supervision, but it is not a guarantee that any particular command will work on your host.

  1. Test the FFmpeg command interactively with the real input and check that YouTube receives audio and video.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Install and review the service unit, then start it with sudo systemctl start your-stream.service.

  3. Check process and service state with systemctl status your-stream.service. Enable startup on boot only after the test succeeds: sudo systemctl enable your-stream.service.

  4. Read service output with journalctl -u your-stream.service. After confirming the service recovers as intended, test a controlled restart and verify the stream again in Live Control Room.

    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

Replace your-stream.service with the actual unit name. A systemd service showing “active” only reports process state; it does not prove YouTube is receiving healthy video and audio.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test stream health and diagnose interruptions

Before relying on a long-running broadcast, test the actual source and watch the preview and stream-health messages in YouTube Live Control Room. YouTube specifically recommends testing and monitoring stream health. Check both the server and YouTube: host-level status, logs, source availability, audio/video preview and ingest health each reveal different failure points.

  • FFmpeg is missing after installation: check the command output and package manager errors, then confirm the executable with ffmpeg -version. The packaged version depends on the Ubuntu release and repository configuration.

  • The service exits immediately: inspect systemctl status your-stream.service and journalctl -u your-stream.service. Check the executable path, working directory, permissions, input path and whether the same command succeeds interactively.

  • YouTube does not receive a signal: verify the ingest URL and stream key in Live Control Room, confirm the server can reach the ingest endpoint, and check that FFmpeg is using the intended protocol and output settings.

    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.
    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.
  • Video or audio is unhealthy: compare codec, bitrate, frame rate, keyframe interval and audio settings with YouTube’s current guidance. Confirm the source actually contains the expected tracks and that the encoder is not exceeding sustained upload capacity.

  • The stream stops when a video ends: the input is not repeating or the playlist has run out. Correct the source loop or playlist behavior, then test through a complete cycle before enabling the service at boot.

  • The service restarts but the stream remains broken: a restart policy can recover a failed process, not a missing source, invalid key, unavailable network or incompatible encoding. Fix the underlying cause and confirm a healthy YouTube preview.

What “continuous” can and cannot mean

Systemd can relaunch a failed process and start an enabled service when the host boots. Neither action guarantees end-to-end uptime. Continuity also depends on server power and availability, network upload, source media, credentials, encoder configuration and YouTube ingest. A system service marked active is not a substitute for checking that YouTube is receiving healthy audio and video.

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

Or let it run in the cloud

If you do not want an Ubuntu server and FFmpeg process to be your responsibility, StreamNeo keeps an uploaded video or playlist live on YouTube from the cloud. Upload your recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay running at home; it plays uploaded videos, not a live camera feed. Every slot supports the uploaded quality up to 4K 60fps at one flat price per slot, includes automatic recovery if YouTube drops the stream, and the first day is free with no card. Monthly pricing is $9.99 per month. UPI and cards are accepted in India; card checkout is available worldwide. Start the free first day with StreamNeo.

Copyright and YouTube channel rules

Having the technical ability to loop a video does not establish that you have permission to broadcast it or that it complies with YouTube’s channel policies. Use material you own or are authorized to stream, and review YouTube’s current live-stream and copyright requirements before broadcasting. Repeated or reused material can also affect channel eligibility and monetization; technical continuity is separate from policy compliance.

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 Screening Room

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.