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 DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
FFmpeg

How to Stream Pre-Recorded Videos to YouTube 24/7 with FFmpeg on Linux

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.

Yes. FFmpeg can send a video file to YouTube Live continuously: use YouTube Studio’s encoder stream URL and key, then run FFmpeg with -re for real-time pacing and -stream_loop -1 to repeat the file. The command is only one part of a 24/7 setup: your Linux host, upload connection, and FFmpeg process must also stay healthy, and you should test the preview before making the stream public.

What you need before you start

  • A YouTube channel that can create an encoder stream in YouTube Studio.
  • A Linux host that can stay on, read the source video, encode it if needed, and sustain the required upload rate. That could be a Linux computer or a VPS; there is no universal hardware specification for this workload.
  • A video file that FFmpeg can read, plus enough disk space for the file and any logs you keep.
  • An FFmpeg build with the needed input, encoder, and output protocol support. Linux distribution packages differ, so do not assume every build includes libx264 or RTMPS support.

This sends prerecorded video as an encoder feed to YouTube Live. It does not turn the source into a camera broadcast, guarantee uninterrupted uptime, or establish eligibility for monetization.

Create the YouTube encoder stream

  1. In YouTube Studio, open Go Live. Create a stream or schedule one from the Manage tab.
  2. Open the stream’s Stream settings in Live Control Room. Copy the stream URL and select or copy the stream key. Use the exact endpoint and key YouTube shows for that stream; do not substitute a guessed ingest address.
  3. Prefer the RTMPS URL if your FFmpeg build supports it. YouTube describes RTMPS as RTMP over TLS/SSL, which encrypts the encoder-to-YouTube connection.
  4. Keep the key private. YouTube says stream keys are like a stream’s password and address. Do not publish it in a script, screenshot, log, shell history, or process listing. If it is exposed, reset it in Live Control Room and update the encoder configuration.
  5. If you scheduled the stream, check its settings for auto-start and auto-stop. A scheduled stream can appear as upcoming and may allow viewers to opt into reminders; interface behavior can change.

Choose an output bitrate and keyframe interval

YouTube Help’s encoder settings table, accessed October 3, 2026, gives the following H.264 ingest guidance. The minimum and recommended figures are not promises of viewer quality; choose for your actual resolution and frame rate, and leave upload headroom above the stream’s sustained bitrate.

H.264 output YouTube-listed minimum YouTube-listed recommended bitrate
720p at 30 fps 3 Mbps 8 Mbps
1080p at 30 fps 5 Mbps 14 Mbps
1080p at 60 fps 6 Mbps 17 Mbps
1440p at 30 fps 7 Mbps 21 Mbps
2160p/4K at 30 fps 11 Mbps 42 Mbps

YouTube’s current encoder guidance lists H.264, H.265/HEVC, or AV1 for RTMP/RTMPS video; AAC or MP3 audio; frame rates up to 60 fps; and constant bitrate encoding. It recommends a 2-second keyframe interval and advises not to exceed 4 seconds. Confirm the current table in YouTube Help before choosing settings, because platform recommendations can change.

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.
#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.

Run a single video in an infinite loop

For a 1080p, 30 fps H.264 output, this template reads one file at real-time speed, maps its first video stream and any available first audio stream, and loops the input indefinitely. Replace the file path and RTMPS destination with your own values.

ffmpeg -re -stream_loop -1 -i "/path/to/video.mp4" 
  -map 0:v:0 -map 0:a:0? 
  -c:v libx264 -preset veryfast -pix_fmt yuv420p 
  -r 30 -g 60 -b:v 6000k -maxrate 6000k -bufsize 12000k 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "rtmps://INGEST_HOST/APP/STREAM_KEY"
  1. Check your installed FFmpeg build. The command assumes libx264 is available; if it is not, use an encoder supported by your build and check that encoder’s options.
  2. Keep -re and -stream_loop -1 before the input’s -i. FFmpeg documents -re as real-time input pacing and -stream_loop -1 as infinite input looping.
  3. Replace the RTMPS placeholder with the exact URL and key from Live Control Room. Protect the credential; putting it directly in a command can expose it through shell history or process listings.
  4. Adjust the output resolution, frame rate, encoding load, and bitrate to suit the source, machine, network, and YouTube’s current recommendations. This template does not scale the input to 1080p; -r 30 sets an output frame rate, not a resolution.
  5. The example’s 6 Mbps video bitrate is above YouTube’s listed H.264 minimum for 1080p30, but below its 14 Mbps recommendation accessed October 3, 2026. It is an example value, not the recommended target.

The optional audio map, -map 0:a:0?, lets the command continue if the file has no audio stream; it does not add audio to a silent source. If your file contains multiple video or audio streams, choose the intended streams explicitly.

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.

Test the feed and start the broadcast

  1. Run FFmpeg and watch its output for input errors, encoder errors, and failed connections.
  2. In Live Control Room, check the incoming preview and stream health. Confirm that picture and audio behave as intended.
  3. Start or confirm the broadcast in Live Control Room as appropriate for your stream settings. Sending an encoder feed and making a scheduled or waiting stream live are not necessarily the same action.
  4. Watch the stream long enough to check for drift, stalls, audio problems, and a successful loop back to the start. YouTube advises testing before going live and monitoring audio and video.

Do not announce a continuous stream until you have tested the complete path from the Linux host through YouTube’s preview and broadcast controls.

Use a playlist instead of one file

A single file is the simplest loop. A playlist made from clips with different formats can produce failed concatenation, timing problems, or rough transitions. FFmpeg’s concat demuxer expects matching stream properties, including compatible codecs and time bases. A September 2024 FFmpeg-user mailing-list discussion also describes problems with mixed-format inputs; that is community guidance, not a formal guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
  1. Normalize the clips to a consistent resolution, frame rate, video codec, pixel format, audio layout, and time base.
  2. Test the playlist and transitions on the same FFmpeg build and output path you plan to use for the live stream.
  3. Only after testing, apply the same real-time pacing, loop, encoding, and YouTube output configuration used for a single file.

Do not assume that putting heterogeneous files into a playlist will make them play seamlessly. Check both the transition points and how the playlist behaves when it reaches its end.

Keep the stream running on Linux

An infinite loop keeps FFmpeg reading the input again; it does not keep the entire service online by itself. The host must remain powered and healthy, the source file must remain readable, the encoder must have enough CPU if it is transcoding, and the network must sustain the upstream bitrate. These are operational requirements of the setup, not a universal tested hardware specification.

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
  • Run FFmpeg under a process supervisor so it can be monitored and restarted after a process failure.
  • Keep logs in a location with enough disk space, restrict access to them, and set up alerts for a stopped process or failed output.
  • Test what happens after a brief network interruption, host restart, file error, and expired or reset stream key. Recovery after one type of failure does not guarantee recovery after another.
  • FFmpeg documents FIFO muxer recovery options for retrying an RTMP output after a temporary network failure. Its example uses -f fifo, -fifo_format flv, -attempt_recovery 1, and -recovery_wait_time 1. Check your installed FFmpeg version and test any adapted command before relying on it.
  • For a VPS or dedicated server, compare sustained upload capacity, CPU headroom, storage, restart controls, administration burden, and provider terms. No particular host or machine is established as suitable for every stream.

FFmpeg output-recovery settings address certain temporary output failures; they cannot fix a stopped host, unreadable source, invalid credentials, disabled stream, or interruption on YouTube’s side. A looping command is therefore not an uptime guarantee.

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

Understand YouTube’s long-stream limits and content rules

  • YouTube says streams under 12 hours are automatically archived. Do not assume an arbitrarily long continuous broadcast will produce one complete archive.
  • YouTube says DVR may be limited or unavailable on very long streams longer than 12 hours; viewers cannot seek to a point before the live stream began.
  • Using FFmpeg or a prerecorded file does not itself establish that a channel or video qualifies for monetization or complies with YouTube policy. Check the current monetization and content rules for your channel and the specific material you plan to stream.
  • Make sure you have the rights needed for all video and audio in the source, including music, game footage, and other material. A successful encoder connection does not establish that the content is cleared for broadcast.

Common FFmpeg and YouTube Live problems

  • FFmpeg cannot find an encoder: Your distribution’s build may not include libx264. Check the available encoders in that build and choose supported options rather than assuming all Linux packages are identical.
  • YouTube receives no feed: Recheck the exact stream URL and key in Live Control Room, confirm that the destination uses a protocol supported by your FFmpeg build, and inspect FFmpeg’s connection errors. Reset and replace the key if it may have been exposed.
  • The stream starts but looks unstable: Compare the output resolution, frame rate, codec, bitrate, and keyframe interval with YouTube’s current ingest guidance. Check the host’s encoding load and whether upstream bandwidth can sustain the chosen bitrate with headroom.
  • There is no sound: Confirm that the input has an audio stream and that the intended audio stream is mapped. The optional map in the template permits a file without audio; it does not generate sound.
  • The video stops at the end of the file: Confirm that -stream_loop -1 appears before the corresponding -i. It is an input option; placing it after the input can change which input it applies to.
  • A multi-clip playlist fails or has bad transitions: Check that clips have compatible stream layouts and timing properties. Normalize them and test the full sequence before using it as a live source.
  • FFmpeg reconnects but the broadcast is still down: Recovery options cover only certain temporary output failures. Check the host, source file, credentials, stream status, and YouTube Live Control Room separately.

Or let it run in the cloud

If you do not want a Linux computer or VPS to stay on, StreamNeo is a YouTube-only cloud service from Yorker Media for looping uploaded videos. Upload a recording or build a playlist, add your YouTube stream key once, and go live. The cloud keeps the stream running without your computer or home connection staying on.

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.
  • One flat price per slot for any uploaded quality up to 4K 60 fps, with no re-encode or quality tiers.
  • Automatic recovery if YouTube drops the stream.
  • The first day is free with no card required.
  • One slot includes one always-on stream, 10 GB of storage per slot pooled across active slots, looping and playlists, automatic recovery, and StreamNeo team support.

Monthly: $9.99 per month. For the same product on other billing lengths, see StreamNeo pricing. India-based customers can pay by UPI or card; card checkout is available worldwide. For five or more slots, contact support.

See StreamNeo or estimate upload time before choosing a workflow. To try the cloud setup, start your free first day with 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.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.