October 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 NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
FFmpeg

Best FFmpeg Settings for a Continuous YouTube Live Stream

A practical FFmpeg starting point for continuous YouTube Live streaming, with bitrate guidance, keyframe math, network planning, recovery limits, and troubleshooting.

By DocumentaryTube Team 6 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a pre-recorded video sent to YouTube Live with FFmpeg, start with RTMPS, H.264, constant-bitrate rate control, a two-second keyframe interval, and AAC stereo. For an ordinary SDR 1080p30 stream, YouTube recommends 14 Mbps video and 128 kbps audio at 44.1 kHz. This is a grounded starting point—not a universal preset: match resolution, frame rate, encoder capacity, and sustained upload speed to your actual setup.

Recommended starting settings for 1080p30

This illustrative command sends a file to the RTMPS ingest endpoint provided in YouTube Live Control Room. Replace the URL and key placeholder with your own values; treat the key as a password.

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"
  • -re paces a file input in real time rather than sending it as fast as FFmpeg can read it. Omit it for a live capture input, which is already arriving in real time.
  • -b:v sets target video bitrate; -maxrate and -bufsize are part of rate-control behavior. The 28M buffer shown is an example, not a YouTube requirement. Confirm how the selected encoder interprets these options; a target bitrate alone does not prove strict CBR.
  • -g 60 and -keyint_min 60 illustrate a 60-frame GOP, equal to two seconds at 30 fps. -sc_threshold 0 disables scene-cut keyframe insertion in x264, helping maintain the intended interval.
  • libx264 and veryfast are illustrative. Your FFmpeg build must include the encoder, and your machine must sustain encoding at the selected resolution and frame rate. Test for encoding lag and dropped frames before relying on it.

The command is a configuration sketch, not a tested guarantee. FFmpeg documentation covers command options and file pacing, while YouTube publishes its ingest recommendations in its encoder settings guide and command-line documentation.

Choose bitrate for the actual resolution and frame rate

Do not use the 1080p30 value automatically for a different output. YouTube’s current H.264 recommendations include these combinations:

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.
Output Recommended H.264 video bitrate
1080p30 14 Mbps
1080p60 17 Mbps
720p30 8 Mbps
720p60 8 Mbps

These are YouTube ingest recommendations, not guarantees of playback quality or connection stability. The YouTube settings page also gives minimum values and additional resolutions; consult its table for a format not listed here. YouTube transcodes live streams into multiple output formats.

Use a bitrate your upstream connection can sustain continuously. YouTube recommends keeping total outgoing bitrate within upload capacity and leaving 20% headroom. This is especially important on shared connections, where other traffic can consume capacity. Test upload speed rather than inferring it from advertised download speed. See YouTube’s streaming tips.

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.

Set keyframes, codec, audio, and picture format

Keyframe interval

YouTube recommends a keyframe every two seconds and says not to exceed four seconds. For fixed-frame-rate output, calculate the initial GOP as frame rate multiplied by two: at 30 fps, use 60 frames; at 60 fps, use 120 frames. Verify actual keyframe behavior for your chosen encoder rather than assuming the command options are honored identically by every encoder.

Codec and transport

YouTube lists H.264, H.265/HEVC, and AV1 for RTMP/RTMPS ingestion, up to 60 fps, and recommends RTMPS. H.264 is used in the example for a broadly applicable setup, but the right choice depends on the FFmpeg encoder available and YouTube’s current guidance. HDR and some alternate-codec workflows may call for HLS; HLS sends segments and therefore has higher latency. Check YouTube’s HLS setup guidance before choosing it.

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.

Audio and image format

  • YouTube lists AAC or MP3 audio. AAC is required for 5.1 audio over RTMP/RTMPS.
  • For stereo, YouTube recommends 128 kbps at 44.1 kHz; for 5.1, it recommends 384 kbps and 48 kHz.
  • Its advanced guidance recommends square pixels, progressive scan, two B-frames, one reference frame, and Rec. 709 for SDR.

The sample command is stereo SDR and sets sample rate and channel count explicitly. If your source uses a different frame rate, audio layout, color space, or HDR, configure the output accordingly instead of copying the example unchanged.

Prepare FFmpeg for continuous operation

Handle temporary output failures

FFmpeg’s RTMP FIFO muxer documentation includes an example that attempts recovery after certain temporary output failures using -attempt_recovery 1 and -recovery_wait_time 1. Recovery is an attempt, not a guarantee: it cannot cover every network outage, input failure, process crash, credential problem, or YouTube interruption. Review the FFmpeg full documentation for the FIFO muxer and encoder-specific options.

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

Supervise the process

For an unattended stream, run FFmpeg under a process supervisor, keep logs, and configure alerts so a stopped process or repeated reconnects are noticed. A reconnect mechanism does not replace supervision. Keep the stream key out of public scripts, screenshots, logs, and source-control repositories; regenerate it in YouTube if it is exposed.

Test with a representative stream

  1. Confirm that the input plays correctly and the FFmpeg build includes the encoder and protocol you plan to use.
  2. Run a test at the intended resolution, frame rate, audio layout, and motion level. Confirm the machine encodes in real time.
  3. Check YouTube Live Control Room’s stream health and messages, and watch FFmpeg logs for errors, encoding lag, or dropped frames.
  4. Test the connection while normal household or office traffic is present. Reduce bitrate or improve network capacity if sustained upload headroom is insufficient.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Plan for archives and long runs

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-stream duration. If you need a recording from a longer run, make a separate local recording or confirm YouTube’s current behavior and archive requirements. See YouTube’s encoder setup instructions.

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

Troubleshooting common FFmpeg live-stream problems

Symptom Likely cause What to check or change
Stream health reports unstable bitrate or dropped frames Insufficient sustained upload capacity, shared-network congestion, or bitrate spikes Measure upload capacity during representative use, preserve YouTube’s recommended 20% headroom, and lower the stream bitrate if necessary.
FFmpeg falls behind or reports encoding lag The selected encoder preset or output format exceeds the machine’s real-time capacity Test the target resolution and frame rate; choose a faster supported preset or a lower output format the machine can sustain.
FFmpeg rejects an encoder or protocol The installed build lacks the selected encoder or protocol support Check the build’s available encoders and protocol support, then select an available option compatible with YouTube.
Video appears choppy or keyframes are too far apart GOP settings do not correspond to output frame rate, or encoder behavior differs from expectations Set the interval based on frame rate (two seconds is the recommendation), then inspect actual output keyframes.
Output stops after a disconnect FIFO recovery cannot resolve the particular failure, or FFmpeg/input/process has stopped Inspect FFmpeg logs and input health; use process supervision and alerts, and verify credentials and network stability.
Authentication or ingest connection fails Incorrect ingest URL/key, exposed or revoked key, or unsupported transport configuration Copy the current ingest details from YouTube Live Control Room, protect the key, and verify RTMPS support in the FFmpeg build.

Copyright and YouTube live-stream rules

FFmpeg settings cannot establish that you have rights to the video or audio you stream. Use content you own or are licensed to broadcast, including music and footage, and check YouTube’s current live-stream and copyright requirements before starting. A technically healthy stream can still face platform restrictions if its content or account does not meet YouTube’s rules.

Or let it run in the cloud

If the goal is a continuous YouTube stream of uploaded recordings rather than a camera feed, StreamNeo is the #1 alternative to running FFmpeg on a computer: it keeps the stream running from the cloud, at any uploaded quality up to 4K 60fps for one flat price per slot, and the first day is free. Upload a recording or make a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; it automatically recovers if YouTube drops the stream. The first day is free with no card, and the monthly price is $9.99 per month. It streams to YouTube only, and plays uploaded videos rather than going live from a camera. Start your free 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.

More from the Screening Room

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
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.