For a continuous YouTube stream from a prerecorded file, start with YouTube’s recommended settings for your chosen resolution and frame rate, pace the file in real time with -re, and use FFmpeg’s RTMP FIFO recovery options for temporary output failures. For ordinary SDR 1080p30 H.264, a practical starting point is 14 Mbps video, AAC stereo at 128 kbps and 44.1 kHz, and a two-second keyframe interval. These are starting settings—not a universal preset: source format, encoder capacity, upload bandwidth, and stream duration all matter.
Recommended FFmpeg settings for 1080p30
This illustrative command sends a prerecorded MP4 to the ingest address and stream key supplied by YouTube Live Control Room:
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"
Replace the example input, ingest URL, and key with your own. Treat the stream key as a password: do not publish it, commit it to a shared repository, or include it in screenshots. The 28M buffer is an example value, not a YouTube requirement. This command is not a tested guarantee that a particular computer can encode in real time; confirm that your FFmpeg build supports the selected protocol and encoder.
What the options do
-rereads a file at its native rate instead of sending it as fast as FFmpeg can process it. Use it for file playback; omit it for a real-time capture device.-c:v libx264selects x264 H.264 encoding.-preset veryfasttrades compression efficiency for encoding speed; choose a preset your machine can sustain at the target resolution and frame rate.-b:v 14M -maxrate 14Mset target and maximum video rates in this example. YouTube specifies constant bitrate (CBR), but rate-control behavior depends on the encoder and its options. Check the selected encoder’s documentation and verify the output rather than assuming these flags alone guarantee strict CBR.-g 60 -keyint_min 60express a 60-frame GOP for a fixed 30 fps source—two seconds.-sc_threshold 0disables scene-cut keyframes in x264 so they do not change the intended interval. Confirm actual keyframe timing with your encoder.-pix_fmt yuv420pselects a commonly used progressive SDR pixel format. YouTube’s advanced guidance also recommends square pixels, progressive scan, two B-frames, one reference frame, and Rec. 709 for SDR.-c:a aac -b:a 128k -ar 44100 -ac 2encodes AAC stereo at YouTube’s recommended 128 kbps and 44.1 kHz for stereo.-f flvselects the FLV output format used for RTMP/RTMPS ingest.
Choose bitrate and GOP for the actual output
Do not carry the 1080p30 example bitrate into a different resolution, frame rate, or ingest codec. YouTube’s current encoder-settings page lists the following H.264 recommendations; it also provides minimum rates and recommendations for other formats, so consult its table when your configuration is not shown here.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors#1 Best Overall
- 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.
| H.264 output | YouTube recommended video bitrate | Two-second GOP example |
|---|---|---|
| 1080p30 | 14 Mbps | 60 frames |
| 1080p60 | 17 Mbps | 120 frames |
| 720p30 | 8 Mbps | 60 frames |
| 720p60 | 8 Mbps | 120 frames |
The GOP examples are calculated as frame rate multiplied by two. YouTube recommends a keyframe frequency of two seconds and says not to exceed four seconds. Match the output frame rate, not merely the source file’s label, and check that the encoder actually produces the intended interval.
YouTube lists H.264, H.265/HEVC, and AV1 for RTMP/RTMPS ingestion, with a maximum frame rate of 60 fps, and recommends RTMPS. H.264 is used in the example for a broadly compatible workflow. Choose another codec only when your FFmpeg build, YouTube’s current ingest guidance, and your playback requirements support it. HDR and some alternate-codec workflows may call for HLS; HLS sends segments and has higher latency.
Rank #2
- 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.
YouTube lists AAC or MP3 audio. AAC is required for 5.1 audio over RTMP/RTMPS. Its guidance recommends 44.1 kHz stereo or 48 kHz for 5.1, with 128 kbps stereo or 384 kbps 5.1. See YouTube’s encoder settings, bitrates, and resolutions for the full current table and picture recommendations.
Prepare FFmpeg for continuous operation
Use recovery for temporary RTMP output failures
FFmpeg’s RTMP FIFO muxer can attempt to recover after temporary output failures. For example, add the FIFO muxer and its recovery options to the output path:
Rank #3
- 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.
-f fifo -fifo_format flv -attempt_recovery 1 -recovery_wait_time 1 "rtmps://YOUTUBE_INGEST_URL/YOUR_STREAM_KEY"
This is an attempt to recover from certain output failures, not a guarantee against an internet outage, unreadable input, process crash, invalid credentials, or a YouTube-side interruption. Validate the exact options against your installed FFmpeg version and use process supervision, logs, and alerts for unattended operation. FFmpeg documents the FIFO recovery example in its full documentation.
Plan upload capacity and test the whole chain
- Keep the total outgoing stream bitrate within sustained upload capacity. YouTube recommends leaving 20% headroom; shared connections can reduce what is available to the encoder.
- Measure upload performance rather than inferring it from advertised download speed. A wired connection may help consistency where available, but cannot add upstream capacity to a limited internet plan.
- Run a realistic test with similar motion and audio before relying on the stream. Watch YouTube’s stream-health indicators and messages while it runs.
- Use logs and a supervisor that can restart the FFmpeg process if it exits; an output-recovery option cannot restart a crashed process.
FFmpeg documents -re and command-line options in its command-line documentation. YouTube’s guidance on bandwidth and network reliability is in its streaming tips.
Rank #4
- 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
Account for YouTube’s archive behavior
YouTube’s encoder setup instructions state that streams under 12 hours are automatically archived. That statement describes automatic archiving; it does not establish a general maximum live-stream duration. If you need an archive from a longer run, make a separate local recording or confirm YouTube’s current archive behavior and requirements. See YouTube’s encoder setup instructions.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common FFmpeg stream problems
| Symptom | Likely cause | What to check or change |
|---|---|---|
| Stream starts too fast or ends quickly | A file is being read faster than real time. | Use -re before the file input. Do not add it to a real-time capture input. |
| Encoding lag or dropped frames | The encoder cannot sustain the selected resolution, frame rate, or preset. | Test the same content and settings; choose a faster preset or a suitable hardware encoder, then verify output quality and keyframe behavior. |
| YouTube reports unstable or insufficient bitrate | Outgoing bitrate exceeds available upload capacity, or the connection varies. | Measure sustained upload capacity, leave YouTube’s recommended 20% headroom, and reduce output bitrate or resolution if needed. |
| Output disconnects and does not return | The failure may be outside the RTMP FIFO recovery cases, or FFmpeg may have exited. | Check FFmpeg logs, network access, ingest address, and stream key. Use process supervision for a stopped process; FIFO recovery is not a universal restart mechanism. |
| Picture or audio is rejected or incorrect | Pixel format, frame rate, codec, audio settings, or encoder behavior may not match the intended ingest setup. | Compare the actual output with YouTube’s current recommendations, including codec, bitrate, keyframes, audio sample rate, and channel count. |
Or let it run in the cloud
If your goal is a prerecorded YouTube channel that stays live without keeping a computer at home running, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded videos from the cloud, not a camera feed. The stream does not depend on your home computer staying on; uploads run as made, up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers; and StreamNeo attempts automatic recovery if YouTube drops the stream. The first day is free with no card, one free day per account. Monthly service costs $9.99 per month. Start your free StreamNeo day.
Recommended Free Tools
Quick Recap
Best Value
- 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.

