Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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
Mountain View desk6 min

How to Install FFmpeg on Ubuntu for a 24/7 YouTube Playlist Stream

A step-by-step Ubuntu guide to installing FFmpeg, looping local videos, and sending a playlist to YouTube Live safely.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install FFmpeg with Ubuntu’s APT package manager, create a playlist file, and use FFmpeg’s concat demuxer with -stream_loop -1 to repeat it. Send the output to the RTMPS URL and stream key shown in YouTube Live Control Room. For a stream to stay online around the clock, the Ubuntu machine must remain powered on and connected; looping a process alone does not guarantee recovery or uninterrupted service.

What you need before you start

  • An Ubuntu computer or server that can stay powered on and connected for as long as you want to stream.
  • Local video files you have the right to stream, plus a playlist text file listing them.
  • A YouTube channel with live streaming available and access to Live Control Room.
  • Enough sustained upload capacity for the video bitrate, with headroom for network variation.

FFmpeg package versions depend on your Ubuntu release and enabled repositories. The commands below use Ubuntu’s standard package manager rather than assuming a particular FFmpeg version.

As an Amazon Associate I earn from qualifying purchases.

Install and verify FFmpeg

  1. Open a terminal and refresh APT’s package information:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    sudo apt update
  2. Install FFmpeg:

    sudo apt install ffmpeg
  3. Check that it is available and note the installed build version:

    #1 Best Overall
    Sale
    Lexar D40E 128GB Dual USB 3.2 Gen 1 Type-C Jump Drive, Champagne Silver | USB-C Flash, Metal Housing, Swivel Design, Thumb Drive
    • USB-C 2-in-1 storage OTG: The Lexar JumpDrive Dual Drive D40E features USB Type-A and Type-C connectors in a slim, portable form factor for easy device compatibility
    • Transfer speeds up to 100MB/s: Based on internal testing, performance may vary depending upon the host device, interface, and usage conditions. 1MB=1,000,000 bytes
    • Plug and Play: Widely compatible with USB Type-C smartphones, tablets, laptops, Macs, and traditional Type-A devices, no software installation required. The 360° swivel design allows for easy switching between connectors without the hassle of losing a cap
    • Durable & Compact: The Lexar D40E USB memory stick features a metal enclosure, withstands temperatures from 0° to 50° C (32°F to 122°F), and is lightweight at 26g with dimensions of 70.4 x 16.9 x 11.7mm
    • Security & Warranty: Securely protects files using an advanced security software solution with 256-bit AES encryption. Backed by a Lexar 3-year limited warranty
    ffmpeg -version

If APT cannot find the package, check that your Ubuntu release’s repositories are enabled and that sudo apt update completed without errors. Package availability and versions vary by release.

Make a playlist file

FFmpeg’s concat demuxer reads a text file containing media file paths, then processes the listed files in order. Create a file such as playlist.txt in the directory where you will run FFmpeg:

file '/absolute/path/to/video-one.mp4'
file '/absolute/path/to/video-two.mp4'
file '/absolute/path/to/video-three.mp4'

Use one file line for each video, in the order you want them played. Absolute paths avoid ambiguity about the working directory. If a path contains a single quote, escape it according to FFmpeg’s concat-demuxer syntax; do not assume arbitrary filenames can be copied into the example unchanged.

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

Choose stream copy or re-encoding

Use stream copy only for compatible files

With -c copy, FFmpeg passes the existing audio and video streams through without re-encoding. This is suitable only when the files’ stream properties are compatible for concatenation. Files that merely share an MP4 extension may still differ in codecs, resolution, frame rate, time base, or audio layout. Do not assume the joins will be seamless.

Rank #2
SANDISK 128GB Ultra Flair, USB-A Flash Drive, Up to 150MB/s Read Speeds | USB Flash Drive, Up to 15x Faster than standard 2.0, Password Protection, Durable, Sleek Metal Casing, USB 3.0, Silver/Black
  • High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard USB 2.0 drives (4MB/s); varies by drive capacity. Up to 150MB/s read speed. USB 3.0 port required. Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors; 1MB=1,000,000 bytes]
  • Transfer a full-length movie in less than 30 seconds(2) [(2) Based on 1.2GB MPEG-4 video transfer with USB 3.0 host device. Results may vary based on host device, file attributes and other factors]
  • Transfer to drive up to 15 times faster than standard USB 2.0 drives(1)
  • Sleek, durable metal casing
  • Easy-to-use password protection for your private files(3) [(3)Password protection uses 128-bit AES encryption and is supported by Windows 7, Windows 8, Windows 10, and Mac OS X v10.9 plus; Software download required for Mac, visit the SanDisk SecureAccess support page]

Re-encode mixed sources to a consistent output

If the playlist contains mismatched files, re-encoding to one consistent video and audio format is the safer approach. It uses more processing capacity than stream copy. The example below encodes H.264 video and AAC audio; select a resolution, frame rate, and bitrate that suit your source material and available upload capacity.

Set up YouTube Live ingest

  1. Open YouTube Live Control Room and create or select the live stream you intend to use.

  2. Copy the stream URL and stream key shown there. Prefer the RTMPS URL; YouTube’s interface may show an RTMP URL by default and provide an option to reveal RTMPS.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Keep the key private. YouTube describes stream keys as like the stream’s password and address. Do not publish it in screenshots, public scripts, or source control. If it is exposed, reset it in Live Control Room.

    Rank #3
    Sale
    2 Pack 64GB USB Flash Drive USB 2.0 Thumb Drives Jump Drive Fold Storage Memory Stick Swivel Design - Black
    • What You Get - 2 pack 64GB genuine USB 2.0 flash drives, 12-month warranty and lifetime friendly customer service
    • Great for All Ages and Purposes – the thumb drives are suitable for storing digital data for school, business or daily usage. Apply to data storage of music, photos, movies and other files
    • Easy to Use - Plug and play USB memory stick, no need to install any software. Support Windows 7 / 8 / 10 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, compatible with USB 2.0 and 1.1 ports
    • Convenient Design - 360°metal swivel cap with matt surface and ring designed zip drive can protect USB connector, avoid to leave your fingerprint and easily attach to your key chain to avoid from losing and for easy carrying
    • Brand Yourself - Brand the flash drive with your company's name and provide company's overview, policies, etc. to the newly joined employees or your customers

The exact ingest URL is supplied by YouTube, so use the URL shown for your stream instead of relying on a hard-coded endpoint.

Match YouTube’s encoder settings

YouTube’s live encoder guidance consulted on October 3, 2026 recommends RTMP/RTMPS ingest, CBR encoding, a keyframe interval of about two seconds (not over four), and H.264, H.265 (HEVC), or AV1 video with AAC or MP3 audio. For stereo audio it recommends 128 Kbps. Check the current Live Control Room settings and YouTube guidance before publishing, because platform recommendations can change.

Output example YouTube H.264 bitrate guidance
720p at 30 fps 3 Mbps minimum; 8 Mbps recommended
1080p at 30 fps 5 Mbps minimum; 14 Mbps recommended

These are YouTube’s recommendations consulted on October 3, 2026, not independent measurements. Leave upload headroom above the chosen stream bitrate and test the actual connection; YouTube advises running a speed test to check upload bitrate.

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

Start the looping playlist stream

Save the following as a private shell script on the Ubuntu machine, or run it from a terminal. Replace the playlist path and output URL with your own values. Enter the key locally where prompted; do not replace the placeholder with a real key in a file you will share or commit.

Rank #4
Sale
SIMMAX 32GB Memory Stick USB 2.0 Flash Drives Swivel Thumb Drive Pen Drive (32GB Purple)
  • GOOD VALUE PACKAGE - 1 Pack 32GB Memory Stick USB 2.0 Flash Drives with great cost performance and high quality.
  • BIG CAPACITY - The available capacity: 29.10GB-29.8GB, You can save the data of movies, music, photos, designs, programs, manuals, handouts in a high speed.Good performance in digital data storing, transferring and sharing with families, friends, workmates, clients and machines.
  • EASY TO USE & PLUG AND WORK - Support windows 7 / 8 / 10 / Vista / XP / 2000 / ME / NT Linux and Mac OS, Compatible with USB2.0 and below.
  • TWISTTURN DESIGN & EASY CARRY - The metal clip rotates 360° round the ABS plastic body which with rubber oil skin feeling finish. The capless design can avoid lossing of cap, and providing efficient protection to the USB port.
  • WARRANTY & SUPPORT - SIMMAX logo is laser printed on the USB connector surface, our products are of good quality and we promise that any problem about the product within one year since you buy.
read -rsp 'YouTube stream key: ' STREAM_KEY
printf 'n'

ffmpeg -re -stream_loop -1 
  -f concat -safe 0 -i /absolute/path/to/playlist.txt 
  -c:v libx264 -preset veryfast -b:v 8M -maxrate 8M -bufsize 16M 
  -pix_fmt yuv420p -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "rtmps://YOUR_YOUTUBE_INGEST_URL/YOUR_STREAM_PATH/$STREAM_KEY"
unset STREAM_KEY

Replace the URL template with the RTMPS URL YouTube displays, appending the key in the format required by that URL. Do not publish the resulting command or terminal output if it contains the key. The example’s video settings are for a 30 fps H.264 output: -g 60 and -keyint_min 60 set a 60-frame GOP, approximately two seconds at 30 fps. The 8 Mbps video setting corresponds to YouTube’s 720p30 recommended H.264 bitrate; it does not force the source to 720p, so set output scaling and encoding parameters deliberately if your media needs conversion to that resolution. For 1080p30, use a bitrate in line with YouTube’s 14 Mbps recommendation and confirm your connection can sustain it.

Here -stream_loop -1 is an input option, so it appears before the playlist’s -i. -re reads the files at their native rate rather than sending them as fast as possible. Output encoding options follow the input and precede the destination. The -f flv output format is used for RTMP/RTMPS ingest.

This command is an example configuration, not a guarantee that every source will encode or concatenate correctly. If you use stream copy instead, remove the encoding and filtering options and use -c copy only after confirming the playlist files have compatible streams. If FFmpeg reports concat or timestamp errors, standardize the inputs or re-encode them consistently.

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

Keep a 24/7 stream operational

FFmpeg will stop if the process exits, the machine shuts down, the network fails, or YouTube ends the ingest. Monitor FFmpeg’s output and YouTube’s stream health, and test both audio and moving video before relying on the broadcast. A loop is not a supervisor: if automatic restart or recovery is needed, configure and verify a process manager separately. No single FFmpeg command establishes 24/7 uptime.

Best Value
IMEASON Swivel Design 16GB USB Flash Drive with Keychain, USB 2.0 Portable Thumb Drive Memory Stick, FAT32 Format Flashdrive for Data Storage, Photos, Music, Files (Black, 16 GB)
  • 【16GB Flash Drive】USB flash drives with 16GB capacity, meet your needs of daily use on work, school, home and travelling for photos, music, videos, files storage and transfer. IMEASON thumb drives can be used to store different files, easy to data backup.
  • 【Metal Swivel Cap Design】USB thumb drive is metal swivel cover provides extra protection for the usb thumbdrive connector, no usb drive cap to lose; keychain design makes it easier to carry without worrying lose it.
  • 【Wide Compatibility】USB drive supports Windows 7/8/10/11 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, also Supports USB 2.0 and 1.1 ports. USB Stick support TV, desktop, notebook computer, car, audio and other device. The USB Memory Stick is your great data storage and transfer companion with traveling and working.
  • 【Easy to use】usb memory stick is plug and play without any software installation. Just simply plug the Flashdrive into the port of your USB-compatible devices such as computer, laptop to start data storage or transmission.
  • 【What You Get】16 GB USB Flash Drive Thumb Drive, The default format of the usb storage flash drive is FAT32.

For an always-on host, compare sustained outbound bandwidth, the host’s policy for continuous RTMPS traffic, CPU capacity if re-encoding, reliability, and total cost. A VPS or other hosted machine is optional; it does not remove the need to monitor the stream.

Plan for YouTube archives separately

YouTube says streams under 12 hours are automatically archived. That guidance does not promise that one continuous 24-hour broadcast will be archived in full. If replay retention matters, plan shorter sessions and confirm the current archive behavior in YouTube’s settings rather than treating a 24/7 transmission as a guaranteed full-length recording.

Common problems and fixes

  • “ffmpeg: command not found”: confirm sudo apt install ffmpeg completed, then run ffmpeg -version again.
  • Concat file or path errors: verify the playlist path passed after -i, ensure every listed media path exists and is readable, and check quoting for spaces or special characters.
  • Concat errors, glitches, or unexpected joins: confirm the files have compatible streams; re-encode mixed sources to consistent audio and video settings rather than assuming stream copy can join them cleanly.
  • YouTube reports unstable ingest or dropped frames: test sustained upload speed, reduce the output bitrate or resolution if necessary, and compare the actual encoder settings with YouTube’s current recommendations.
  • Connection rejected or no stream appears: check that you copied the correct stream URL and current key from Live Control Room, that the stream is ready to receive an encoder, and that you have not exposed or mistyped the key.
  • FFmpeg exits and the broadcast stops: inspect the terminal output for the underlying error. A plain FFmpeg process does not restart itself; use a separately configured supervisor or restart it manually, then monitor YouTube’s stream health.

Or let it run in the cloud

StreamNeo is a cloud service for keeping an uploaded-video YouTube stream live without leaving a home computer on. Upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay powered on at home; the uploaded video streams at its original quality 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 pricing is $9.99 per month. See StreamNeo for details, or start the free 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 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
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.