To make FFmpeg retry an internet radio source when its HTTP connection drops or unexpectedly reaches EOF, put the reconnect options before the source’s -i:
ffmpeg
-reconnect 1
-reconnect_at_eof 1
-reconnect_streamed 1
-reconnect_delay_max 30
-i "$RADIO_URL"
...output options...
"$YOUTUBE_RTMP_URL/$YOUTUBE_STREAM_KEY"
This is a starting pattern, not a tested station-specific command. These flags control FFmpeg’s HTTP input behavior; they do not restart FFmpeg if it exits or guarantee recovery of the radio station, your network, or the separate YouTube publishing connection.
What the reconnect options do
FFmpeg’s HTTP protocol options apply to the input URL immediately following them. Place them before the -i for the radio source, not just before the YouTube output. The options and their version-sensitive behavior are documented in the FFmpeg Protocols Documentation.
-reconnect 1asks FFmpeg to reconnect after a disconnect before EOF.-reconnect_at_eof 1treats EOF as an error and reconnects. This is useful for a live or endless source that should continue but sometimes closes unexpectedly.-reconnect_streamed 1permits reconnect attempts for streamed, non-seekable input. Many radio streams are continuous rather than seekable files.-reconnect_delay_max 30sets a maximum reconnect delay, in seconds. Choose a bound that fits your tolerance for interruption; a delay does not make an unavailable station recover.
The value 30 is an example, not a universal default or recommendation. FFmpeg also documents retry-count and total-delay controls, but option availability can vary by version and build. Check the local installation with ffmpeg -h protocol=http before relying on a flag.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#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.
Add retries for specific network or HTTP failures
Only expand the retry policy to match failures you see in logs. Retrying the wrong response can waste time without fixing the cause.
-reconnect_on_network_error 1requests retries for TCP/TLS errors during connection establishment. Use it when that is the observed failure and the installed build supports it.-reconnect_on_http_error 503,5xxselects HTTP statuses that should trigger retries; FFmpeg accepts explicit codes and classes such as4xxor5xx. A broad client-error retry policy is usually unhelpful: authentication, access, or malformed-request errors generally need a corrected URL, credential, or request.-respect_retry_after 1tells FFmpeg to honor a server’sRetry-Afterheader when present, rather than relying only on exponential backoff. This can matter for responses such as 429 or 503.
Confirm support and exact behavior in the HTTP protocol help for your installed FFmpeg version. Do not assume retry counts or delay limits are identical across builds.
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.
Build the complete radio-to-YouTube command
- Check the local options. Run
ffmpeg -h protocol=httpand confirm the reconnect flags you plan to use are available. - Put source options before its input. Replace
$RADIO_URLwith the station’s HTTP stream URL. Keep the reconnect flags immediately before-i "$RADIO_URL"so they configure that input. - Provide the output treatment. Add the required audio and, if the YouTube workflow requires it, video options before the output URL. An audio-led stream with a still image needs a video input or filter and an acceptable video stream; reconnecting the radio audio does not create or repair that visual component.
- Set the destination for the specific event. Replace the output placeholder with the ingest address and stream key shown in YouTube Studio for that live event. YouTube describes the stream key as the information that tells an encoder where to send the feed and lets YouTube accept it; keep it private. See Manage live stream settings.
- Test the full path. Check the YouTube preview and stream-health messages before relying on the setup. YouTube’s live encoder settings guide recommends testing and monitoring stream health.
The exact output command depends on the station’s format, any redirects or authentication, your still image or other visual treatment, and the event’s settings. No station, codec, playlist, or image is specified here, so the pattern above should not be treated as a verified end-to-end command.
Keep YouTube’s output settings separate from input reconnects
Reconnect options address reading the source, not configuring YouTube’s ingest. YouTube’s current encoder guidance lists RTMP/RTMPS ingestion; H.264, H.265/HEVC, and AV1 video codecs; frame rates up to 60 fps; CBR; and AAC or MP3 audio. It recommends RTMPS, a two-second keyframe interval, and not exceeding four seconds. Select settings for your chosen video treatment and event rather than assuming the input flags determine them. See YouTube’s encoder settings, bitrates, and resolutions.
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.
For bandwidth, YouTube advises leaving 20% headroom above the stream’s total sent bitrate and notes that connectivity disruptions can break a stream. See Streaming tips.
Diagnose which part stopped working
Reconnect flags are not an all-purpose restart mechanism. Identify the failing layer before changing the retry policy.
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
| Symptom or failure layer | What to check | What the reconnect flags can do |
|---|---|---|
| Radio HTTP input disconnects before EOF | FFmpeg logs, station availability, URL, and HTTP response | -reconnect 1 requests a retry after a pre-EOF disconnect. |
| Radio input reports unexpected EOF | Whether the station is expected to be continuous and whether EOF coincides with a station interruption | -reconnect_at_eof 1 treats EOF as an error; streamed sources may also need -reconnect_streamed 1. |
| Connection establishment fails | TCP/TLS errors and whether the station or network is reachable | -reconnect_on_network_error 1 may retry these errors if supported by the installed build. |
| HTTP response repeats | Status code and whether the URL, access, or credentials are valid | -reconnect_on_http_error can target selected statuses; retries cannot correct a bad request or access problem. |
| FFmpeg process exits | Exit status and process logs | Input reconnect options cannot revive a stopped process. A process supervisor or service manager is a separate way to relaunch it. |
| YouTube preview or ingest fails while input continues | Output address and key, encoder settings, preview, and YouTube stream-health messages | Input reconnect options do not recover the publishing connection. |
| Connection becomes unstable under load | Available outbound bandwidth versus total bitrate | Reconnects may not overcome a persistently constrained or disrupted network; leave the bandwidth margin YouTube advises. |
Or let it run in the cloud
For a YouTube channel that should keep prerecorded material looping, StreamNeo is a cloud alternative: upload a recording or playlist, add the YouTube stream key, and go live. Your computer and home connection do not have to stay on. It plays uploaded videos rather than broadcasting a live camera, and it streams to YouTube only.
- Each slot streams the uploaded quality, up to 4K 60fps, at one flat price per slot, with no re-encode or quality tiers.
- It loops videos and playlists 24/7 and automatically recovers if YouTube drops the stream.
- The first day is free with no card, once per account. Monthly billing is $9.99 per month.
See StreamNeo for details, or start the free first day.
Free tools Windows power users keep installed
One-click scans. No signup required.
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.




