You can loop prerecorded files to YouTube Live from a Raspberry Pi by giving FFmpeg a local playlist, placing -stream_loop -1 before the playlist input, and sending the resulting feed to the RTMP or RTMPS URL and stream key shown in YouTube Live Control Room. This is a local-media workflow: a YouTube watch-page playlist URL is not the same as a playlist of files for FFmpeg, and the official documentation cited here does not establish that you can use the watch-page URL directly as an FFmpeg playlist.
What you need before starting
- A Raspberry Pi with FFmpeg installed and enough processing capacity for your chosen output. The available official documentation does not benchmark specific Pi models, so test your exact hardware, FFmpeg build, media, and settings.
- Prerecorded video files stored where FFmpeg can read them, plus a local text playlist that points to those files.
- A YouTube account with access to create a live stream, and the event’s server URL and stream key from Live Control Room.
- A stable upload connection with more available capacity than the stream’s target bitrate. YouTube recommends testing the connection and monitoring stream health; the published bitrates are recommendations, not guarantees for your network or Raspberry Pi.
- Permission to stream every video and audio track in the playlist. A live broadcast does not make copyrighted or otherwise unauthorized material safe to use.
Check your installed FFmpeg version and available formats before relying on a long-running setup. The exact playlist input and command depend on the build, file formats, stream layouts, and timestamps.
Create and schedule the YouTube Live event
- In YouTube Studio, create or schedule a live stream using an encoder workflow.
- Open the event’s stream settings in Live Control Room and copy the server URL and stream key. YouTube describes the key as password-like: keep it private, including from screenshots, public scripts, and shared shell history.
- Use the ingest protocol and URL YouTube provides for your account and event. YouTube’s current encoder guidance lists RTMP and RTMPS as supported protocols; availability and account setup should be confirmed in Live Control Room.
- If the key is exposed, reset it in Live Control Room before streaming again.
YouTube’s encoder setup instructions say streams under 12 hours are automatically archived. Do not assume a longer looping broadcast will be retained as one uninterrupted archive.
Build a local playlist of prerecorded files
Create a text playlist in a format supported by your installed FFmpeg build. One common approach is the concat demuxer, whose file list contains entries referring to local media files. For example, the list might contain:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors#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.
file '/home/pi/videos/part-1.mp4'
file '/home/pi/videos/part-2.mp4'
Save the list, for example, as /home/pi/videos/playlist.txt. Use paths that exist on the Pi and that the account running FFmpeg can read. Confirm concat-demuxer syntax and behavior in the official FFmpeg Formats Documentation and the documentation for your installed version.
Before streaming, inspect the playlist’s media. Different codecs, audio or video stream layouts, and timestamps can affect whether files join cleanly. If formats and timing already suit the output, stream copying may reduce CPU work; if they do not, transcoding may be required. Do not assume a copy-only command will work without checking the files and testing playback.
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.
Configure FFmpeg for YouTube ingest
-stream_loop is an input option, so it must appear before the -i that opens the playlist. In FFmpeg’s current command-line documentation, -1 means to loop indefinitely. A command’s overall shape is:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i /home/pi/videos/playlist.txt
-f flv "[YouTube server URL]/[STREAM_KEY]"
This is a structural example, not a ready-to-run command: replace the bracketed portions with the settings and credentials appropriate to your media and the URL shown by YouTube. Do not put a real stream key in a published command or an unprotected shared script. The input options must stay before the corresponding -i; output options belong after the input. Check option support and playlist behavior against the FFmpeg Documentation and the FFmpeg Formats Documentation for your installed build.
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.
The example shows one playlist input and one continuous output, but it does not prescribe encoding settings. Choose compatible video and audio codecs, output format, frame rate, and bitrate for your source, Pi, connection, and YouTube ingest. If the Pi cannot encode your selected format in real time, lower the workload or use compatible stream copying where the files permit it. The documentation available here provides no Raspberry Pi-specific performance benchmark.
YouTube’s published settings to use as a reference
YouTube’s current live encoder settings, bitrates, and resolutions page lists H.264, H.265, and AV1 video; AAC and MP3 audio; CBR; and up to 60 fps. It recommends a two-second keyframe interval and says it should not exceed four seconds. Follow the current settings for your codec, resolution, and frame rate rather than treating one bitrate as universal.
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
| Example SDR H.264 output | YouTube’s recommended bitrate | What the figure means |
|---|---|---|
| 1080p at 30 fps | 5 Mbps | YouTube platform recommendation on its current live encoder settings page, accessed in 2026; not a measured Raspberry Pi limit or a network reliability guarantee. |
| 720p at 30 fps | 3 Mbps | YouTube platform recommendation on its current live encoder settings page, accessed in 2026; not a measured Raspberry Pi limit or a network reliability guarantee. |
Use YouTube’s full table for other codec, resolution, and frame-rate combinations. Leave upload headroom rather than matching your connection’s measured maximum exactly, and test footage with representative motion and audio before the event.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Test the stream before relying on it
- Start FFmpeg and watch the event preview in Live Control Room. Confirm that video and audio appear and that the playlist advances and returns to its beginning as expected.
- Check YouTube’s stream health and FFmpeg’s output for dropped frames, connection errors, or resource pressure.
- Test for long enough to reveal problems that a short preview will miss, including transitions between playlist entries and the end-to-start loop.
- Only rely on the setup after it can run at the selected output settings without falling behind and the network remains stable.
Troubleshooting common failures
| Symptom | Likely cause | What to check or change |
|---|---|---|
| FFmpeg cannot open the playlist or a file | Incorrect path, permissions, playlist syntax, or unsupported demuxer option | Verify each file path and read permission; check the playlist format and installed FFmpeg documentation. |
| The playlist plays once instead of looping | -stream_loop -1 is missing or placed after the relevant -i |
Put the option before the playlist input and confirm the installed FFmpeg build supports the syntax. |
| YouTube does not receive the stream | Wrong server URL or stream key, event not ready, or ingest connection problem | Compare the destination with the current Live Control Room settings; confirm the event state and reset an exposed key. |
| Audio or video fails at a file boundary | Playlist entries have incompatible streams or timing | Inspect the media streams and timestamps; make entries compatible or transcode as needed. |
| Frames drop or the Pi cannot keep up | Encoding workload exceeds the target Pi’s capacity, or the selected settings are too demanding | Measure performance on the actual device; reduce resolution, frame rate, or encoding workload, or use stream copy only if the source streams fit. |
| Stream health reports instability | Insufficient or fluctuating upload capacity, or an overly ambitious bitrate | Test the connection, reduce bitrate to a sustainable level, retain headroom, and monitor health during the test. |
Or let it run in the cloud
If your goal is a 24/7 YouTube stream rather than learning and maintaining a Pi setup, StreamNeo keeps uploaded prerecorded videos looping from the cloud. Upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay powered on at home; StreamNeo streams the uploaded files 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, once per account. Monthly pricing is $9.99 per month. It is YouTube-only and does not go live from a camera. Start the free day with StreamNeo.
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.
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.




