October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
FFmpeg

How to Install FFmpeg on Ubuntu for YouTube Live Streaming

Install Ubuntu’s FFmpeg package, retrieve your YouTube stream URL and key, and prepare, test, and troubleshoot an FFmpeg live stream.

By DocumentaryTube Team 6 min read

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.

Install Ubuntu’s FFmpeg package with APT, then connect FFmpeg to the server URL and stream key shown in YouTube Live Control Room. Installation alone does not configure or start a YouTube stream: you must choose compatible encoding settings, test the connection, and start the stream in YouTube when prompted.

Install FFmpeg from Ubuntu’s repositories

FFmpeg is available as the ffmpeg package in Ubuntu’s repositories. First identify your Ubuntu release, because the packaged FFmpeg version differs between releases. For example, Ubuntu’s package index listed FFmpeg 4.4.2 for Ubuntu 22.04 LTS (Jammy) and 6.1.1 for Ubuntu 24.04 LTS (Noble) in records reviewed in 2026; those figures do not establish the version available on every release or derivative.

  1. Check your release with lsb_release -a. If that command is unavailable, inspect /etc/os-release.

  2. Refresh APT’s local package index: sudo apt update.

    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.
  3. Install FFmpeg: sudo apt install ffmpeg.

  4. Check that the executable is available and inspect its build information: ffmpeg -version.

This is Ubuntu’s repository-based installation route; the commands are not a claim that a particular installation was run or tested. If APT says it cannot locate the package, check that the release’s repositories are configured and that the Universe component is enabled. Check the package record for your specific release before turning to a PPA or third-party binary.

For release-specific package information, see Ubuntu’s package index and Ubuntu’s APT guidance.

Get the YouTube stream URL and key

  1. In YouTube Studio, create or select the live stream in Live Control Room. The exact interface flow can differ depending on whether the channel has streamed before.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Copy the server URL and stream key displayed for the stream. Prefer the RTMPS server URL if YouTube provides it; YouTube describes RTMPS as RTMP encrypted with TLS/SSL. Do not assume a fixed endpoint—use the URL shown in your Live Control Room.

    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.
  3. Keep the stream key private. It is a credential that authorizes sending a feed to your stream. Do not publish it in a tutorial, paste it into public logs, or share a command containing the real value.

YouTube’s live encoder settings explain the encoder workflow and settings. Its RTMPS guidance describes the encrypted protocol.

Prepare a file or other video source

Stream a prerecorded file

For a file, FFmpeg’s -re option reads the input at its native rate rather than sending it as fast as the machine can process it. The Ubuntu FFmpeg manual gives this generic RTMP example:

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

ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream

This illustrates sending FLV to a generic RTMP server. It is not a YouTube-specific or verified RTMPS command. To use FFmpeg with YouTube, substitute the current server URL and stream key from Live Control Room using the syntax supported by your installed FFmpeg build. The manpage example does not establish the exact key syntax for your endpoint or build, so check FFmpeg’s documentation and test your command without exposing the key.

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.

Use a camera or capture device

FFmpeg can encode sources beyond files, but the input options depend on the device and its drivers. Identify the input device and confirm FFmpeg can read it before connecting to YouTube. A capture card is only relevant if your source is an external HDMI device; it is not required to stream a file.

Ubuntu’s FFmpeg manual documents the generic RTMP form. It should not be read as an end-to-end YouTube setup recipe.

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

Choose YouTube live encoding settings

YouTube’s live-stream recommendations are distinct from its recommendations for uploading finished videos. Use the live encoder guidance for a live ingest, and confirm the current values for your chosen codec and format before a broadcast.

Setting YouTube live guidance accessed in 2026
Video codec H.264, H.265 (HEVC), or AV1 are listed; codec availability also depends on the ingest protocol and your FFmpeg build.
H.264, 1080p at 30 fps 10 Mbps recommended.
H.264, 1080p at 60 fps 12 Mbps recommended.
Rate control Constant bitrate (CBR) recommended.
Keyframe interval 2 seconds recommended; do not exceed 4 seconds.
Audio for RTMP/RTMPS AAC or MP3 are listed; stereo audio at 128 Kbps and 44.1 kHz is recommended.
Frame rate Up to 60 fps is listed.

These are YouTube’s published recommendations, not a guarantee that your computer can encode at that setting or your internet connection can sustain the upload. Match resolution, frame rate, codec, and bitrate to your source, installed FFmpeg build, and reliable upload capacity. When in doubt, test a lower, stable setting rather than risking an interrupted stream.

Test the stream before broadcasting

  1. Start FFmpeg with your chosen input, encoding settings, YouTube server URL, and protected stream key.

    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
  2. Wait for the stream preview in Live Control Room. Confirm that picture and audio arrive as expected before making the stream public or starting the scheduled broadcast.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Test representative motion and audio, not just a static frame or silent opening. YouTube advises: “Make sure to test before you start your live stream.”

  4. During the event, monitor YouTube’s stream health and the encoder’s output for connection or encoding errors.

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

Copyright and channel-policy checks

Having a working encoder does not give you rights to the material you broadcast. Before streaming a film, documentary, soundtrack, or other recording, make sure you have permission to use every relevant component, including music and clips. YouTube may identify or restrict material through its copyright processes. Separately, monetization eligibility and channel policies are not guaranteed by using FFmpeg; a technical live stream does not by itself establish that reused material qualifies for monetization.

Review YouTube’s current live streaming guidance and applicable copyright and monetization policies for your channel before scheduling a stream.

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.

Troubleshooting common setup failures

  • APT cannot find ffmpeg: verify the Ubuntu release, run sudo apt update, and check that the appropriate repositories—including Universe where applicable—are enabled. Confirm package availability for that release.

  • ffmpeg: command not found after installation: confirm the install completed successfully and inspect the error from APT. Run ffmpeg -version to verify the executable is available in your shell.

  • YouTube does not receive a feed: re-copy the current server URL and key from the correct Live Control Room stream. Check for accidental whitespace, use the RTMPS URL when available, and keep the key out of public output.

  • The connection starts but YouTube reports poor stream health: compare the configured codec, resolution, frame rate, bitrate, and keyframe interval with YouTube’s live guidance. Reduce the bitrate or format demands if the connection cannot sustain the upload reliably.

    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.
  • Preview appears but the broadcast does not go live: check whether Live Control Room is waiting for you to confirm or start the scheduled stream after the encoder feed arrives.

  • Video arrives without usable sound: check the selected audio input and codec, and confirm that the outgoing stream includes audio at a supported setting.

  • FFmpeg rejects an option or codec: inspect ffmpeg -version and the build’s supported encoders. A command or codec option from another system may not be available in your Ubuntu package build.

Or let it run in the cloud

If the goal is to keep uploaded videos looping as a 24/7 YouTube stream, StreamNeo is an alternative to running FFmpeg on a computer you must keep online. Upload a recording or build a playlist, add your YouTube stream key once, and go live; StreamNeo loops the uploaded video from the cloud. Nothing has to stay on at home. Every quality up to 4K 60fps is streamed as uploaded for one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card. Monthly: $9.99 per month. StreamNeo is YouTube-only and plays uploaded videos; it does not broadcast a camera feed. See StreamNeo or start the free first 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 *

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.