To make an FFmpeg stream reconnect after YouTube drops it, run FFmpeg under a retry loop or service manager that starts a fresh FFmpeg process when the publisher exits. Keep the YouTube Live Control Room server URL and stream key available to each restart. FFmpeg’s documented -reconnect options are for HTTP connections; they are not generic RTMP(S) output-retry controls.
Why FFmpeg does not automatically retry this publishing connection
FFmpeg’s protocol documentation describes options such as reconnect, reconnect_on_network_error and reconnect_delay_max in its HTTP protocol section. They can apply to HTTP inputs, but the documentation does not define them as general-purpose RTMP(S) output reconnection options. Adding those flags to an RTMP(S) publishing command is therefore not a reliable fix. Use an external supervisor to relaunch FFmpeg after a failed publishing process instead. FFmpeg Protocols Documentation
A relaunch creates a new publishing connection; it does not guarantee a seamless handoff or that YouTube will keep the same viewer-facing live event uninterrupted. If the source is a local cartoon file, the relaunched process may start the file from the beginning.
Set up the YouTube connection and cartoon input
- In YouTube Live Control Room, create or open the live stream and copy its exact server URL and stream key. Use the RTMPS ingest URL if your FFmpeg build and publishing setup support it. YouTube’s encoder guide explains where to obtain the server URL and key: Create a YouTube live stream with an encoder.
- Keep the stream key private. Do not publish it in a command example, shared script, or logs. For a persistent service, inject it securely rather than embedding it in a file that other users can read.
- Choose settings for the actual source and intended output. For a prerecorded local file,
-repaces reading in real time and-stream_loop -1loops the input indefinitely. Put both before-i. Do not use these file-specific options blindly with a live input. - Match the output codec, resolution, frame rate and bitrate to YouTube’s current encoder guidance and your upload capacity. YouTube recommends constant bitrate (CBR) and keyframes every 2 seconds, with a maximum interval of 4 seconds. Its current guide lists H.264 at 1080p30 with a recommended video bitrate of 10 Mbps; use the matching row for your actual resolution, frame rate and codec rather than treating that figure as universal. YouTube also lists stereo audio at 44.1 kHz and 128 kbps. These are YouTube Help recommendations accessed 2026-10-03; the page does not display a publication year. Choose live encoder settings, bitrates, and resolutions
For an RTMPS connection failure, verify that the URL is exact and that the encoder supports RTMPS. YouTube notes that specifying port 443 may help with an SSL error when the encoder supports it. RTMPS setup and troubleshooting are covered in Encrypt your stream using RTMPS.
#1 Best Overall
- 𝐇𝐢𝐠𝐡-𝐒𝐩𝐞𝐞𝐝 𝐔𝐒𝐁 𝐄𝐭𝐡𝐞𝐫𝐧𝐞𝐭 𝐀𝐝𝐚𝐩𝐭𝐞𝐫 - UE306 is a USB 3.0 Type-A to RJ45 Ethernet adapter that adds a reliable wired network port to your laptop, tablet, or Ultrabook. It delivers fast and stable 10/100/1000 Mbps wired connections to your computer or tablet via a router or network switch, making it ideal for file transfers, HD video streaming, online gaming, and video conferencing.
- 𝐔𝐒𝐁 𝟑.𝟎 𝐟𝐨𝐫 𝐅𝐚𝐬𝐭𝐞𝐫, 𝐌𝐨𝐫𝐞 𝐒𝐭𝐚𝐛𝐥𝐞 𝐃𝐚𝐭𝐚 𝐓𝐫𝐚𝐧𝐬𝐟𝐞𝐫𝐬- Powered via USB 3.0, this adapter provides high-speed Gigabit Ethernet without the need for external power(10/100/1000Mbps). Backward compatible with USB 2.0/1.1, it ensures reliable performance across a wide range of devices.
- 𝐒𝐮𝐩𝐩𝐨𝐫𝐭𝐬 𝐍𝐢𝐧𝐭𝐞𝐧𝐝𝐨 𝐒𝐰𝐢𝐭𝐜𝐡- Easily connect your Nintendo Switch to a wired network for faster downloads and a more stable online gaming experience compared to Wi-Fi.
- 𝐏𝐥𝐮𝐠 𝐚𝐧𝐝 𝐏𝐥𝐚𝐲- No driver required for Nintendo Switch, Windows 11/10/8.1/8, and Linux. Simply connect and enjoy instant wired internet access without complicated setup.
- 𝐁𝐫𝐨𝐚𝐝 𝐃𝐞𝐯𝐢𝐜𝐞 𝐂𝐨𝐦𝐩𝐚𝐭𝐢𝐛𝐢𝐥𝐢𝐭𝐲- Supports Nintendo Switch, PCs, laptops, Ultrabooks, tablets, and other USB-powered web devices; works with network equipment including modems, routers, and switches.
Restart FFmpeg after a failed publish
Illustrative shell retry loop
This shell example is a starting point, not a tested universal command. It assumes a local file, an FFmpeg build with the libx264 encoder, a compatible YouTube ingest configuration, and environment variables containing the server URL and key. The example uses 4500 kbps video and a 60-frame GOP only as sample values; select the bitrate from YouTube’s current table for the chosen output, and set the GOP to approximately two seconds at the actual frame rate.
#!/bin/sh
while :; do
ffmpeg -re -stream_loop -1 -i cartoon.mp4
-c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k
-g 60 -keyint_min 60 -sc_threshold 0
-c:a aac -b:a 128k -f flv "$YOUTUBE_RTMPS_URL/$YOUTUBE_STREAM_KEY"
status=$?
[ "$status" -eq 0 ] && exit 0
sleep 5
done
Replace the sample file and settings with your actual source and output configuration. Confirm that the server URL and key form the expected destination for your YouTube stream. The loop waits five seconds after any nonzero FFmpeg exit, then starts a new process. It exits after a successful FFmpeg exit, which treats that exit as an intentional completion. If your broadcast should continue after a clean exit too, adjust the policy deliberately rather than restarting unconditionally.
Rank #2
- Connects a USB 3.0 device (computer/laptop) to a router, modem, or network switch to deliver Gigabit Ethernet to your network connection. Does not support Smart TV or gaming consoles (e.g.Nintendo Switch).
- Supported features include Wake-on-LAN function, Green Ethernet & IEEE 802.3az-2010 (Energy Efficient Ethernet)
- Supports IPv4/IPv6 pack Checksum Offload Engine (COE) to reduce Cental Processing Unit (CPU) loading
- Compatible with Windows 8.1 or higher, Mac OS
A fixed delay is simple but can retry too quickly during a persistent outage or configuration error. For a long-running channel, prefer a service manager configured to restart failures, apply increasing delays with a maximum, start at boot if needed, and distinguish intentional shutdown from failure. A shell loop is a simpler option for a one-off run, but it should handle signals and deliberate stops so shutdown does not trigger another launch.
Check whether the restart is addressing the real failure
Watch both the FFmpeg log and YouTube Live Control Room’s stream-health status. A supervisor can recover from some transient publishing interruptions by opening a new connection; it cannot correct a missing input file, invalid codec settings, a wrong or revoked key, a malformed URL, or a persistently unavailable network.
Rank #3
- [Expansion Ports] The USB C to Ethernet Adapter expands the device to three USB 3.0 ports and one Gigabit Ethernet port. Provides you more peripheral ports while maintaining a stable network connection, plug and play, no driver required.
- [Gigabit Network Port] ALL-LUCKY USB Ethernet Adapter transmission rate up to 1000Mbps, also compatible with 10/100Mbps bandwidth. It allows you to enjoy a smooth and stable network connection and avoid too much lag. (Note: To reach 1Gbps, please use CAT6 or above Ethernet cable connection)
- [Convertible Connector]This usb hub with ethernet not only has USB-A connector, but also can be converted to USB-C connector, so that you can easily convert the connector according to the device port, improve the convenience of use.
- [High-Speed Data Transfer] The usb to ethernet adapter adopts USB 3.0 transmission technology, supports up to 5Gbps transmission rate, and is compatible with USB 2.0(480Gbps),USB 1.0(12Mbps), easily transfer video, files and other data for you in seconds. (Note: Maximum output current is 900mA, does not support charging devices.)
- [Widely Compatible]The usb c ethernet adapter for iMac, MacBook Pro, iPad Pro, XPS and many other devices. Compatible with Windows 11/10/8.1/8, Mac OS, iPad OS, Chrome OS.(Note: Driver is required on Win 7) It can be used in office, school, library and other occasions, compact and portable, easy to carry around.
- FFmpeg exits and does not reconnect: confirm that the supervisor is running, its restart policy covers the exit status, and it can read the command’s environment and input file.
- Repeated authentication or connection failure: recopy the exact server URL and current stream key from Live Control Room, check the RTMPS URL and encoder support, and avoid exposing the key while troubleshooting.
- The process runs but YouTube reports poor stream health: compare the actual output to YouTube’s bitrate, codec, resolution and frame-rate guidance. Test whether the upload path can sustain the selected bitrate; lower the output setting if the connection cannot reliably carry it.
- The cartoon restarts at the beginning: this is expected if the supervisor launches the same local-file command again with looping enabled. If episode continuity matters, use a workflow that tracks playback position; a basic process restart does not preserve it.
- Disconnects continue on unstable Wi-Fi: test a wired Ethernet connection. A different local network connection may help stability, but it does not add retry behavior to FFmpeg.
Test the full recovery path before the intended broadcast using representative motion and audio. Confirm that FFmpeg exits on a simulated interruption, the supervisor relaunches it, YouTube receives the new connection, and the chosen bitrate is sustainable.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or let it run in the cloud
If your goal is to keep a prerecorded cartoon looping on YouTube without maintaining a computer at home, StreamNeo runs the uploaded video from the cloud. Upload the cartoon, add your YouTube stream key, and go live. Nothing has to stay on at home; the video streams as uploaded at any quality up to 4K 60fps for one flat price per slot, with automatic recovery if YouTube drops the connection. The first day is free with no card. Monthly pricing is $9.99 per month. Start your free day with StreamNeo.
Quick Recap
Best Value
- COMPACT DESIGN - The compact-designed portable BENFEI USB A/C to Ethernet adapter connects your computer or tablet to a router,modem or network switch for network connection. It adds a standard RJ45 port to your Ultrabook, notebook or Macbook Air for file transferring, video conferencing, gaming, and HD video streaming.
- SUPERIOR STABILITY - Built-in advanced IC chip works as the bridge between RJ45 Ethernet cable and your USB A/C devices. The driver-free installation with native driver support in Chrome, Mac, and Windows OS; The USB A/C Ethernet adapter dongle supports important performance features including Wake-on-Lan (WoL), Full-Duplex (FDX) and Half-Duplex (HDX) Ethernet, Crossover Detection, Backpressure Routing, Auto-Correction (Auto MDIX).
- INCREDIBLE PERFORMANCE - Supports full 10/100/1000Mbps gigabit ethernet performance over USB A/C's 5Gbps bus, faster and more reliable than most wireless connections. Link and Activity LEDs. USB powered, no external power required. Backward compatible with USB 2.0/1.1.✅ To reach 1Gbps, make sure to use CAT6 & up Ethernet cables.
- BROAD COMPATIBILITY - The USB A/C-Ethernet adapter is compatible with Windows 11/10/8.1/8/7/Vista/XP, Mac OSX 10.6/10.7/10.8/10.9/10.10/10.11/10.12, Linux kernel 3.x/2.6, Android and Chrome OS.Compatible with IEEE 802.3, IEEE 802.3u and IEEE 802.3ab. Supports IEEE 802.3az (Energy Efficient Ethernet).❌Do Not Support Windows RT. (NOT compatible with Nintendo Switch.)
- 18 MONTH WARRANTY - Exclusive BENFEI Unconditional 18-month Warranty ensures long-time satisfaction of your purchase; Friendly and easy-to-reach customer service to solve your problems timely.
Rank #4
- The Anker Advantage: Join the 65 million+ powered by our leading technology.
- Instant Internet: Connect to the internet instantly from virtually any USB-C 3.0 device, and enjoy stable connection speeds of up to 1 Gbps.
- Lightweight and Compact: The space-saving and portable design measures just over half an inch thick and weighs about the same as a AA battery.
- Premium Build: Features a sleek aluminum exterior and braided-nylon cable to complement the design of high-end devices.
- What You Get: PowerExpand USB-C to Gigabit Ethernet Adapter, welcome guide, 18-month worry-free 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.

