A “Broken pipe” error means FFmpeg could not write output to its YouTube connection; the message alone does not identify why. The cause could be a network interruption, a closed or rejected ingest connection, an invalid or stale stream URL or key, an ended YouTube session, or another failure earlier in the input-to-output chain. Check the FFmpeg log and YouTube Live Control Room before changing encoding flags.
1. Find where the failure starts
Save the complete FFmpeg output around the first error, not just the final “Broken pipe” line. Note whether the input is still advancing, whether the failure occurred while opening the connection or later while writing, and the exact time it happened.
At the same time, open YouTube Live Control Room and check the stream’s state, health indicators, and timestamped error messages. YouTube distinguishes critical errors from moderate quality problems; unresolved errors continue to appear. A health message at the same time as FFmpeg’s write failure can help identify whether the issue is ingest configuration, stream quality, or a dropped connection. YouTube’s live stream troubleshooting guide describes its error messages.
No command line or log is available here, so the failing layer cannot be identified more precisely. If you ask for help, share the command and surrounding log with the stream key, credentials, and private URLs removed.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →#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.
2. Verify YouTube’s current ingest URL and stream key
- In YouTube Live Control Room, open the stream’s settings and confirm the active stream URL and key.
- Make sure FFmpeg is using the matching server URL and the current key. Do not assume an old key or saved endpoint is still valid.
- If you intend to use RTMPS, copy the RTMPS URL from the stream settings (use the lock icon to reveal it) rather than changing an RTMP address by guesswork. YouTube recommends RTMPS for encrypted transport and says to confirm that the encoder supports it.
For a related SSL error, YouTube says to verify that both the protocol and server use rtmps. If the URL appears correct but the SSL error remains, its guidance suggests port 443 and checking encoder support. Those steps address connection or SSL errors specifically; they are not a universal fix for every broken pipe. See YouTube’s RTMPS troubleshooting guidance.
3. Match FFmpeg’s stream settings to YouTube’s configuration
Use the resolution and bitrate selected for the YouTube stream and the Live Control Room’s health feedback. YouTube’s encoder guidance supports RTMP/RTMPS and lists H.264, H.265, and AV1, up to 60 fps. It recommends constant bitrate (CBR) and a keyframe interval of two seconds; do not exceed four seconds. Supported settings depend on the selected codec and stream configuration, so do not paste a preset without checking it against the active ingest settings.
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.
| H.264 example from YouTube guidance | Minimum bitrate | Recommended bitrate |
|---|---|---|
| 720p at 30 fps | 3 Mbps | 8 Mbps |
| 1080p at 30 fps | 5 Mbps | 14 Mbps |
These are YouTube-published encoder settings, not estimates of what your internet connection can sustain. The recommended value varies with resolution, frame rate, and codec. YouTube’s encoder settings and bitrate guidance also notes possible errors involving unsupported codecs or profiles, unsupported audio, wrong resolution or bitrate, missing or multiple audio/video streams, and frame-rate or keyframe mismatches. Correct the specific mismatch reported by YouTube, then test again.
4. Check upload capacity and connection reliability
- Run an upload speed test, as YouTube recommends, and compare the sustainable upload rate with the selected stream bitrate.
- Account for other traffic using the connection. A speed result that briefly reaches the target does not establish that the connection can sustain it throughout a live stream.
- If upload capacity is low or variable, reduce the resolution or bitrate and test again.
- Test with representative video motion and audio before going live, then monitor stream health during the event.
YouTube advises choosing a quality reliable on the available connection. Its encoder guidance says, “We recommend running a speed test to test your upload bitrate” and “Make sure to test before you start your live stream.” See YouTube’s live encoder settings.
Recommended Free Tools
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.
FFmpeg’s TCP protocol documentation describes tcp_keepalive, which is disabled by default and enables basic operating-system SO_KEEPALIVE behavior. It can help detect dead peers on long-lived, idle connections; it does not repair a broken route or guarantee that a stream will recover. It is most relevant when the connection is idle, not as a general fix for a stream that is actively failing to write. See FFmpeg protocol documentation.
5. Decide whether direct output or FIFO recovery fits
Direct output: simplest, but no FIFO retry layer
With direct output, FFmpeg writes to the RTMP or RTMPS endpoint without FIFO’s separate queue and recovery options. This is the simpler setup. If the connection fails, diagnose the cause and restart deliberately rather than assuming FFmpeg will resume the same YouTube session.
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
FIFO output: a recovery option for temporary output failures
FFmpeg’s FIFO pseudo-muxer queues packets and runs the actual muxer in another thread. Its attempt_recovery option can restart output after a failure. This may help when the input continues and the output failure is transient; it does not prove that YouTube or the network is healthy and does not guarantee seamless continuation of the live session.
The following adapts FFmpeg’s documented RTMP example. Replace INPUT and the illustrative endpoint with your actual values. Keep the stream key private:
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.
ffmpeg -re -i INPUT
-c:v libx264 -c:a aac
-f fifo -fifo_format flv
-drop_pkts_on_overflow 1
-attempt_recovery 1
-recovery_wait_time 1
-map 0:v -map 0:a
'rtmp://YOUR_CURRENT_YOUTUBE_INGEST_URL/YOUR_STREAM_KEY'
Check the installed FFmpeg build and its format documentation before relying on options in a live production setup. In this example, attempt_recovery is enabled; its default is false. The documented default recovery wait is five seconds, while the example sets it to one. max_recovery_attempts defaults to zero, meaning unlimited attempts. A production service may need a finite limit and deliberate process supervision.
Choose how a full FIFO queue behaves
-drop_pkts_on_overflow 1lets encoding continue instead of blocking when the FIFO queue fills, but packets are omitted. The stream may have a visible or audible gap.- Without dropping packets, a full queue can block progress. Keeping packets and maintaining real-time output are different priorities; neither choice fixes a prolonged outage.
- The FIFO queue defaults to 60 packets. Increasing it can buffer more media, but also increases queued data and is not a cure for a sustained connection failure.
- FFmpeg documents
restart_with_keyframefor waiting for a keyframe after recovery. Consider whether a clean video restart suits the stream, and test the behavior in a controlled session.
Retrying blindly may not restore publishing if the stream was intentionally stopped, the key is invalid, the ingest server rejects the configuration, or YouTube no longer accepts output for that session. Check Live Control Room before assuming a reconnect will preserve the event.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.6. Troubleshoot by symptom
| What you see | What to check next |
|---|---|
| Broken pipe appears shortly after FFmpeg connects | Check the current stream URL and key, the selected protocol, and whether YouTube reports an ingest or configuration error. Confirm the stream session is active. |
| An SSL or secure-connection error appears | For RTMPS, verify both the server and protocol use rtmps, use the URL provided in YouTube’s stream settings, and confirm the FFmpeg encoder supports RTMPS. YouTube also suggests port 443 when the URL appears correct but an SSL error remains. |
| YouTube reports a codec, resolution, bitrate, audio, frame-rate, or keyframe error | Change the setting YouTube identifies and check the current encoder recommendations for that resolution, frame rate, and codec. |
| Stream health worsens when video is active or other devices are online | Test sustained upload capacity, account for competing traffic, and reduce the bitrate or resolution if needed. Retest with representative motion and audio. |
| The input continues but output failures come and go | Consider FIFO recovery for transient output failures, decide whether packet loss or blocking is acceptable, and test before relying on it live. |
| FFmpeg retries, but YouTube does not resume the event | Check Live Control Room and the session state. Recovery options do not guarantee continuity after an intentional stop, rejected key, or ended session. |
Or let it run in the cloud
If your goal is to keep uploaded videos playing on a YouTube channel 24/7, StreamNeo is an alternative to maintaining an FFmpeg process and connection at home. Upload a recording or build a playlist, add your YouTube stream key once, and go live; StreamNeo loops the videos from the cloud, so your computer and home connection do not have to stay on. It is for uploaded videos, not a live camera feed, and streams to YouTube only.
Quick Recap
- One price per slot for any quality up to 4K 60fps, streamed as uploaded without re-encoding or quality tiers.
- Automatic recovery if YouTube drops the stream.
- The first day is free with no card required (one free day per account). The Monthly price is $9.99 per month.
See StreamNeo or start your free first 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.
Free tools Windows power users keep installed
One-click scans. No signup required.




