You can broadcast and loop an existing video on YouTube Live from a Raspberry Pi using FFmpeg. Create a live event in YouTube Studio, then send the event’s server URL and private stream key from an FFmpeg command. The Pi must stay powered, connected to the internet, and able to decode and encode your chosen video reliably for the whole broadcast.
What you need before you start
- A YouTube channel with live streaming enabled. YouTube says first-time activation can take up to 24 hours.
- A Raspberry Pi with a supported FFmpeg build, the video file stored somewhere it can read, and a stable internet connection with enough upload capacity.
- The server URL and stream key for the specific YouTube Live event you plan to use.
There is no universally validated Raspberry Pi model, resolution, or upload-speed threshold for this setup. Source format, FFmpeg build, Pi performance, network stability, and heat all affect results. Begin with a short test at modest settings rather than assuming a particular Pi can encode any file at any quality.
Create the YouTube Live event
- Open YouTube Studio and go to Live Control Room. Create a stream or schedule one.
- In the event’s encoder or stream settings, copy the server URL and stream key exactly as displayed. Keep the key private: anyone who has it may be able to send video to your event.
- Leave the event open in Live Control Room so you can check the incoming signal and stream health after FFmpeg starts.
YouTube’s encoder workflow starts sending the broadcast when the encoder begins sending content. Stop the encoder to stop sending. Live activation for a channel that has never streamed before may take up to 24 hours, so do not leave that first setup until just before a scheduled broadcast. YouTube’s encoder setup guide covers event creation and stream-key use.
Install and check FFmpeg on the Pi
Use an FFmpeg build that can read your input file, encode the selected video and audio formats, and output through the RTMPS protocol. Package availability and codec support differ by operating system and build; verify the installed build’s capabilities before relying on a particular encoder or protocol. If the file is already in a compatible format, copying its streams may reduce Pi workload, but it is not guaranteed to work with every input or YouTube ingest configuration.
#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.
If FFmpeg cannot read the file or the Pi cannot encode it in real time, first try a lower-resolution or simpler test file. Transcoding a high-resolution video can be much more demanding than reading and forwarding compatible streams. The available evidence does not establish performance benchmarks across Pi models.
Start a looping broadcast with FFmpeg
Replace the quoted file path, server URL, and stream key below with your own values. This is an illustrative starting command, not a tested command for every Pi or a guarantee that every source file and FFmpeg build will work:
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.
ffmpeg -re -stream_loop -1 -i "/path/to/video.mp4"
-c:v libx264 -preset veryfast -b:v 2500k -maxrate 2500k -bufsize 5000k
-pix_fmt yuv420p -g 60 -c:a aac -b:a 128k -ar 44100
-f flv "rtmps://YOUR_SERVER_URL/YOUR_STREAM_KEY"
-rereads the file at its native rate so it is sent as a real-time broadcast rather than as fast as the Pi can process it.-stream_loop -1loops the input indefinitely. Put both options before the input’s-i. Remove-stream_loop -1if the stream should stop when the file ends.-c:v libx264selects software H.264 encoding in this example. Confirm that your FFmpeg build includes this encoder and that the Pi can sustain it at the source’s resolution and frame rate.-b:v,-maxrate, and-bufsizeset example video rate-control values; they are not a universal quality or bandwidth prescription. Choose settings that the Pi can encode and your connection can sustain.-g 60sets a 60-frame GOP in this example. YouTube recommends a two-second keyframe frequency and says not to exceed four seconds, so adjust the GOP to the frame rate you actually send. For example, a two-second interval at 30 fps is 60 frames.-c:a aac -b:a 128k -ar 44100selects AAC audio with example bitrate and sample rate. Check the source audio and the encoder’s actual output.- The final address must use the event’s real server URL and key, in the format required by the installed FFmpeg build. Do not publish the key in screenshots, logs, scripts shared publicly, or support requests.
FFmpeg documents -re as real-time input reading and -stream_loop -1 as infinite looping. Its available options and RTMPS support depend on the installed build. See the FFmpeg documentation and protocol documentation.
Choose settings and test stream health
YouTube recommends RTMPS, constant bitrate (CBR), and a two-second keyframe frequency, with keyframes no more than four seconds apart. Its current encoder guidance lists H.264, H.265/HEVC, and AV1 video, and AAC or MP3 audio. Do not assume a Pi’s FFmpeg build can encode every listed format in real time; confirm encoder availability and performance locally before choosing one. YouTube’s requirements and Live Control Room can change, so check its live encoder settings guidance when configuring a new stream.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.
- Run a test using video with motion and audio similar to the planned broadcast.
- Watch FFmpeg’s output for encoding errors, speed falling below real time, or dropped frames. Check CPU load and whether the Pi remains stable during the test.
- In Live Control Room, confirm the signal arrives and monitor YouTube’s stream-health messages.
- Test the actual network connection and intended broadcast duration. A brief successful test does not establish that the Pi, network, or power supply will stay reliable for a much longer stream.
A community Raspberry Pi project reports using 854×480 at 30 fps to stabilize ingest on its jittery uplink. That is one project’s configuration, not a minimum YouTube requirement or a setting guaranteed to work for another Pi, file, or network. The project is identified as YouTube-Pi4-StreamMachine.
Keep the stream running and understand the limits
With this method, the Pi is the encoder and the network connection is the route to YouTube. A power cut, network interruption, overheating, or encoding overload can interrupt the broadcast; this setup does not provide automatic recovery by itself. For a long-running stream, monitor the Pi and Live Control Room, and plan how you will restart FFmpeg and reconnect if the connection drops.
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
YouTube says streams shorter than 12 hours are automatically archived after the encoder stops sending. Do not rely on one continuous live event as a permanent, uninterrupted archive beyond that documented limit. See YouTube’s live stream guide for the current archive and encoder guidance.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting common failures
- YouTube does not show an incoming signal: Check that the event is open, the correct server URL and key were copied for that event, and the FFmpeg output URL matches the format expected by your build. Regenerate or re-copy the key if it may have been exposed.
- FFmpeg reports an unknown option or encoder: The installed build may not support that option or
libx264. Check the build’s available encoders and options; install or configure a compatible build before using the command. - The stream stutters or drops frames: Reduce resolution, frame rate, or encoding load for a test; check CPU usage, temperature, network stability, and upload capacity. No single bitrate or Pi specification is established as a guaranteed fix.
- Audio is missing or out of sync: Confirm the input has an audio stream, inspect FFmpeg’s messages, and test the source file independently. The example audio settings may need adjustment for the file and build.
- The video stops instead of repeating: Ensure
-stream_loop -1appears before-ifor the input you intend to loop. Remove it only when you want the broadcast to end at the file’s end. - YouTube reports poor stream health: Check the live encoder settings guidance, particularly RTMPS, CBR, and keyframe interval, then test again with representative content and a stable connection.
Or let it run in the cloud
If you want a prerecorded YouTube stream without leaving a Pi or computer running, StreamNeo runs the loop from the cloud: upload your video, add your YouTube stream key, and go live. Nothing has to stay powered on at home; uploads stream as made, up to 4K 60fps, at one price per slot; and StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card required. Monthly billing is $9.99 per month. Start your free StreamNeo day.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchQuick 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.




