Skip to content
streamneo.
Setup Guides11 min read

How to Install FFmpeg on Ubuntu for YouTube Live Streaming

Install Ubuntu’s FFmpeg package, check your version and encoders, then match a separate YouTube Live setup to current guidance.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

Installing FFmpeg on Ubuntu is a package-management task; sending a video to YouTube Live is a separate configuration task. Use Ubuntu’s APT repositories, check which version and encoders your release provides, then configure an encoder with the live ingest details shown in YouTube Studio.

The commands below describe the normal repository workflow, not a test performed for this article. Package versions vary by Ubuntu release, and no generic RTMP example should be mistaken for a complete YouTube command.

Check your Ubuntu release and package version

Start by identifying the Ubuntu release on the machine where you plan to install FFmpeg. The package available for Ubuntu 22.04 LTS may differ from the package available for Ubuntu 24.04 LTS, and later updates can change the exact package revision. Checking the release first helps you compare like with like if you are following instructions written for another version of Ubuntu.

You can inspect release information with either of these commands:

lsb_release -a
cat /etc/os-release

The first command is commonly available on Ubuntu desktop and server installations. The second reads the operating system’s release metadata and is useful when lsb_release is not installed. These commands only identify the operating system; they do not install FFmpeg or establish whether the repository is configured correctly.

Ubuntu’s package index records FFmpeg 4.4.2 for Jammy, Ubuntu 22.04 LTS, and 6.1.1 for Noble, Ubuntu 24.04 LTS, in the package records reviewed in October 2026. Those are release-specific records, not a promise that every machine on either release will show precisely those strings: repository updates and package revisions matter. If an exact version is important to a workflow, check the package record for your release and the version APT offers on your own machine.

For an always-on channel, an older package is not automatically a problem and a newer package is not automatically the answer. What matters is whether the available build has the codecs and protocol support you need, whether it behaves reliably with your input, and whether you can maintain the operating system. If you are following instructions for a different release or a VPS image, note that difference before copying commands.

Refresh APT package lists

Ubuntu’s usual route for installing packaged software is APT. Before installing FFmpeg, refresh the local package index so APT can see the package metadata available from the repositories configured on that system:

sudo apt update

apt update refreshes package information; it does not upgrade every installed application. The command may request your account password because sudo runs the package-management operation with administrative privileges. Read any repository or signature warnings rather than treating a completed prompt as proof that all sources were reached successfully.

If the update reports repository errors, resolve those before installing. A stale or incomplete package index can make APT fail to locate software or offer an older version than expected. Ubuntu’s APT documentation explains the package-management workflow; consult it alongside the release-specific package listing if the output differs from what you expect.

Install FFmpeg from Ubuntu packages

Once the package lists are refreshed, request the FFmpeg package:

sudo apt install ffmpeg

APT will show the packages it intends to install and ask you to confirm. Review that summary, especially if you are on a small server with limited disk space or are managing a production machine with a change-control process. This is the distribution-package approach: it gives you software managed through Ubuntu’s configured repositories rather than an arbitrary download from an unknown site.

FFmpeg is listed in Ubuntu’s Universe repository. If APT says it cannot locate the package, check the release, network access and enabled repository components before turning to an outside package archive. The relevant component may not be enabled in a particular installation. Verify the instructions for your release rather than assuming a fix that applies to another Ubuntu edition.

The package route is convenient because future package maintenance follows the normal Ubuntu process. Its trade-off is that you receive the build selected for your Ubuntu release, not necessarily the newest upstream FFmpeg release. For most users trying to send a file as a YouTube encoder feed, it is sensible to begin with the supported package and only investigate another build when a specific missing feature or version requirement is established.

Installing the command-line tool does not create a YouTube broadcast, choose a stream key, or keep a process alive if the computer shuts down. If the actual goal is a pre-recorded loop, first separate the media workflow from the encoder setup; this guide to adding a pre-recorded video in YouTube Studio covers a different route through Studio.

Verify FFmpeg and available encoders

After installation, inspect the executable and its build information:

ffmpeg -version

The output identifies the FFmpeg version and includes build configuration details. It is a useful check that the shell can find FFmpeg, but it does not prove that an input file can be decoded, that a particular encoder is present, or that YouTube will accept a feed from the machine. Treat version verification and a real stream test as distinct steps.

To view the encoders reported by this build, use:

ffmpeg -encoders

The output is long. Search it for the encoder you intend to use, such as libx264 for H.264 encoding, and distinguish video encoders from audio encoders. An encoder appearing in this list means the build reports it; it does not establish that your CPU can encode your chosen resolution and frame rate smoothly for hours. A software encoder may use substantial processor capacity, while an available hardware encoder depends on compatible hardware and driver support.

The codec options you can choose depend on both FFmpeg’s build and YouTube’s ingest guidance. Do not copy a command written for a different build and assume the named encoder exists locally. If you are making a simple loop, a modest frame rate can be adequate; the comparison of 30 fps and 60 fps for a continuous loop explains why higher frame rate is not always useful.

For a non-technical operator, the practical verification is layered: confirm the version, confirm the named encoder, play the source file locally, then run a short private or scheduled test and inspect YouTube’s preview and stream health. An encoder listing is not a substitute for testing the actual source, audio, network connection and destination together.

Get YouTube Live ingest details

The stream destination is not something to guess from an example found online. In YouTube Studio, create or select the live stream and open the Live Control Room. Copy the stream server URL and stream key displayed for that stream. The interface can vary depending on the channel’s history and whether the event is scheduled, so use the values in your own control room rather than a hard-coded address.

YouTube’s live streaming setup guidance describes configuring an encoder with these details, starting the encoder, waiting for the preview and then proceeding with the live event as appropriate. The video may be visible to YouTube before the event is actually public. Check the selected privacy and scheduling settings before sending a feed if you do not want to publish immediately.

Treat the stream key as a password. Do not post it in a public command, screenshot, support forum or shared document. Avoid leaving it in shell history where other users of the account could retrieve it. If you think it has been exposed, use YouTube Studio’s controls to replace or reset it, then update the encoder configuration.

YouTube recommends RTMPS, which protects the connection with TLS/SSL, and its control room may show an ordinary RTMP URL by default. Where your intended FFmpeg build and workflow support RTMPS, use the RTMPS destination shown by YouTube. Do not assume that every Ubuntu package build supports every transport combination: verify capabilities and use the destination actually supplied for your stream. YouTube’s RTMPS explanation describes the encrypted protocol and its role in live ingest.

If you need a guide to keeping a process alive on your own machine, that is another operational question rather than an installation step. The automatic restart guide for an FFmpeg YouTube stream on a VPS discusses recovery concerns; the right approach depends on where the encoder runs and who will monitor it.

Match output settings to YouTube guidance

Choose encoding settings from YouTube’s live encoder guidance, not from its video-upload recommendations. The live settings page covers protocol, codecs, bitrate, constant bitrate encoding and keyframes. Requirements and recommendations depend on codec, resolution and frame rate, so select a target format first and then match its guidance rather than assembling values from unrelated examples.

For H.264, YouTube’s live encoder guidance accessed in 2026 recommends 10 Mbps for 1080p at 30 fps and 12 Mbps for 1080p at 60 fps. It recommends a two-second keyframe interval and says not to exceed four seconds. For stereo audio, it recommends 128 Kbps and a 44.1 kHz sample rate. These are YouTube’s published recommendations, not guarantees that a particular broadband connection or computer can sustain them continuously.

Choice or setting YouTube live guidance What to check on your setup
H.264, 1080p at 30 fps 10 Mbps recommended, YouTube guidance accessed 2026 Sustained upload capacity and whether the picture needs 30 fps
H.264, 1080p at 60 fps 12 Mbps recommended, YouTube guidance accessed 2026 Encoder capacity and whether smoother motion matters for the source
Keyframe interval 2 seconds recommended; no more than 4 seconds Encoder setting and consistency over a test
Stereo audio 128 Kbps and 44.1 kHz recommended Audio source, channel layout and avoiding clipping or silence

The table is a starting point for comparison, not a preset that suits every stream. A still devotional image with audio, a moving camera feed and a news loop have different visual demands. If your connection cannot reliably sustain a target bitrate, lower the resolution or frame rate and test rather than choosing a nominally high-quality setting that repeatedly drops frames. Leave headroom for ordinary variation in household or office internet use.

YouTube’s live encoder page lists H.264, H.265 (HEVC) and AV1 as video codecs, with AAC or MP3 audio for RTMP/RTMPS, and supports frame rates up to 60 fps. Check the page for the current guidance and the exact ingest path you intend to use. A codec being listed by YouTube does not mean the installed FFmpeg build can encode it, or that every codec is available over every protocol. Choose a combination supported on both sides.

A useful test contains the sort of motion and sound viewers will actually receive. A static colour card does not reveal whether a music loop has clipping or whether a moving news ticker looks acceptable. YouTube advises users to test before starting the live stream and monitor stream health. A short test helps reveal an unstable upload, incorrect audio mapping or a mismatched keyframe setting while there is still time to change it.

Understand what a general RTMP example leaves out

The FFmpeg manual illustrates a generic real-time file feed in this form:

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

This is a general RTMP example from the FFmpeg manual, not an end-to-end YouTube command. The hostname and path are placeholders for a generic RTMP server, and it does not supply YouTube’s current stream URL, key, codec choices, bitrate, audio options or event settings. It also does not validate RTMPS support. Replacing the placeholder mechanically is not enough to make a dependable YouTube setup.

In an actual encoder configuration, the destination must use the server URL and stream key from the Live Control Room, and the output options must match the source, chosen codec and current YouTube guidance. Keep the key private when composing or sharing commands. If command-line arguments containing a key are visible to other users on the machine or copied into logs, use a safer credential-handling approach appropriate to your environment.

The distinction matters because an example can successfully explain FFmpeg’s general input/output pattern without proving that it is accepted by YouTube. Likewise, installing FFmpeg can succeed while the encoder still fails because the input file is unreadable, the selected encoder is missing, the upload cannot sustain the bitrate or the ingest details are wrong. Diagnose those as separate layers instead of reinstalling the package after every stream error.

For a source file, check that it plays through the full section you expect to broadcast, including audio. For a camera or capture device, identify the input format separately; this installation guide does not provide a universal device command. A restart policy, file looping and unattended recovery also need explicit decisions if you are aiming for a channel that runs through the night. They are not provided simply by adding ffmpeg to Ubuntu.

A local machine must remain powered, connected and available for the encoder process to continue. If that operational burden is the problem rather than the package installation, StreamNeo removes the need to leave your own computer running by turning an uploaded video into a monitored YouTube broadcast that can restart if it drops.

Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.

FAQ

How do I install FFmpeg on Ubuntu?

Refresh APT’s package index with sudo apt update, install the distribution package with sudo apt install ffmpeg, then inspect it with ffmpeg -version. Check your Ubuntu release first because the available package version varies by release.

How do I stream to YouTube with FFmpeg?

Installation alone does not configure a stream. Get the ingest URL and key from YouTube Live Control Room, choose output settings from YouTube’s live encoder guidance, and test the complete feed in the control room before going live. A generic RTMP example is not a complete YouTube command.

What bitrate should I use for 1080p live streaming?

For H.264, YouTube’s live encoder guidance accessed in 2026 recommends 10 Mbps at 1080p30 and 12 Mbps at 1080p60. Your sustained upload and encoder capacity still matter, so test and reduce the target if the feed is unstable.

Does FFmpeg support RTMPS?

Support depends on the FFmpeg build and configuration you have installed, so do not assume every Ubuntu package build handles every RTMPS workflow. Check your build and use the RTMPS URL from YouTube Live Control Room where supported; YouTube recommends RTMPS for its encrypted connection.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Setup Guides guides ↗ · All topics ↗