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

For an ordinary stereo YouTube Live stream sent through RTMP/RTMPS, use AAC at 44.1 kHz, 128 Kbps, and two channels. To repeat a local video indefinitely, put FFmpeg’s input option -stream_loop -1 before that file’s -i. Use YouTube’s RTMPS endpoint and your own stream key, then test the stream in Live Control Room before relying on it.

Recommended AAC settings for YouTube Live

YouTube’s current live encoder guidance recommends AAC or MP3 for RTMP/RTMPS. For standard stereo audio, its recommended configuration is 44.1 kHz at 128 Kbps. In FFmpeg, request two channels with -ac 2. These are recommendations for compatibility, not a claim that other settings are technically impossible. YouTube’s live encoder settings also recommend RTMPS, a secure extension to RTMP.

Use case Codec Sample rate Bitrate Channels
Typical stereo live stream AAC 44.1 kHz 128 Kbps 2
5.1 surround over RTMP/RTMPS AAC required 48 kHz 384 Kbps 5.1

The 5.1 figures are YouTube’s listed recommendations; this guide’s command is for stereo, not surround sound.

FFmpeg command to loop a video to YouTube

For a file with video and audio, this is a practical starting pattern for RTMPS ingestion:

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 -stream_loop -1 -i input.mp4 
  -c:v libx264 
  -c:a aac -b:a 128k -ar 44100 -ac 2 
  -f flv 'rtmps://a.rtmp.youtube.com/live2/STREAM_KEY'
  1. Replace input.mp4. Use the path to the video you want to broadcast.
  2. Replace the endpoint and key placeholder. Use the actual server URL and stream key provided for your stream by YouTube Studio. Never publish a real key or leave it in a shared command, screenshot, or script.
  3. Run the command and check Live Control Room. Confirm that YouTube receives the stream and that audio and video behave as expected before making it public or depending on it.

This combines documented FFmpeg and YouTube settings; it is a starting example, not a command published or tested by either source. The libx264 choice does not set an appropriate video bitrate or guarantee a suitable encode for every machine or source. Choose video settings for the source, target resolution and frame rate, encoder capacity, and available upload rate. YouTube recommends constant bitrate (CBR) and a two-second keyframe interval, with four seconds as the maximum interval. Its video bitrate recommendations depend on codec, resolution, and frame rate; audio settings alone do not define a complete live configuration. See YouTube’s encoder settings.

How FFmpeg’s infinite input loop works

-stream_loop applies to an input file. A value of -1 repeats that input indefinitely; 0 means no looping. Place the option before the relevant -i, as in -stream_loop -1 -i input.mp4. If a command has multiple inputs, put the option before the -i for the file you want to repeat. See FFmpeg’s main options documentation.

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.

Looping controls input repetition; it does not guarantee an uninterrupted broadcast. File decode errors, timestamp or stream mismatches, high encoder load, network outages, a wrong stream key, or YouTube-side conditions can still interrupt a stream.

What the audio options do

  • -c:a aac selects FFmpeg’s native AAC encoder, the documented default AAC encoder.
  • -b:a 128k sets audio bitrate to 128 Kbps. FFmpeg documents that specifying this bitrate for its native AAC encoder activates CBR mode; writing it explicitly makes the intended value clear.
  • -ar 44100 requests a 44.1 kHz output sample rate.
  • -ac 2 requests two output channels.

These options request output characteristics; check the output from your locally installed FFmpeg build and source material rather than assuming every input is already stereo or at the target sample rate. FFmpeg documents the native AAC encoder and codec options in its codec options documentation.

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.
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.

RTMPS versus HLS

RTMP/RTMPS

The command above uses RTMPS with an FLV output, a workflow YouTube supports. YouTube recommends RTMPS for its secure transport. Follow the RTMP/RTMPS encoder settings for that workflow.

HLS

HLS is a separate YouTube ingestion route, not a protocol you can select by changing the endpoint in the RTMP/FLV example. YouTube’s HLS guidance also lists AAC and recommends 44.1 kHz stereo at 128 Kbps, but HLS has its own HTTPS, playlist, and segment requirements. Ultra-low latency is unavailable with HLS. If you choose HLS, follow YouTube’s HLS setup instructions rather than reusing the RTMP command.

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

Bandwidth and pre-stream checks

Audio is only one part of the stream’s total bitrate. Account for the selected video codec, resolution, and frame rate, then leave network capacity beyond the combined stream bitrate. YouTube’s streaming tips recommend 20 percent upload-bandwidth headroom.

  • Test before the intended broadcast, with audio and motion similar to the real content.
  • Check that YouTube receives both audio and video and monitor stream health in Live Control Room.
  • Verify that the stream key and server URL match the stream configuration in YouTube Studio. YouTube explains stream setup and encoder key entry in Manage live stream settings.
  • Confirm that the source plays cleanly through its end and that looping returns to the beginning without a decode failure.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and fixes

YouTube receives video but no sound

Check that the input actually contains an audio stream and that the command includes -c:a aac. Confirm YouTube’s preview and stream health during a test, and inspect FFmpeg’s output for audio mapping or encoder errors.

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.

The audio format or channel count is unexpected

Make the output request explicit with -ar 44100 -ac 2 -b:a 128k, then verify the resulting stream. A request does not repair a damaged source or guarantee that every build and input behaves identically.

The stream will not connect

Check the actual YouTube server URL and key, ensure the key has not been mistyped or revoked, and confirm that your network can reach the RTMPS endpoint. Test in Live Control Room rather than assuming that a locally running FFmpeg process means YouTube is receiving a valid stream.

Playback stops at the end of the file

Put -stream_loop -1 before the input’s -i. If the option follows -i, it may not apply to the intended input.

The stream drops or stutters despite looping

Looping does not address upload instability, insufficient headroom, encoder overload, source errors, or platform-side interruptions. Check FFmpeg logs, reduce demands on the encoder or network as appropriate, and run a representative test while watching stream health.

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

Or let it run in the cloud

If the goal is a continuously looping YouTube channel rather than learning or operating FFmpeg, StreamNeo runs uploaded videos from the cloud: upload a recording or build a playlist, 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 flat price per slot. It can automatically recover if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month.

Start your free StreamNeo day.

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.