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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
DocumentaryTube
Admit one · Blog

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

Set up FFmpeg on Ubuntu to loop local videos into a YouTube live stream, with playlist commands, encoder settings, security guidance, and troubleshooting.
Opened Runtime7 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install FFmpeg with Ubuntu’s package manager, create a text playlist of your video files, and use FFmpeg’s concat demuxer with -stream_loop -1 to repeat it. Send the output to the RTMPS URL and stream key from YouTube Live Control Room. The process can keep transmitting while FFmpeg runs, but it does not by itself provide automatic recovery or guarantee that one continuous 24/7 broadcast will be archived in full.

1. Install FFmpeg and check that it works

On Ubuntu, install FFmpeg from the distribution’s package repositories. The package version depends on your Ubuntu release and enabled repositories, so check the version actually installed rather than assuming a particular build.

  1. Open a terminal on the Ubuntu machine that will run the stream.
  2. Refresh the package index: sudo apt update.
  3. Install FFmpeg: sudo apt install ffmpeg.
  4. Verify the installation: ffmpeg -version. The output should identify FFmpeg and its build version.

If APT cannot find the package, check that the system’s Ubuntu repositories are enabled and that the package index updated successfully. Ubuntu’s FFmpeg documentation is release-specific; the cited protocol manual is for Ubuntu 24.04 (Noble), not a guarantee of the package version on every release.

2. Prepare a playlist file

The concat demuxer reads a text file containing media paths in playback order. In the directory containing your videos, create a file named playlist.txt with one entry per line:

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.
#1 Best Overall
Lexar D40E 128GB Dual USB 3.2 Gen 1 Type-C Jump Drive, Champagne Silver
  • 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
file 'video-01.mp4'
file 'video-02.mp4'
file 'video-03.mp4'

Use paths that the FFmpeg process can access. Relative paths are resolved from the working directory where FFmpeg runs; use absolute paths if the process may start from another directory. If a path contains a single quote, account for that in the concat file syntax rather than copying the simple example unchanged.

FFmpeg plays the listed files in sequence. A playlist does not guarantee seamless transitions: differing codecs, resolutions, frame rates, time bases, or audio layouts can cause concat or stream-copy problems. For compatible files, copying streams avoids re-encoding. For mixed assets, re-encode to a consistent output format instead.

3. Get YouTube’s ingest URL and stream key

  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 for that stream. YouTube may show the ordinary RTMP URL by default; use its interface to reveal the RTMPS URL when available, and prefer RTMPS for encrypted transport.
  3. Keep the key private. YouTube describes stream keys as equivalent to a password and address. Do not put a real key in a public script, screenshot, shared terminal recording, or source-control repository.

The examples below use placeholders. Replace YOUR_YOUTUBE_RTMPS_URL and YOUR_STREAM_KEY locally with the values from Live Control Room. If a key is exposed, reset it in the live-stream settings before continuing.

Rank #2
SANDISK 128GB Ultra Flair, USB-A Flash Drive, Up to 150MB/s Read Speeds
  • 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]

4. Choose encoding settings for YouTube

YouTube’s live encoder guidance consulted on October 3, 2026 lists RTMP/RTMPS ingest, H.264, H.265 (HEVC), or AV1 video, AAC or MP3 audio, and constant bitrate (CBR). It recommends RTMPS for encryption, a keyframe interval of about two seconds (no more than four), and stereo audio at 128 Kbps. Confirm the current accepted settings in Live Control Room before publishing because platform guidance and controls can change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Target video (H.264) YouTube minimum bitrate YouTube recommended bitrate
720p at 30 fps 3 Mbps 8 Mbps
1080p at 30 fps 5 Mbps 14 Mbps

These are YouTube’s recommendations, not measured requirements for every network or content type. Allow upload headroom above the video and audio bitrate, and check that the connection can sustain the output continuously. YouTube advises running a speed test. If the connection or host cannot sustain the chosen bitrate, reduce the output settings rather than relying on a peak speed result.

With stream copy, FFmpeg does not change the source encoding, so these output settings may not match the files. If you need to standardize mixed assets, use a re-encode command and choose dimensions, frame rate, video bitrate, audio bitrate, codec and keyframe interval deliberately. Re-encoding uses additional CPU or GPU capacity; verify the host can encode continuously before relying on it.

Rank #3
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

5. Start the playlist stream

Option A: stream-copy compatible files

If the listed files have compatible streams and YouTube accepts their codecs and parameters, run:

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt -c copy -f flv "YOUR_YOUTUBE_RTMPS_URL/YOUR_STREAM_KEY"

-stream_loop -1 loops the input indefinitely and must appear before the playlist input it applies to. -re reads media at its native playback rate rather than sending the files as fast as possible. -f concat selects the concat demuxer; -safe 0 allows paths the demuxer would otherwise reject as unsafe, so use it only with a playlist you control. -c copy copies the media streams without re-encoding. The RTMPS URL and key are placeholders; follow the exact endpoint format shown by YouTube and do not publish a command containing your actual key.

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

Option B: re-encode a mixed playlist

If the files are not compatible for stream-copy concatenation, remove -c copy and specify a common encoding. For example, this illustrates a 720p, 30 fps H.264/AAC output with a two-second keyframe interval and CBR-style video rate control:

Rank #4
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.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,fps=30" 
  -c:v libx264 -b:v 8M -minrate 8M -maxrate 8M -bufsize 16M -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 48000 -ac 2 
  -f flv "YOUR_YOUTUBE_RTMPS_URL/YOUR_STREAM_KEY"

This is an illustrative configuration, not a guarantee of acceptance or a tested performance result. At 30 fps, a 60-frame GOP corresponds to about two seconds. The example pads to 16:9; inspect the result if your sources use another aspect ratio. If the playlist has no audio, or has unusual audio layouts, adjust the audio mapping and encoding for those files. At 1080p30, use YouTube’s applicable bitrate guidance and make sure the machine can encode at the selected rate without falling behind.

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

6. Monitor the first run and keep it running

Watch FFmpeg’s terminal output for errors, stalled progress, or repeated reconnect attempts, and monitor the stream health indicators in Live Control Room. Before relying on a long-running broadcast, test playback with representative files and check picture, audio, transitions, and the end-to-start loop. YouTube also recommends testing before going live and monitoring stream health.

A terminal process stops if its session ends or the machine shuts down. For continuous operation, keep the Ubuntu host powered, connected, and available to run FFmpeg; arrange your own process supervision and alerting if needed. A loop flag alone does not restart FFmpeg after a crash or guarantee recovery when YouTube disconnects the stream. If you use a VPS or other hosted server, evaluate sustained outbound bandwidth, provider rules for continuous RTMPS traffic, reliability, CPU capacity for transcoding, and total cost.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
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.

7. Understand 24/7 streaming versus replay archives

YouTube’s encoder guidance says streams shorter than 12 hours are automatically archived. That does not establish that a single uninterrupted 24-hour broadcast will be archived in full. If replay availability matters, plan around YouTube’s documented duration limit rather than treating continuous transmission as an archive guarantee.

8. Troubleshoot common failures

  • ffmpeg: command not found: confirm APT completed successfully, then run ffmpeg -version again. Check that FFmpeg is installed on the same Ubuntu host and under the user account running the command.
  • Playlist file or media cannot be opened: check the working directory, spelling, file permissions, and paths in playlist.txt. Try absolute paths if the process starts from a different directory.
  • Concat or stream-copy errors: confirm that the playlist entries are readable and their streams are compatible. If they are mixed, re-encode to a common set of video and audio parameters instead of assuming -c copy can join them.
  • YouTube does not receive the stream: verify that you copied the matching URL and key from the selected Live Control Room stream, that the key has not been reset, and that outbound connectivity to the supplied endpoint is available. Keep the key private while debugging.
  • Stream health reports dropped frames or instability: compare the sustained upload capacity with the total output bitrate, including audio. Lower the resolution or bitrate if necessary, then test again; a speed test peak is not proof of uninterrupted capacity.
  • Video or audio is rejected or plays incorrectly: compare the actual encoded output with YouTube’s current codec, CBR, keyframe, bitrate, and audio guidance. Stream-copy output inherits the source files’ encoding, so use explicit re-encoding settings when standardization is needed.
  • FFmpeg exits or the stream stops after a disconnect: inspect FFmpeg’s error output and YouTube stream status, then restart or supervise the process according to your host setup. This command does not provide automatic crash recovery.

Or let it run in the cloud

If you do not want an Ubuntu computer or home connection running all day, StreamNeo keeps an uploaded-video YouTube stream running from the cloud. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; videos stream as uploaded at any 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. StreamNeo plays uploaded videos, not a camera feed, and streams to YouTube only. Start the free day on StreamNeo.

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

  1. How to Send a YouTube Live Stream to a Premiere—and What “Premiere Playlist” Can’t DoAdmit one · BlogHow to Send a YouTube Live Stream to a Premiere-and What “Premiere Playlist” Can't DoOpened04 OCT 2026Runtime6 min
  2. How to Run a YouTube Live Playlist from a Raspberry PiAdmit one · BlogHow to Run a YouTube Live Playlist from a Raspberry PiOpened04 OCT 2026Runtime4 min
  3. How to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootAdmit one · BlogHow to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootOpened04 OCT 2026Runtime6 min
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.