Install FFmpeg with Ubuntu’s package manager, create a playlist file, and run FFmpeg with -stream_loop -1 to repeat it. Then send the output to the RTMPS URL and stream key from YouTube Live Control Room. The command can keep transmitting while the process runs, but it does not by itself provide automatic recovery or guarantee that YouTube will archive a continuous 24/7 broadcast.
What you need before you start
- An Ubuntu machine that can stay powered on and connected to the internet, or a hosted Ubuntu server.
- FFmpeg installed from Ubuntu’s package repositories.
- Local video files you are entitled to stream, plus enough disk space to store them.
- A YouTube channel with live streaming enabled and access to YouTube Live Control Room.
- A stable upload connection with capacity for the stream bitrate, plus some headroom.
A continuously running stream also means continuously sending data. Before choosing a home computer or hosted server, consider sustained upload bandwidth, provider rules and costs, and available CPU capacity if you plan to re-encode.
Install and verify FFmpeg on Ubuntu
-
Open a terminal on the Ubuntu system and refresh its package lists:
sudo apt update -
Install FFmpeg:
sudo apt install ffmpeg -
Check that it is available and note the installed build:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.#1 Best Overall
SaleLexar 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
ffmpeg -version
The package version depends on your Ubuntu release and enabled repositories; this installation method does not imply one universal FFmpeg version. Check the package information for the release you are using if you need to confirm available features.
Build the playlist file
FFmpeg’s concat demuxer reads a text file containing the media files in playback order. In a working directory, create playlist.txt, using one file line for each video. For example:
file '/home/ubuntu/videos/part-1.mp4'
file '/home/ubuntu/videos/part-2.mp4'
file '/home/ubuntu/videos/part-3.mp4'
Use paths that exist on the Ubuntu machine. If filenames contain apostrophes or unusual characters, quote and escape them correctly for the concat file format; keeping paths simple avoids avoidable parsing errors. The order in the file is the order FFmpeg will read.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- 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]
Check whether stream copy is appropriate
With -c copy, FFmpeg copies the source streams instead of encoding them again. Use this only when the files’ stream properties are compatible enough to be concatenated. Files that differ in video or audio codec, resolution, frame rate, time base, or other stream characteristics can produce playback problems at boundaries or fail to concatenate as expected. A playlist does not guarantee seamless transitions.
If the files are mixed, re-encode to a consistent output format. Re-encoding requires additional CPU or GPU resources; confirm that the machine can handle the chosen settings before relying on it continuously.
Get YouTube’s ingest URL and protect the stream key
-
Open YouTube Live Control Room and create or select the live stream you intend to use.
-
Copy the server URL and stream key shown in the stream’s settings. YouTube may show an RTMP URL by default; use the interface option to reveal the RTMPS URL when available, and prefer RTMPS for encrypted transport.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.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
-
Keep the stream key private. YouTube describes stream keys as equivalent to a password and address for the stream. Do not put the real key in a public command, screenshot, shared script, or source-control repository. If it is exposed, reset it in Live Control Room.
Use the exact URL and key YouTube provides for that stream rather than assuming an endpoint will be the same for every channel or session.
Choose the output settings
YouTube’s encoder recommendations consulted on October 3, 2026 list RTMP/RTMPS ingest, H.264, H.265 (HEVC), or AV1 video, AAC or MP3 audio, and constant bitrate (CBR). For a broadly compatible FFmpeg starting point, the examples below use H.264 video and AAC audio. Confirm the current options in Live Control Room and YouTube’s encoder guidance before going live, since platform settings can change.
| Output target | YouTube H.264 bitrate guidance consulted October 3, 2026 | Keyframe interval |
|---|---|---|
| 720p at 30 fps | 3 Mbps minimum; 8 Mbps recommended | About 2 seconds recommended; no more than 4 seconds |
| 1080p at 30 fps | 5 Mbps minimum; 14 Mbps recommended | About 2 seconds recommended; no more than 4 seconds |
These are YouTube recommendations, not measurements of your connection or a guarantee of a successful stream. YouTube also recommends 128 Kbps stereo audio. Match the output to your source material and choose a bitrate that your connection can sustain; test upload capacity before committing to a long-running broadcast.
Rank #4
- 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.
Run the looped playlist to YouTube
In the command below, replace YOUTUBE_RTMPS_URL with the RTMPS URL copied from Live Control Room and provide the key using a protected method. Do not paste a real key into a script that will be published or shared.
For compatible files: stream copy
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt -c copy -f flv "YOUTUBE_RTMPS_URL/STREAM_KEY"
For mixed files: re-encode to a consistent 1080p30 H.264/AAC output
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,fps=30" -c:v libx264 -preset veryfast -b:v 8M -maxrate 8M -bufsize 16M -g 60 -keyint_min 60 -sc_threshold 0 -pix_fmt yuv420p -c:a aac -b:a 128k -ar 48000 -ac 2 -f flv "YOUTUBE_RTMPS_URL/STREAM_KEY"
The re-encode example uses a 30 fps output and a two-second keyframe interval (-g 60). Its 8 Mbps video target is within YouTube’s stated H.264 recommendation range for 1080p30, but not a universal best setting. To use another resolution or frame rate, adjust the filter, GOP/keyframe interval, and bitrate to match the output and current YouTube guidance. The veryfast preset is a starting point, not a promise that every machine can encode in real time.
Best Value
- 【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.
In both commands, -stream_loop -1 is an input option and appears before the playlist input it affects. -re reads the media at its native playback rate rather than sending a file as fast as possible. The output options follow the input, and -f flv selects the RTMP-family output container. Replace the example key portion only in a private invocation; treat the key as a secret.
Keep the stream running and check its health
FFmpeg continues looping while its process is running and the input files and connection remain available. A loop alone does not restart a failed process or recover automatically after YouTube disconnects. Monitor FFmpeg’s output and YouTube’s stream health, and test both audio and moving video before relying on the stream.
- Test first: start with a short private or otherwise appropriate test and verify that the picture, sound, playlist order, and YouTube ingest are correct.
- Watch for failures: check for FFmpeg errors, dropped connection messages, and warnings in Live Control Room.
- Plan process supervision separately: if the process or machine must recover after a failure, configure and test a restart strategy for your Ubuntu environment. The command above is not an automatic recovery setup.
- Plan for the host: disable unintended sleep, keep the machine powered and connected, and account for ongoing upload use and provider restrictions.
Understand YouTube archives for a 24/7 broadcast
YouTube’s encoder guidance says streams under 12 hours are automatically archived. That does not establish that one uninterrupted 24/7 broadcast will be archived in full. If replay retention matters, plan around the documented duration limit rather than assuming a full-day transmission will become one complete replay.
Or let it run in the cloud
If you do not want an Ubuntu computer or home connection to stay on, StreamNeo is a cloud service for keeping an uploaded-video YouTube stream live: upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops the uploaded video from the cloud; it does not broadcast a live camera feed.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- Nothing has to stay on at home.
- Any quality up to 4K 60fps, streamed as uploaded, at one flat price per slot.
- Automatic recovery if YouTube drops the stream.
- The first day is free with no card.
The monthly option is $9.99 per month. Every slot includes one always-on stream, 10 GB storage per slot pooled across active slots, 24/7 looping and playlists, automatic recovery if YouTube drops, and StreamNeo team support. The same product is included on every plan; only the billing length changes. UPI and cards are supported in India, with card checkout worldwide. See StreamNeo for details, or start the free first day.
Quick Recap
Common problems and fixes
ffmpeg: command not found: confirm that the package installation completed, then checkffmpeg -version. If it is missing, rerun the APT install step and review any package-manager error.- Concat file cannot be opened: verify that each listed path is correct and readable by the user running FFmpeg. Use the concat demuxer’s required
file 'path'syntax. - Playback glitches or errors at file boundaries: check for incompatible source streams. Try the re-encode approach to create a consistent output rather than assuming stream copy will work.
- YouTube does not receive the stream: check that you copied the current URL and key from the correct Live Control Room stream, that the key is private and valid, and that outbound RTMPS traffic is permitted by the network.
- Stream health reports instability: compare the chosen bitrate with stable upload capacity, run an upload speed test as YouTube recommends, and reduce output bitrate or resolution if the connection cannot sustain it.
- Video or audio is missing: inspect FFmpeg’s output and the source files for absent or unsupported streams, then test a single file before troubleshooting the full playlist.
- Stream stops after a disconnect: a plain FFmpeg command does not guarantee recovery. Restart the process or use a separately configured and tested supervisor; verify the new ingest in Live Control Room.
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.

