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 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
DocumentaryTube
24/7 streaming

FFmpeg Settings for 24/7 YouTube Streaming: Bitrate, Looping, and Recovery

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

For a 24/7 prerecorded YouTube stream, FFmpeg can loop a file indefinitely with -stream_loop -1. For a conventional 1080p30 SDR H.264 stream, use YouTube’s required-style baseline of CBR, a two-second keyframe interval, and AAC stereo at 128 kbps; YouTube lists 5 Mbps as the minimum H.264 video bitrate at that resolution and frame rate, and 14 Mbps as its recommendation. Looping the file does not protect against a failed process, network outage, or ingest interruption, so those need separate monitoring and recovery plans.

Choose settings for your resolution, frame rate, and codec

YouTube’s encoder settings apply to the feed you send to its ingest servers; YouTube then creates viewer playback formats. Match the bitrate to the codec, resolution, and frame rate you actually send. The figures below are YouTube’s current published guidance, accessed in 2026; they are not a guarantee of stream quality on a particular connection.

Incoming video profile Minimum bitrate Recommended bitrate
720p30 H.264 3 Mbps 8 Mbps
1080p30 H.264 5 Mbps 14 Mbps
1080p30 AV1 or H.265/HEVC Not stated in YouTube’s current guidance 10 Mbps

Use the H.264 values when encoding with FFmpeg’s libx264; do not borrow a bitrate from another codec’s row. The 5 Mbps 1080p30 H.264 figure is the published minimum, not the recommended target. YouTube recommends 14 Mbps for that profile. A more motion-heavy documentary, or a source with fine detail, may benefit from the higher recommendation if your encoder and sustained upload can support it. Consult YouTube’s live encoder settings, bitrates, and resolutions for other profiles and current values.

Core output settings

  • Protocol: Use RTMPS where supported. YouTube recommends it because it encrypts the connection to Google’s servers.
  • Rate control: Use constant bitrate (CBR).
  • Keyframes: Set a two-second interval; YouTube says not to exceed four seconds. At 30 fps, two seconds is 60 frames.
  • Audio: AAC stereo at 128 kbps is YouTube’s recommended advanced setting. Its guidance recommends 44.1 kHz for stereo.
  • Color and scan: For SDR, use Rec. 709 and 8-bit color. YouTube’s advanced recommendations include progressive scan, two B-frames, one reference frame, and CABAC.
  • Codec and frame rate: YouTube lists H.264, H.265/HEVC, and AV1 as supported, with frame rates up to 60 fps. H.264 is a conservative choice for broad FFmpeg compatibility; verify the encoders available in your local build before choosing another codec.

Loop one prerecorded video indefinitely

This illustrative command assumes a conventional 1920Ă—1080, 30 fps input and an FFmpeg build with libx264 and AAC support. Replace the input path, ingest URL, and stream key with your own values. The command is a configuration example, not a tested command or a promise of uninterrupted operation.

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.
ffmpeg -re -stream_loop -1 -i input.mp4 
  -c:v libx264 -preset veryfast -b:v 5M -maxrate 5M -bufsize 10M 
  -pix_fmt yuv420p -r 30 -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 -ac 2 
  -f flv "YOUTUBE_RTMPS_INGEST_URL/STREAM_KEY"
  1. Prepare the YouTube event. In YouTube Studio, create or open the live stream in Live Control Room. Copy its stream URL and stream key into the command. Treat the key like a password: do not expose it in a public script, log, screenshot, or source-control repository. See YouTube’s encoder setup guidance.
  2. Set the input and loop option. Replace input.mp4 with the local file path. -stream_loop -1 loops that input indefinitely, and it must appear before the relevant -i.
  3. Read a file at playback speed. -re reads the file at its native rate, which is useful when simulating a live feed from a prerecorded file. It is not a universal option for actual live capture.
  4. Set video encoding. The example encodes H.264 at a CBR target and maximum of 5 Mbps, with a two-second GOP at 30 fps. That bitrate is YouTube’s published 1080p30 H.264 minimum. For its recommended 14 Mbps target, change both -b:v and -maxrate to 14M, and ensure the line and encoder can sustain it. Set output dimensions and frame rate to match your intended feed rather than blindly forcing 1080p30.
  5. Set audio and destination. The example encodes AAC stereo at 128 kbps and 44.1 kHz, then sends the FLV muxed output to the RTMPS ingest URL and stream key. If the source has no audio, verify your chosen output workflow and YouTube preview before going live.

FFmpeg options are positional: their order determines which input or output they affect. The example’s -preset veryfast, -bufsize 10M, -pix_fmt yuv420p, and -sc_threshold 0 are illustrative FFmpeg choices, not mandatory values prescribed by YouTube. Check supported encoder options against your installed FFmpeg build. Official references: YouTube’s encoder settings and FFmpeg’s command-line documentation.

Do not confuse looping with keeping a stream alive

A 24/7 stream has several independent continuity layers. A looping input handles only one of them.

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.
  1. Repeat the media: -stream_loop -1 repeats a finite input file.
  2. Recover output after some temporary errors: FFmpeg documents a FIFO muxer pattern using -f fifo -fifo_format flv, -attempt_recovery 1, and -recovery_wait_time 1. Its example is intended to attempt recovery every second indefinitely. This does not guarantee that every failure is recoverable or that YouTube preserves the same player session. See the FFmpeg full documentation.
  3. Keep the host and connection available: A stopped computer, failed process, or broken network still interrupts the stream. YouTube warns that connectivity disruption can break a stream and recommends bandwidth headroom and testing backup encoder failover. Use a supervisor, monitoring, alerts, and a tested fallback if unattended continuity matters. See YouTube’s streaming tips.

The FIFO pattern is an FFmpeg output-recovery example, not a YouTube service-level guarantee. Check that the options exist and behave as expected in your FFmpeg version and build, and test against the actual ingest endpoint. FFmpeg’s documented protocol reconnect controls for input protocols are not a universal output-reconnect switch; do not copy HTTP input options such as -reconnect onto an RTMP output and assume they restore publishing. See the FFmpeg protocol documentation.

Test the whole path before leaving it unattended

  1. Check the build: Confirm your local FFmpeg version, output protocol, and selected encoders are available.
  2. Check sustained upload capacity: Run an upload-speed test under realistic conditions. YouTube advises leaving about 20% bandwidth room; where you use primary and backup streams, their combined bitrate plus that headroom should fit the available outbound capacity.
  3. Test representative content: Stream a sample with motion and audio similar to the intended program. Confirm the Live Control Room preview and stream-health indicators.
  4. Verify playback: Start the encoder in advance, then check the watch page and mobile playback, not only the encoder’s local output.
  5. Exercise failover: If you have a backup encoder, test it by stopping the primary or disconnecting its Ethernet and verify that the player rolls over as intended.
  6. Supervise unattended runs: Configure an external process supervisor and alerting. Make restart limits and recovery behavior visible; reconnect attempts do not eliminate gaps.

Encoder load, bitrate stability, and reliability depend on the input, FFmpeg build, machine, network, YouTube stream configuration, and supervision setup. A successful short test is useful, but does not establish that a stream will remain uninterrupted indefinitely.

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.

Plan playlists, rights, and archives separately

Multiple files and transitions

Do not assume the single-file loop command will rotate a playlist or create seamless transitions. A playlist or concat workflow needs compatible stream parameters and its own handling of timestamps, audio continuity, and encoder restarts. Test every transition before publishing; no universal command guarantees gapless playback for arbitrary mixed files.

Copyright and YouTube policy

Looping content does not grant permission to broadcast it or guarantee monetization. Confirm that you have the necessary rights to every video and audio element, and follow YouTube’s copyright and live-stream policies. Monetization is available only if the creator is in the YouTube Partner Program, as described in YouTube’s encoder setup guidance.

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

Long-run archives

YouTube’s encoder setup page says streams under 12 hours are automatically archived. That statement does not establish that a stream running continuously beyond 12 hours will be saved as one complete video. If you need a complete local copy, configure a separate recording and archive workflow.

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

Common FFmpeg 24/7 streaming problems

Symptom Likely cause What to check or change
FFmpeg rejects an encoder or option The installed build lacks the selected encoder, or an option is unsupported in that build. Check the local FFmpeg build and available encoders; use options supported by that build.
YouTube reports poor stream health or the feed buffers The upload cannot sustain the chosen bitrate, or it has insufficient headroom. Test sustained outbound bandwidth, leave YouTube’s recommended headroom, and lower the bitrate or profile if needed.
The video plays once and stops The input-loop option is missing or placed after the wrong input. Put -stream_loop -1 before the corresponding -i.
The stream stops after a network or process failure Input looping does not restart a failed output or FFmpeg process. Test an appropriate output recovery pattern, supervise the process, add alerts, and verify a backup encoder where continuity matters.
Video or audio is wrong after a file transition Playlist files may differ in codec parameters, timestamps, or audio continuity. Test transitions with the actual playlist and resolve incompatible parameters or timestamp handling before the live run.
The stream is live but the expected complete archive is missing YouTube’s cited automatic-archive statement applies to streams under 12 hours, not a promise for longer continuous runs. Record and archive independently when a complete copy is required.

Or let it run in the cloud

If your goal is a prerecorded video looping on YouTube without leaving a home computer running, StreamNeo is a cloud service for that workflow: upload a recording or build a playlist, add your YouTube stream key once, and go live. It keeps the feed running from the cloud, so nothing has to stay on at home; uploads stream as made, up to 4K 60fps, at one price per slot; and it automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly is $9.99 per month. Start a free StreamNeo day.

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.