You can loop a prerecorded video on a Raspberry Pi and send it to YouTube Live with FFmpeg. FFmpeg reads the file repeatedly, paces it like a live feed, and sends it to YouTube’s ingest destination; you then check the preview in YouTube Live Control Room and start the broadcast. The exact command and settings depend on your video’s codecs, frame rate, dimensions, audio, and whether your Pi can encode the chosen output.
What you need before you start
- A Raspberry Pi with a suitable power supply, storage, network connection, and an installed version of FFmpeg that supports the options used below.
- A local video file. Check its video and audio codecs, frame rate, dimensions, and whether it has an audio track. The right output settings depend on those properties.
- A YouTube channel eligible to create a live stream, with access to YouTube Live Control Room.
- An upload connection that can sustain the bitrate you choose. Measure the connection rather than assuming its advertised speed is available continuously.
There is no universal Raspberry Pi model recommendation for every source file. If the video already matches YouTube’s selected ingest format, copying its streams may avoid unnecessary encoding work. If conversion is needed, test the actual board at the intended resolution, frame rate, and bitrate; the workflow does not guarantee that a particular Pi can transcode a particular file.
Configure a YouTube live stream
- Open YouTube Live Control Room and create or schedule a stream using the encoder workflow.
- Copy the stream destination and stream key shown for the stream. Treat the key like a password: do not put it in a public script, repository, screenshot, or other shared location.
- Choose the output format and bitrate using YouTube’s current live encoder settings, bitrates, and resolutions. YouTube documents H.264, constant bitrate (CBR), up to 60 fps, and a two-second keyframe interval; do not exceed four seconds. The appropriate bitrate depends on resolution, frame rate, and latency configuration, so use the current table rather than a single bitrate copied from an unrelated setup.
- Use RTMPS when your encoder supports it. Google describes it as RTMP carried through an SSL connection; see Delivering Live YouTube Content via RTMPS.
Loop the video with FFmpeg
The loop and pacing portion of the command is:
ffmpeg -stream_loop -1 -re -i input.mp4 … OUTPUT
This is a command shape, not a complete publish-ready command. Replace input.mp4 with your file, and supply an output protocol and destination, stream key, stream mapping, codecs, bitrate, and other options that match the file and your YouTube settings. FFmpeg’s documentation defines -stream_loop -1 as repeating the input indefinitely. It is an input option, so put it before the corresponding -i. The -re option reads at the input’s native frame rate, which is useful when pacing a file as live output.
Choose between stream copy and transcoding
- Stream copy: If the source’s video and audio streams already meet the selected ingest requirements, copying them can reduce CPU work. Confirm compatibility before relying on it.
- Transcoding: If the source does not match the chosen format or settings, encode it to an appropriate output. Test the Pi under the actual workload; conversion performance varies with the board, source, and settings.
- Audio: Check whether the file has an audio stream and map or encode it appropriately. A silent preview may mean the source has no audio, the wrong stream was selected, or audio conversion is not configured as intended.
Do not paste a real stream key into a public example. Keep it in a suitably protected local configuration, and check file and script permissions if other people use the Pi.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#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.
Start, check, and monitor the broadcast
- Run the FFmpeg command on the Pi. Confirm that FFmpeg connects to the intended YouTube destination and is not reporting an input, codec, or network error.
- Return to Live Control Room and wait for the encoder preview. Check that the video moves, the expected audio is present, and the stream-health indicators do not show a problem.
- When the preview and settings are right, use the Live Control Room controls to go live if the selected workflow requires it. Starting the encoder and publishing the broadcast are distinct steps in YouTube’s encoder workflow.
- Monitor stream health while the session is running. YouTube says streams shorter than 12 hours are automatically archived; that archive behavior is not a guarantee that a stream will run without interruption for 12 hours.
Test continuous operation on your Pi
A command that loops a file does not by itself make a reliable unattended streaming system. Before relying on it for a long session, test the intended duration and verify the board, power supply, cooling, storage, source file, and uplink together. Separately configure and test what should happen after a reboot, network interruption, or FFmpeg failure. YouTube’s encoder guide explains how to start and end a stream, but it does not provide a Raspberry Pi reboot or recovery design.
Troubleshoot common problems
| Symptom | What to check | Practical fix |
|---|---|---|
| No preview appears in Live Control Room | Confirm FFmpeg is running, the destination and key are correct, and the Pi has a working network connection. | Correct the destination or key, restart the encoder, and check the preview again. Keep the key private while troubleshooting. |
| The preview is present but video does not move | Check that the input file can be read and that FFmpeg is pacing and processing the intended input. | Verify the file path and its properties. Confirm -stream_loop -1 is before the input’s -i and use -re for live pacing. |
| Video or audio is missing or wrong | Inspect the source’s streams and compare them with the command’s mapping and output settings. | Map the intended streams and configure any required conversion; test in preview before publishing. |
| YouTube reports stream-health issues | Compare the chosen codec, frame rate, keyframe interval, and bitrate with YouTube’s current settings guidance; check actual upload capacity. | Use a supported configuration, reduce the output demand if the uplink cannot sustain it, and test with similar motion and audio before a public session. |
| The stream stops after a restart or network interruption | A looping FFmpeg command alone does not define reboot supervision or network recovery. | Set up and test an appropriate service supervisor and restart behavior on your own Pi, including after power loss and network recovery. |
Or let it run in the cloud
If you want the loop without keeping a Raspberry Pi or other computer running at home, StreamNeo is a YouTube-only cloud service for keeping a channel live from uploaded videos. Upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops the uploaded video from the cloud; it does not broadcast a camera feed.
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.
- Nothing has to stay on at home: the stream runs in the cloud.
- One flat price per slot for any quality up to 4K 60fps, as uploaded, with no re-encode or quality tiers.
- Automatic recovery if YouTube drops the stream.
- The first day is free with no card; one free day is available per account.
Monthly: $9.99 per month. Start your free day with StreamNeo.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Copyright and YouTube policy checks
Looping a video technically does not establish that you have the right to broadcast it or that it complies with YouTube’s rules. Before streaming, confirm that you own or have permission to use the video and its audio, and review YouTube’s applicable copyright and live-stream requirements. Repeating a recording is not a substitute for making sure the content is eligible for your channel and intended use.
Quick 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.
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
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.
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.




