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
DocumentaryTube
FFmpeg

How to Send FFmpeg to YouTube’s Primary and Backup RTMP URLs

Use FFmpeg’s tee muxer to send mapped audio and video to YouTube’s primary and backup ingest URLs, then validate the event and its failover behavior in Live Control Room.

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

Use FFmpeg’s tee muxer to send the same encoded audio and video to YouTube’s primary and backup ingest addresses at once. Get both addresses—and the stream name/key—from the specific YouTube stream, map the intended streams explicitly, and test the event in Live Control Room. Sending to both addresses is concurrent redundant delivery; it does not by itself guarantee seamless failover for viewers.

Get YouTube’s primary and backup addresses

YouTube provides ingest details for each live stream. Its LiveStreams resource identifies the primary and backup addresses separately, along with the stream name. For RTMPS, use the RTMPS-specific fields; do not assume that changing an RTMP URL’s scheme produces a valid RTMPS endpoint. YouTube LiveStreams API documentation

  1. Open the stream’s encoder or ingestion details in YouTube, or retrieve its cdn.ingestionInfo fields through the API.

  2. Copy the primary address and backup address for the protocol you intend to use. For RTMP, use ingestionAddress and backupIngestionAddress; for RTMPS, use rtmpsIngestionAddress and rtmpsBackupIngestionAddress.

    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.
  3. Copy the matching streamName as well. Depending on how the encoder accepts credentials, YouTube’s URL and stream name may need to be entered separately or combined as STREAM_URL/STREAM_NAME. Use the values supplied for your stream rather than a generic example.

Treat the stream name/key like a password: do not share it in a public command, screenshot, tutorial, or log. YouTube live stream settings

Send both destinations with FFmpeg’s tee muxer

The tee muxer encodes the input once and distributes the resulting output to multiple destinations. Because tee does not choose streams automatically, specify the audio and video maps. Its destinations also need an output format, such as FLV for RTMP. FFmpeg tee muxer documentation

ffmpeg -re -i INPUT 
  -map 0:v -map 0:a 
  -c:v libx264 -c:a aac 
  -f tee 
  '[f=flv]PRIMARY_URL|[f=flv]BACKUP_URL'

Replace INPUT, PRIMARY_URL, and BACKUP_URL with your input and the complete YouTube destinations, including the stream name/key wherever the selected interface requires it. This is a schematic example, not a live-channel-tested command. Confirm that your FFmpeg build includes the selected encoders and muxer, and check shell quoting and special characters in the URLs for your operating system and FFmpeg version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

The tee muxer separates outputs with |; per-destination options appear in square brackets. If your stream has no audio, remove -map 0:a and the audio encoder option. If it has multiple audio or video streams, select the intended stream indices rather than blindly mapping all streams.

Choose what happens when one destination fails

By default, tee uses onfail=abort: failure of one output can stop the process. You can set onfail=ignore on an output so its failure is ignored while another output continues. That changes FFmpeg’s process behavior; it does not make YouTube switch viewers seamlessly to the other ingest.

FFmpeg also documents FIFO processing for isolating outputs with different latency or reliability and for supporting recovery. These options add operational complexity; use them only after reviewing the installed FFmpeg version’s tee/FIFO options and testing your configuration. FFmpeg FIFO muxer documentation

Choose RTMP or RTMPS deliberately

Use the address pair that matches the chosen protocol. YouTube describes RTMPS as RTMP carried through an SSL connection and recommends it for ordinary user content. Its requirements include a valid RTMPS endpoint and path, port 443, and the server hostname in the TLS SNI handshake. Your FFmpeg build and network path must support that TLS connection. YouTube RTMPS ingestion guide

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.

Do not turn an RTMP destination into RTMPS merely by replacing rtmp with rtmps. Copy YouTube’s RTMPS primary and backup addresses for the stream, preserving their hostnames and paths. This is particularly important where TLS SNI is required.

Set encoder parameters and protect the key

YouTube’s general RTMP/RTMPS encoder guidance lists H.264 video, AAC or MP3 audio, constant bitrate, and a recommended two-second keyframe interval that should not exceed four seconds. Choose resolution and bitrate for the source material and available upload bandwidth; no single bitrate fits every feed. YouTube encoder settings

  • Video: H.264 is the listed video codec guidance. Use a constant bitrate and set the keyframe interval to two seconds where possible, not over four seconds.

  • Audio: Use AAC or MP3 when sending audio.

  • Bandwidth: Set bitrate and resolution to match the intended stream and the capacity of the uplink that will send both destinations.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    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
  • Credentials: Keep the stream key private; YouTube characterizes it as password-like. Avoid embedding it in material that might be published or retained in shared logs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test both ingests before relying on them

  1. Start the FFmpeg command and check that it remains running without output-specific errors.

  2. Open the event preview in YouTube Live Control Room and verify that the expected audio and video arrive.

  3. Test the backup behavior under controlled conditions before depending on it. YouTube advises testing backup encoder failover by stopping the primary encoder; for a dual-destination FFmpeg setup, perform an equivalent end-to-end test and verify what viewers actually see.

    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.
    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.
  4. Repeat after changing the URLs, stream key, FFmpeg build, network, or relevant encoding configuration.

YouTube’s guidance recommends previewing and testing the setup rather than assuming it behaves as intended. The fact that the backup address can receive the same content simultaneously as the primary does not establish a guarantee of automatic, seamless viewer-side failover. YouTube streaming tips

Troubleshooting common failures

Symptom Likely area to check Next step
FFmpeg reports that it cannot open an output Address, stream name/key, protocol, or URL quoting Re-copy the correct primary and backup addresses for the selected protocol, confirm how the stream name is supplied, and check shell escaping for URL characters.
One destination fails and FFmpeg exits Tee’s default failure policy Review whether the default onfail=abort is appropriate. Consider onfail=ignore only if continuing on the other output is intended, then test the result.
RTMPS connection fails TLS support, port, endpoint, path, or SNI hostname Use YouTube’s RTMPS-specific address, verify port 443 connectivity and hostname/SNI handling, and confirm the FFmpeg build supports the required TLS connection.
Video arrives but audio does not Input stream mapping or audio encoder Check that the input contains audio, that -map 0:a selects it, and that the build supports the selected audio encoder.
Preview does not match the intended feed Wrong input, stream selection, or event destination Inspect the input and maps, verify both destination URLs belong to the intended YouTube stream, and check the Live Control Room preview.
Backup receives data but viewers do not switch as expected Ingest redundancy is not proof of viewer failover Test the event’s actual failover behavior with a controlled primary interruption; do not infer seamless viewer switching from successful dual delivery alone.

Or let it run in the cloud

If your goal is to keep a prerecorded YouTube stream live continuously rather than configure and maintain FFmpeg outputs yourself, StreamNeo runs uploaded videos or playlists from the cloud. Upload the recording, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams the upload as made, up to 4K 60fps, at one price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly: $9.99 per month. Start a free StreamNeo trial.

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.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Screening Room

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.