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
VGSources
4K streaming

How to Automatically Restart FFmpeg if a 4K 60fps YouTube Live Stream Stops

FFmpeg’s FIFO muxer can retry a failing output while the process runs; an external supervisor is needed to restart an exited process. Here’s how to configure and test both recovery layers for YouTube 4K/60 streaming.

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

Use two recovery layers, because they address different failures: FFmpeg’s FIFO muxer can retry a temporarily failing output while the FFmpeg process is still running; a separate supervisor must restart FFmpeg if the process exits. If FFmpeg remains alive but is stuck, you also need a liveness or progress check—the FIFO retry alone is not a process restart.

First identify what stopped

“The stream stopped” can mean several things. Check the FFmpeg process and its logs before choosing a fix:

  • FFmpeg is running and processing, but the network output has failed: FIFO output recovery may retry the connection.
  • FFmpeg exited: FIFO cannot restart a process that is no longer running. Use an external supervisor to launch it again.
  • FFmpeg is running but appears stalled: a supervisor that only watches for process exit may not notice. Add an independent liveness or progress check if you need to recover from hangs.

These layers can be combined: FIFO handles some temporary output failures; a supervisor handles process exit. Neither guarantees that YouTube will resume the broadcast exactly as before in every stream configuration, so test the complete recovery path in advance.

Configure FIFO recovery for a temporary output failure

The FFmpeg manual documents the FIFO muxer as an approach to network-output recovery. Its example is an illustrative RTMP command, not a tested YouTube command:

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 -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://example.com/live/stream_name

Replace INPUT, the example destination, codecs and stream maps with the values for your actual source and YouTube ingest configuration. Keep your real stream key private; do not put it in a public script, screenshot or log. Check the installed build’s supported FIFO options with ffmpeg -h muxer=fifo and consult the manual matching that FFmpeg version.

What the recovery options do

  • -attempt_recovery 1 enables attempts to recover a failing output.
  • -recovery_wait_time 1 makes this example wait one second between recovery attempts. The documented default is five seconds.
  • -drop_pkts_on_overflow 1 allows queued packets to be dropped if the FIFO fills rather than blocking the encoder. That trades preservation of every packet for continued processing; dropped packets mean omitted content.
  • max_recovery_attempts defaults to 0, documented as unlimited attempts. Set a limit only if that is the behavior you want.
  • restart_with_keyframe defaults to false. Check the version-matched manual before changing it.

The FIFO muxer retries output while FFmpeg remains alive. It does not detect or relaunch an exited process, and it is not a remedy for a process that is alive but wedged.

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.

Restart FFmpeg when the process exits

Use a service manager or watchdog appropriate to the host—such as systemd on a Linux system that uses it, Windows service or task tooling, macOS launchd, or a container orchestrator. Configure it to start the FFmpeg command, restart after an exit with a deliberate delay or backoff, and preserve useful logs. If a hung process must also be recovered, configure a separate health or progress check; an exit-only policy cannot detect a process that never exits.

There is no single supervisor configuration that fits every operating system and deployment, and the appropriate configuration depends on your host. A basic shell loop can relaunch a command after it exits, but without a delay or restart limit it can spin rapidly, and it does not by itself detect a live but stalled process. Whatever supervisor you choose, make its restart policy explicit and make sure you can inspect FFmpeg’s exit status and logs.

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.

Match the 4K/60-fps output to YouTube’s published settings

YouTube’s encoder-settings page, accessed in 2026, gives different 2160p-at-60-fps bitrate recommendations depending on ingest codec. These are published encoder settings, not a guarantee that your encoder, upload connection or recovery setup can sustain the stream.

Ingest codec Minimum bitrate Recommended bitrate
H.264 14 Mbps 50 Mbps
AV1 or H.265 10 Mbps 35 Mbps
  • Resolution and frame rate: confirm that the actual encoder output is 3840 × 2160 at 60 fps; a source file’s label alone does not establish the output settings.
  • Bitrate mode: YouTube lists CBR.
  • Keyframes: YouTube recommends a two-second interval and says not to exceed four seconds. At an actual 60 fps, two seconds is 120 frames, so a 120-frame GOP corresponds to that interval only if the output really is 60 fps.
  • Protocol: YouTube lists RTMP and RTMPS as supported and recommends RTMPS.

YouTube says encoder settings are detected automatically by default, but recommends testing with representative audio and motion and monitoring stream health and messages during the event. Verify the installed encoder’s actual resolution, frame rate, codec, bitrate mode and keyframe interval rather than copying a setting from a 30-fps example.

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

Reconnect the encoder and verify YouTube’s stream state

  1. In the encoder configuration, enter YouTube’s Live server URL and stream key for the intended stream. Treat the key like a credential and keep it out of public scripts and logs.
  2. When restarting an already configured stream, preserve the intended stream and encoder configuration. Confirm that the destination and key are still the ones for the stream you mean to run.
  3. Check the FFmpeg process and logs to establish whether it exited, is still running but blocked, or remains active while output has failed.
  4. After recovery, check YouTube Live Control Room for the expected preview, stream health and messages. In YouTube’s documented scheduled-stream workflow, wait for the preview and then click Go live. Do not assume scheduled and unscheduled streams have identical live-state behavior after an automatic encoder restart.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a failed recovery

Symptom What to check Next action
The stream drops, but FFmpeg is still running FFmpeg logs, process activity and the installed FIFO muxer’s supported options Check whether output recovery is enabled and whether the failure is one FIFO can retry. Confirm that the FIFO is not blocking or overflowing in a way that prevents the behavior you expect.
FFmpeg exits and stays down Exit status and the last FFmpeg log messages Configure an external supervisor to restart on exit, with a deliberate delay or backoff and retained logs.
The supervisor reports FFmpeg as running, but the stream does not advance Whether the process is making progress, not merely whether its PID exists Add an independent liveness or progress check if stalled processes are in scope; an exit-only restart policy will not catch them.
FFmpeg reconnects, but YouTube does not show the expected preview or stream health Server URL, stream key, stream configuration and Live Control Room status Verify the intended encoder configuration and inspect YouTube’s messages. Follow the applicable scheduled-stream workflow rather than assuming the stream is already live.
The restored stream is not actually 4K at 60 fps Actual output dimensions, frame rate, codec, CBR target and keyframe interval Compare the encoder output with YouTube’s published 2160p/60 settings above; confirm that a 120-frame GOP is being used only with a true 60-fps output.

Test before relying on automatic recovery

  1. Run the intended FFmpeg command with representative video and audio, then confirm its output settings.
  2. Test a temporary output interruption and observe whether FIFO recovery retries while the process remains alive.
  3. Separately test how the host supervisor handles an FFmpeg exit. If you need hung-process recovery, test that health check too.
  4. Confirm the result in Live Control Room, including preview, stream health and any messages.

Testing these cases separately shows which recovery layer is working; a successful process restart alone does not prove that the YouTube broadcast returned to the intended state.

Or let it run in the cloud

If your goal is to keep an uploaded video looping on YouTube rather than to run a live camera or a custom FFmpeg pipeline, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. The cloud keeps the loop running without a computer or home connection left on, and automatically recovers if YouTube drops the stream. Each slot streams the uploaded quality up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers. The first day is free with no card; the monthly option is $9.99 per month. Start the free first 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 *

Free tools Windows power users keep installed

One-click scans. No signup required.

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

More from Patch Notes

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.