Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
FFmpeg

Best FFmpeg Settings for a Continuous YouTube Live Stream

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

For a typical SDR 1080p30 YouTube stream encoded with H.264, start with constant-bitrate output at 14 Mbps, AAC stereo audio at 128 kbps and 44.1 kHz, and a two-second keyframe interval. At 30 fps, that interval is 60 frames, so -g 60 is a reasonable starting value. These settings must be matched to your source, encoder, sustained upload capacity, and stream duration; they are not a universal preset.

The example below is for looping a video file through FFmpeg to YouTube. It uses RTMPS, which YouTube recommends, and real-time input pacing so the file is not sent faster than playback. For a capture device or another already-live input, omit -re.

Start with a YouTube-compatible FFmpeg command

Replace the placeholder ingest address and key with the values shown in YouTube Live Control Room. Keep the stream key private: anyone who obtains it may be able to broadcast to your channel.

ffmpeg -re -i input.mp4 
  -c:v libx264 -preset veryfast -b:v 14M -maxrate 14M -bufsize 28M 
  -pix_fmt yuv420p -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 -ac 2 
  -f flv "rtmps://YOUTUBE_INGEST_URL/YOUR_STREAM_KEY"

This is an illustrative output-options pattern, not a tested command or a guarantee that a particular machine can encode in real time. Confirm that your FFmpeg build supports the selected protocol and includes the chosen encoder. Encoder rate-control behavior depends on the encoder; setting a target bitrate alone does not prove strict constant bitrate (CBR). The 28M buffer is an example, not a YouTube requirement.

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.

Set up the YouTube side first

  1. In YouTube Live Control Room, create or open the live stream and select an encoder workflow. Copy the server/ingest URL and stream key that YouTube provides; do not publish the key in a script repository, screenshot, or support request.
  2. Make sure your channel and live-stream setup are eligible and enabled. YouTube’s encoder setup instructions are at Create a YouTube live stream with an encoder.
  3. Run the command, then check the Control Room preview and stream-health messages before sharing the live broadcast with viewers.

Use real-time pacing only for file inputs

-re reads a file at approximately its playback rate, which is useful for sending prerecorded video as a live stream. Do not add it automatically to a live capture input, because that input is already arriving in real time. FFmpeg documents input pacing and command-line options in its command-line documentation.

Choose bitrate, frame rate, and keyframes for the source

YouTube’s current encoder-settings guidance varies bitrate recommendations by codec, resolution, and frame rate. The H.264 values below are YouTube recommendations, not measurements of what every viewer will receive; YouTube transcodes live streams into multiple output formats.

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.
H.264 output YouTube recommended bitrate Example GOP at two seconds
720p30 8 Mbps 60 frames
720p60 8 Mbps 120 frames
1080p30 14 Mbps 60 frames
1080p60 17 Mbps 120 frames

For a fixed frame rate, calculate a two-second GOP by multiplying frames per second by two: for example, 30 fps × 2 = 60 frames. YouTube recommends a two-second keyframe frequency and says not to exceed four seconds. A nominal GOP setting does not replace checking actual keyframe behavior for the encoder you use. Consult YouTube’s encoder settings, bitrates, and resolutions before using a different codec or output format; its table also lists minimum bitrates.

Adjust the command when the output changes

  • 720p30: set the video target and maximum rate to YouTube’s 8 Mbps recommendation and use -g 60 for a two-second GOP at 30 fps.
  • 720p60: use the 8 Mbps recommendation and -g 120 for a two-second GOP at 60 fps.
  • 1080p60: use the 17 Mbps recommendation and -g 120 for a two-second GOP at 60 fps.
  • Other codecs or formats: do not carry over the H.264 values by assumption. Select settings from YouTube’s current table for the chosen ingest codec, resolution, and frame rate.

If you change -b:v, also review -maxrate, -bufsize, and the encoder’s own rate-control options. The command’s pixel format, frame rate, scaling, and source characteristics also affect the output; the example does not resize or convert an input to a different frame rate.

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.

Configure audio and picture characteristics

For stereo, YouTube recommends AAC or MP3 audio, 44.1 kHz stereo, and 128 kbps stereo audio. The example uses AAC at those stereo settings. YouTube specifies AAC for 5.1 audio over RTMP/RTMPS, with 48 kHz and 384 kbps recommended for 5.1; do not apply the stereo channel and bitrate settings to a surround mix.

YouTube’s advanced guidance for SDR includes square pixels, progressive scan, two B-frames, one reference frame, and Rec. 709. These properties are not all explicitly set by the sample command, and encoder-specific options vary. Check the selected encoder’s documentation and verify the emitted stream rather than assuming defaults meet every advanced recommendation. YouTube lists H.264, H.265/HEVC, and AV1 for RTMP/RTMPS ingest, up to 60 fps; H.264 is used here as a broadly compatible example, not as a claim that it is best for every workflow.

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

Make a stream more resilient to interruptions

Plan upload capacity with headroom

YouTube recommends that total outgoing stream bitrate remain within available upload capacity and advises leaving 20% headroom. Base the decision on tested, sustained upload performance rather than the advertised download speed. Other devices and users on a shared network can reduce the bandwidth available to FFmpeg. YouTube’s streaming tips cover network reliability and bandwidth planning.

  • Test the connection at the location and time you expect to stream.
  • Run a realistic test with motion and audio similar to the intended broadcast.
  • Watch YouTube’s stream-health status and messages while testing and during the live run.
  • If the connection cannot sustain the chosen video bitrate with headroom, lower the output resolution, frame rate, or bitrate rather than relying on a short speed-test peak.

Use recovery carefully, and supervise the process

FFmpeg’s full documentation includes an RTMP FIFO-muxer example using -attempt_recovery 1 and -recovery_wait_time 1 to attempt recovery from certain temporary output failures. The relevant details are in the FFmpeg full documentation. This is not protection against every network outage, input failure, process crash, invalid key, or YouTube interruption. For unattended operation, use process supervision, keep logs, and arrange alerts so a stopped or unhealthy stream is noticed.

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.

A two-second keyframe interval and a recommended bitrate can help meet ingest guidance; neither guarantees an uninterrupted broadcast. Continuous operation also depends on a stable input, a capable encoder, adequate network capacity, valid credentials, and the health of the streaming service.

Account for protocol and archive requirements

YouTube recommends RTMPS for encoder ingest. HLS can be appropriate for some HDR or alternate-codec workflows, but it sends media in segments and has higher latency. Use the protocol and codec that match your content and YouTube’s current ingest guidance rather than assuming RTMPS and HLS behave identically. See YouTube’s HLS setup guidance for its use cases.

YouTube’s encoder setup instructions say streams under 12 hours are automatically archived. That statement describes automatic archive behavior; it does not establish a general maximum live duration. If you need a recording from a longer run, make a separate local recording or confirm YouTube’s current archive behavior and requirements.

Common problems and practical fixes

Symptom Likely area to check What to do
FFmpeg cannot connect or YouTube does not receive a stream Ingest URL, stream key, protocol support, or channel setup Copy the current URL and key from Live Control Room, verify the key has not been reset, check channel live setup, and confirm the FFmpeg build supports RTMPS.
Video stutters or YouTube reports poor stream health Insufficient or variable upload capacity; competing network traffic Test sustained upload performance, leave YouTube’s recommended 20% headroom, reduce bitrate or output demands if necessary, and monitor stream health.
Encoding falls behind or frames are dropped before sending Encoder load exceeds the machine’s real-time capacity Test at the intended resolution and frame rate. Try a faster x264 preset or a lower output load, then check encoder logs and YouTube health.
A file finishes before the expected real-time duration File input is being read faster than playback Use -re before the file input, as in the example. Do not use it to pace an already-live capture source.
Stream ends after an output interruption Recovery limits, process failure, input failure, or credentials Check logs and stream health, confirm the input remains readable and the key is valid, and use external process supervision and alerts. FIFO recovery only attempts recovery for certain output failures.

Run FFmpeg yourself or keep the stream in the cloud

Running FFmpeg yourself gives you control over the source, encoder settings, and local recording workflow, but the computer, input, and network must remain available for the broadcast. If your goal is simply to keep uploaded videos looping on YouTube without keeping a computer running, StreamNeo is a cloud option: upload a video or build a playlist, add your YouTube stream key once, and go live. It streams the uploaded video to YouTube, not from a camera.

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

Or let it run in the cloud

With StreamNeo, nothing has to stay on at home. Each slot streams uploaded video at its original quality up to 4K 60fps for one flat price per slot, with no re-encode or quality tiers; it can attempt automatic recovery if YouTube drops the stream. The first day is free with no card required. Monthly billing is $9.99 per month. A slot includes 10 GB of storage, pooled across your active slots, plus 24/7 looping, playlists, and StreamNeo team support. Billing options include a day, week, month, six months, or year, and you can cancel any time. UPI and cards are available in India; card checkout is available worldwide. For five or more slots, contact support.

  1. Upload your recording or build a playlist.
  2. Add your YouTube stream key once.
  3. Go live; StreamNeo loops the video from the cloud.

Start your free StreamNeo day.

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