There is no universal FFmpeg reconnect flag. The right HTTP option depends on whether FFmpeg cannot connect, disconnects midstream, reaches EOF, or receives an HTTP error response. First identify the input protocol and the exact failure; the HTTP options below are not a general fix for RTSP, SRT, or other transports.
Identify what stopped the recording
Before changing flags, capture the complete FFmpeg error output, the output of ffmpeg -version, and the input URL scheme, such as https:// or rtsp://. Redact passwords, stream keys, signed URL parameters, and other credentials before sharing logs or URLs.
As an Amazon Associate I earn from qualifying purchases.
- Classify the failure. Did FFmpeg fail while opening or connecting, disconnect after media began, report EOF, or receive an HTTP status code? These are different cases, and FFmpeg documents different HTTP controls for them.
- Identify the protocol and build. The reconnect guidance in this article is for HTTP. If the input is not HTTP, consult the documentation for that protocol and verify that the installed build supports the relevant options. FFmpeg versions and packaged builds can differ.
- Check the command’s option order. FFmpeg options apply to the next input or output file and reset between files. Put HTTP input options before the relevant
-iURL; put recording/output options after the input. - Decide whether EOF is actually abnormal. EOF is expected at the end of a finite lesson recording. An endless or live source that unexpectedly closes is a different case.
- Choose a retry budget. A reconnect attempt is not a guarantee that recording continues indefinitely. Check the defaults and supported options for the FFmpeg binary you are running.
The FFmpeg project’s protocol documentation describes the HTTP behavior. Its command documentation explains option scope and placement.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Choose the HTTP option that matches the symptom
| Observed HTTP failure | Relevant option | What it means |
|---|---|---|
| Connection drops before EOF | reconnect |
Enables automatic reconnection when the HTTP connection is disconnected before EOF. |
| Source returns EOF, but it should continue | reconnect_at_eof |
Treats EOF as an error and reconnects. FFmpeg describes this as useful for live or endless streams; do not apply it automatically to a finite recording. |
| Input is streamed or non-seekable | reconnect_streamed |
Extends reconnect behavior to streamed or non-seekable inputs. |
| TCP/TLS error while connecting | reconnect_on_network_error |
Enables retries for TCP/TLS errors during the connection phase. |
| HTTP response status is causing failure | reconnect_on_http_error |
Accepts a comma-separated list of status codes, including individual codes or groups such as 4xx and 5xx. |
For HTTP errors, do not broaden the retry list without diagnosing the response. A repeated client error can indicate a persistent invalid request or access problem, not a temporary outage. FFmpeg’s respect_retry_after option honors a server’s Retry-After header rather than its exponential backoff; it is enabled by default in the documented HTTP behavior and is noted as useful for responses such as 429 and 503.
#1 Best Overall
- Pro performance with great pre-amps - Achieve a brighter recording thanks to the high performing mic pre-amps of the Scarlett 3rd Gen. A switchable Air mode will add extra clarity to your acoustic instruments when recording with your Solo 3rd Gen
- Get the perfect guitar and vocal take with - With two high-headroom instrument inputs to plug in your guitar or bass so that they shine through. Capture your voice and instruments without any unwanted clipping or distortion thanks to our Gain Halos
- Studio quality recording for your music & podcasts - Achieve pro sounding recordings with Scarlett 3rd Gen’s high-performance converters enabling you to record and mix at up to 24-bit/192kHz. Your recordings will retain all of their sonic qualities
- Low-noise for crystal clear listening - 2 low-noise balanced outputs provide clean audio playback with 3rd Gen. Hear all the nuances of your tracks or music from Spotify, Apple & Amazon Music. Plug-in headphones for private listening in high-fidelity
- Everything in the box: Includes Pro Tools Intro+, Ableton Live Lite, Cubase LE, and Hitmaker Expansion: a suite of essential effects, powerful software instruments, and easy-to-use mastering tools
Use a cautious HTTP command shape
This example shows placement, not a universal fix or a tested recipe. It assumes an HTTP input and a build that supports these options. The 30-second delay shown is illustrative, not a recommended value for every source.
ffmpeg
-reconnect 1
-reconnect_streamed 1
-reconnect_delay_max 30
-i 'https://stream.example.invalid/live.m3u8'
-c copy recording.ts
Here, the reconnect flags appear before -i, so they apply to the HTTP input that follows. The output options and destination appear after the input. Replace the example URL and output path with your actual source and recording destination.
Rank #2
- The new generation of the songwriter's interface: Plug in your mic and guitar and let Scarlett Solo 4th Gen bring big studio sound to wherever you make music
- Studio-quality sound: With a huge 120dB dynamic range, the newest generation of Scarlett uses the same converters as Focusrite’s flagship interfaces, found in the world's biggest studios
- Find your signature sound: Scarlett 4th Gen's improved Air mode lifts vocals and guitars to the front of the mix, adding musical presence and rich harmonic drive to your recordings
- All you need to record, mix and master your music: Includes industry-leading recording software and a full collection of record-making plugins
- Everything in the box: Includes Pro Tools Intro+, Ableton Live Lite, Cubase LE, and Hitmaker Expansion: a suite of essential effects, powerful software instruments, and easy-to-use mastering tools
Add -reconnect_at_eof 1 only if EOF is the failure on a source that is supposed to be live or endless. Consider -reconnect_on_network_error 1 for the documented TCP/TLS connection-error case, or -reconnect_on_http_error only after checking which HTTP response is being returned. Confirm option support and syntax against your installed FFmpeg build before relying on them.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Set realistic retry limits
HTTP retry behavior has delay and total-delay limits as well as an optional retry-count limit. In FFmpeg 8.1’s HTTP source, the maximum reconnect delay defaults to 120 seconds, the maximum total reconnect delay to 256 seconds, and the retry count is unset; Retry-After handling is enabled by default. These are defaults from that specific source version, not a promise that a recording will stay up. Other versions or packaged builds may differ. See the FFmpeg 8.1 HTTP source and inspect your own binary’s documentation and behavior.
Rank #3
- PLUG IN AND HEAR SOUND IN SECONDS - USB Type-A connector with a 3.5mm stereo headphone output and a separate 3.5mm mono microphone input. No drivers, no software, no external power - the adapter is USB bus-powered and is recognized as a standard USB audio device.
- WORKS ON WINDOWS, MAC AND LINUX - Driverless on Windows 98SE/ME/2000/XP/Server 2003/Vista/7/8, Linux and Mac OSX, and compliant with the USB Audio Device Class 1.0 specification, so any system that supports class-compliant USB audio will see it. Select it as the sound output and input device after plugging it in.
- TWO JACKS, TWO JOBS - The green jack is stereo OUT for headphones or powered speakers; the pink jack is mono microphone IN for a 3.5mm mic. It does NOT support 4-pole headsets on a single combo plug, it does NOT power passive speakers, and it does NOT add surround sound - it is a stereo 2-channel adapter.
- FOR LAPTOPS AND DESKTOPS THAT NEED AN AUDIO PORT BACK - Adds a headphone and mic port to a laptop, desktop, or mini PC whose onboard jack has failed or was never there. Managed and work-issued computers can block new USB audio devices by policy - check with your IT department before ordering for a company machine.
- SABRENT SUPPORT AND WARRANTY - What is in the box: one USB audio sound adapter. Backed by a 1-year limited warranty, extended to 2 years when you register within 90 days on the manufacturer's website.
Options such as reconnect_delay_max, reconnect_max_retries, and reconnect_delay_total_max let you shape the retry budget. Set them to match how long a source outage is tolerable and how quickly you need to detect a persistent failure. A retry budget governs attempts within FFmpeg’s HTTP input handling; it is not a process supervisor. If FFmpeg exits, keeping a recorder running again requires a separate process-management plan.
Troubleshoot recurring failures
FFmpeg exits immediately or cannot open the input
- Read the first relevant error lines and distinguish a connection failure from an HTTP response. A retry flag for a midstream disconnect may not address a failure to open the source.
- Verify the URL, access requirements, and whether the source is reachable using the same environment and credentials. Do not publish secret-bearing URLs in logs or support requests.
- If the URL is HTTP and the error is a TCP/TLS connection error, the documented connection-phase control is
reconnect_on_network_error. Confirm it exists in your build.
The recording stops after media has started
- For an HTTP disconnect before EOF, check whether
reconnectis enabled and correctly placed before the input. - If the source is streamed or non-seekable, check whether
reconnect_streamedis relevant. - Review the actual delay and retry limits for your version. If FFmpeg ultimately exits, input reconnect settings alone will not relaunch the process.
FFmpeg reports EOF
Determine whether the source is finite or intended to run endlessly. A finite lesson reaching its end is normal; reconnecting could cause it to start again when that is not wanted. For a live or endless HTTP source that unexpectedly reaches EOF, reconnect_at_eof is the documented option to consider.
Rank #4
- Podcast, Record, Live Stream, This Portable Audio Interface Covers it All - USB sound card for Mac or PC delivers 48kHz audio resolution for pristine recording every time
- Be ready for anything with this versatile M-AUDIO interface - Record guitar, vocals or line input signals with two combo XLR / Line / Instrument Inputs with phantom power
- Everything you Demand from an Audio Interface for Fuss-Free Monitoring - 1/4" headphone output and stereo 1/4" outputs for total monitoring flexibility; USB/Direct switch for zero latency monitoring
- Get the best out of your Microphones - M-Track Duo’s transparent Crystal Preamps guarantee optimal sound from all your microphones including condenser mics
- The MPC Production Experience - Includes MPC Beats Software complete with the essential production tools from Akai Professional
An HTTP status error keeps returning
Record the status code and diagnose the request, permissions, and source service before retrying it. If a status is confirmed to be transient, reconnect_on_http_error can target that code or an intentional group. FFmpeg respects a server’s Retry-After header by default according to its protocol documentation. Broadly retrying 4xx or 5xx responses can conceal a persistent error rather than resolve it.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteThe flags appear to have no effect
- Check that input options precede the matching
-iURL and that they have not been placed after a different input. - Confirm the input is HTTP. HTTP protocol options should not be assumed to fix another transport.
- Check the installed version and build rather than assuming the options or defaults match FFmpeg 8.1.
For a deeper description of connection and HTTP-status retry cases, see the FFmpeg project’s January 3, 2021 mailing-list change.
Best Value
- The new generation of the artist's interface: Connect your mic to Scarlett's 4th Gen mic pres. Plug in your guitar. Fire up the included software. Start making your first big hit
- Studio-quality sound: With a huge 120dB dynamic range, the newest generation of Scarlett uses the same converters as Focusrite’s flagship interfaces, found in the world's biggest studios
- Never lose a great take: Scarlett 4th Gen's Auto Gain sets the perfect level for your mic or guitar, and Clip Safe prevents clipping, so you can focus on the music
- Find your signature sound: Air mode lifts vocals and guitars to the front of the mix, adding musical presence and rich harmonic drive to your recordings
- With Scarlett 4th Gen, you have all you need to record, mix and master your music: Includes industry-leading recording software and a full collection of record-making plugins
Plan the recording destination separately
Reconnect flags address input behavior; they do not decide how much recording storage you need or how long to retain files. Estimate capacity from the stream’s bitrate, recording duration, and retention period, then monitor free space and plan what happens when storage fills. An external drive or NAS may be part of a retention setup, but neither fixes reconnect errors, and the right capacity depends on your own recording load.
Or let it run in the cloud
If your goal is to keep a YouTube channel live with uploaded education videos, rather than troubleshoot a local FFmpeg recording pipeline, StreamNeo is a separate cloud option: upload a recording or build a playlist, add your YouTube stream key, and go live. It streams uploaded videos to YouTube, not from a camera, and it does not repair an FFmpeg input connection.
Quick Recap
- Nothing has to stay on at home; the stream runs from the cloud.
- Every slot streams the uploaded file as made, up to 4K 60fps, at one flat price per slot.
- It automatically recovers if YouTube drops the stream.
- The first day is free with no card required.
- Monthly: $9.99 per month.
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.
Recommended Free Tools




