You can send an authorized sequence of local video files from a Raspberry Pi 3 to YouTube Live with FFmpeg, but the reliable approach depends on your files, FFmpeg build, Pi revision, and upload connection. FFmpeg’s -stream_loop -1 option repeats a single supported input indefinitely; it does not create a multi-file playlist by itself. This guide shows how to prepare the YouTube encoder connection, loop one file, and handle multi-file sequencing without treating public YouTube videos as cleared for rebroadcast.
Before you start: use media you can rebroadcast
Use video and audio that you own, have licensed for live rebroadcast, or are otherwise authorized to deliver. YouTube’s video and audio formatting guidance says the uploader must be the copyright holder or the copyright owner’s authorized representative for delivered files. A video being publicly viewable or included in a YouTube playlist does not, by itself, grant permission to download or rebroadcast it.
As an Amazon Associate I earn from qualifying purchases.
- Prepare local media files that you are entitled to use.
- Check the license terms for music, footage, and any other included audio or video.
- Do not use a YouTube URL as a source unless you have independently established both the rights and a lawful, permitted method of obtaining and rebroadcasting that content.
This tutorial covers local files. It does not establish the rights status of any particular work or settle every applicable legal or platform rule.
What the Raspberry Pi 3 workflow involves
The Pi reads media, encodes or packages it into a live stream, and sends it to YouTube’s ingest server using the server URL and private stream key from YouTube Live Control Room. Keep the stream key private: anyone with access to it may be able to broadcast to your channel’s stream.
- Prepare authorized media and confirm that your installed FFmpeg can read it.
- Enable YouTube Live and create or prepare the live stream in Live Control Room.
- Choose a resolution, frame rate, and bitrate that suit both the content and your sustained upload connection.
- Run FFmpeg with the YouTube ingest URL and stream key.
- Check YouTube’s stream health and messages, and test the complete setup before depending on it.
YouTube says first-time live streaming activation may take up to 24 hours. Complete that step well before a planned broadcast. See YouTube’s encoder-based live streaming instructions for the current Live Control Room workflow.
Choose settings that fit your connection
YouTube’s current encoder guidance supports RTMP or RTMPS ingest, H.264, H.265/HEVC, or AV1 video in the listed encoder modes, AAC or MP3 audio, constant bitrate (CBR), and a recommended keyframe interval of two seconds, not exceeding four seconds. YouTube recommends RTMPS, which encrypts the transport connection. For a common H.264 workflow, its published recommended bitrates include:
| Target video | YouTube-recommended H.264 bitrate |
|---|---|
| 480p30 | 4 Mbps |
| 720p60 | 8 Mbps |
| 1080p30 | 14 Mbps |
| 1080p60 | 17 Mbps |
These are YouTube ingest recommendations, not performance measurements of a Raspberry Pi 3. Leave upload headroom for network variation and other traffic rather than setting the stream equal to the connection’s best brief speed-test result. Match the output resolution and frame rate to the source where practical; avoid choosing a high target simply because YouTube lists it.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- Includes Made in UK Raspberry Pi 3 B+ (B Plus) with 1.4 GHz 64-bit Quad-Core Processor, 1 GB RAM
- Dual Band 2.4GHz and 5GHz IEEE 802.11.b/g/n/ac Wireless LAN, Enhanced Ethernet Performance
- Includes 32 GB EVO+ Micro SD Card (Class 10) Pre-loaded with OS, USB MicroSD Card Reader
- CanaKit 2.5A USB Power Supply with Micro USB Cable and Noise Filter - Specially designed for the Raspberry Pi 3 B+ (UL Listed)
- Premium Raspberry Pi 3 B+ Case, Display Cable, 2 x Heat Sinks, GPIO Quick Reference Card, CanaKit Full Color Quick-Start Guide
FFmpeg’s exact encoder options vary by build and by whether encoding is done in software or through an available hardware path. Inspect your installed build with ffmpeg -version and ffmpeg -encoders, and confirm the chosen encoder and options are supported. The available evidence does not establish a reliable Pi 3 performance ceiling for playlist retrieval and encoding, so test the entire intended setup and monitor CPU load, temperature, dropped frames, upload stability, and YouTube stream health.
Get the YouTube ingest URL and stream key
- Open YouTube Studio and go to Create > Go live to open Live Control Room.
- Create or select the stream and locate its stream settings. Copy the server URL and stream key shown for that stream.
- Keep the key private. Do not paste it into a public script repository, screenshot, forum post, or shared log.
- Use the current RTMPS server address supplied by YouTube when available. The address is account/stream-specific information shown in Live Control Room; do not substitute a guessed ingest URL.
- Start FFmpeg after the YouTube stream is ready, then confirm that Live Control Room receives the encoder feed and reports healthy status before starting the public broadcast.
Labels and layout in YouTube Studio may change. Follow the stream’s current settings in Live Control Room rather than relying on an old screenshot or hard-coded server URL.
Loop one authorized file indefinitely
FFmpeg documents -stream_loop -1 as an infinite input loop. It is an input option, so it belongs before the corresponding -i. A basic command shape for a local file is:
Rank #3
- Includes Raspberry Pi 3 B+ (B plus) with 1.4 GHz 64-bit Quad-Core Processor and 1 GB RAM
- CanaKit 2.5A USB Power Supply with Micro USB Cable and Noise Filter - Specially designed for the Raspberry Pi 3 B+ (UL Listed)
- Dual band 2.4GHz and 5GHz IEEE 802.11.b/g/n/ac wireless LAN, Enhanced Ethernet Capability
- Premium Clear Case, Set of 2 Aluminum Heat Sinks
- CanaKit Quick-Start Guide
ffmpeg -re -stream_loop -1 -i "/path/to/authorized-video.mp4"
-c:v libx264 -preset veryfast -b:v 4M -maxrate 4M -bufsize 8M
-pix_fmt yuv420p -g 60 -keyint_min 60 -sc_threshold 0
-c:a aac -b:a 128k -ar 44100
-f flv "YOUR_RTMPS_SERVER_URL/YOUR_STREAM_KEY"
This is an illustrative command template, not a claim that every Raspberry Pi 3 or FFmpeg build can sustain these settings. It assumes an input frame rate of 30 fps for the 60-frame GOP/keyframe interval and uses 4 Mbps video as a YouTube recommendation for 480p30; adapt the resolution, frame rate, bitrate, and keyframe interval to the source and connection. If the source is not 480p30, or if its audio/video format differs, adjust the settings accordingly. Replace the path and ingest values with your own. Do not expose the real key when sharing a command.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute-rereads the file at its intended playback rate rather than sending it as fast as the Pi can process it.-stream_loop -1repeats this input indefinitely. Its position before-imatters.-c:v libx264selects the x264 software encoder if it exists in the build. Check withffmpeg -encoders; another encoder requires its own supported options.-b:v,-maxrate, and-bufsizeset rate-control values; choose values suitable for the selected output and connection.-g 60and-keyint_min 60request a 60-frame interval, which is two seconds at 30 fps. At another frame rate, set the frame count to keep the interval near two seconds and no more than four seconds.-c:a aacand the audio options encode audio as AAC. If the file has no audio, or the audio format differs, revise the command to match the input and desired output.-f flvis commonly used for RTMP-family output. YouTube’s current ingest settings determine the endpoint and supported workflow.
FFmpeg’s option descriptions are in its official documentation; see the main options section for -stream_loop. Confirm the command against the installed version and the actual media file before using it for a sustained stream.
Play several files in sequence
-stream_loop -1 repeats one input; it does not turn a list of files into a playlist. For a sequence, create a local playlist in a format your FFmpeg build can read, or use another sequencing method you have validated for that build. One common FFmpeg approach is the concat demuxer, which reads a text manifest.
For compatible files with matching streams and parameters, create a manifest such as playlist.txt:
file '/media/video-01.mp4'
file '/media/video-02.mp4'
file '/media/video-03.mp4'
Then use the concat input with looping before that input:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i "/path/to/playlist.txt"
-c:v libx264 -preset veryfast -b:v 4M -maxrate 4M -bufsize 8M
-pix_fmt yuv420p -g 60 -keyint_min 60 -sc_threshold 0
-c:a aac -b:a 128k -ar 44100
-f flv "YOUR_RTMPS_SERVER_URL/YOUR_STREAM_KEY"
The manifest uses absolute paths here, so -safe 0 permits those paths. Only use trusted local manifest entries. The concat demuxer is sensitive to compatibility: files should have matching codecs, stream layout, time bases, and parameters. If they differ, direct concatenation may fail, produce glitches, or behave unexpectedly. Check support with your installed build and test transitions. A more controlled alternative is to normalize each source into compatible media before streaming, at the cost of additional preparation and storage.
Best Value
- 1.4GHz 64-bit quad-core ARMv8 CPU, 1 GB RAM
- 802.11n Wireless LAN, 10/100Mbps Lan Speed
- Bluetooth 4.2, Bluetooth Low Energy
- 4 USB ports, 40 GPIO pins, Full HDMI port, Combined 3.5mm audio jack and composite video
- Camera interface (CSI),Display interface (DSI), Micro SD card slot (now push-pull rather than push-push), VideoCore IV 3D graphics core
Do not assume every FFmpeg playlist format behaves the same way, or that a playlist of remote YouTube links is equivalent to a local manifest. The yt-dlp documentation describes downloading and piping media, but does not establish that arbitrary YouTube-to-YouTube rebroadcasting is authorized. Use the local-file workflow unless you have separately confirmed the rights and permitted handling of each source.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Test and monitor the full stream
- Test a representative segment containing the motion, scene changes, and audio levels found in the actual playlist.
- Run the intended resolution, frame rate, codec, audio settings, and bitrate—not a lower-load test configuration—long enough to expose heat or network instability.
- Watch FFmpeg output for encoder errors, input read failures, dropped frames, or output disconnects.
- Watch YouTube Live Control Room for stream health, processing messages, and whether the expected video and audio arrive.
- Check the Pi’s temperature and CPU load during the test. If the system throttles or cannot keep up, lower the workload, prepare compatible files in advance, or use a different streaming setup.
- Keep the stream key secure and have a way to stop FFmpeg and correct the configuration if the stream is wrong.
The available sources do not establish a tested Raspberry Pi 3 limit for simultaneous playlist handling and encoding. A successful short test is useful but does not prove that a longer run will remain stable under different room temperatures, network conditions, or media complexity.
Troubleshoot common failures
| Symptom | Likely cause | What to check |
|---|---|---|
| YouTube does not receive a signal | Wrong server URL or key, stream not enabled, network issue, or unsupported output | Copy the current ingest details from Live Control Room, verify the key privately, and inspect FFmpeg’s connection errors. |
| Live activation is unavailable | First-time live enablement is still processing | Enable live streaming in advance; YouTube says initial activation may take up to 24 hours. |
| Video buffers, drops frames, or reports poor health | Insufficient sustained upload bandwidth, unstable connection, or encoder overload | Reduce resolution, frame rate, or bitrate; check other network use, Pi CPU and temperature, and YouTube’s stream-health messages. |
| FFmpeg cannot find the encoder or rejects an option | The installed build differs from the command assumptions | Check ffmpeg -version and ffmpeg -encoders; select a supported encoder and consult that version’s option documentation. |
| The playlist stops at a file boundary or plays incorrectly | Incompatible media streams, invalid manifest paths, or a concat input problem | Check each path and format, test the files together locally, and normalize incompatible sources before relying on the sequence. |
| Audio is missing, distorted, or out of sync | Input audio differs from the assumed layout or conversion settings | Inspect the input streams with FFmpeg, adjust audio encoding and sample-rate settings, and test representative transitions. |
| Stream suddenly ends | Network interruption, FFmpeg exit, power loss, or Pi instability | Review FFmpeg and system logs, verify power and network stability, and repeat a long-duration test. Recovery behavior is not guaranteed by this command. |
Or let it run in the cloud
If your goal is to keep an uploaded video or playlist live on YouTube without leaving the Pi or another home computer running, StreamNeo is a cloud option: upload your recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; it loops from the cloud, supports any uploaded quality 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 billing is $9.99 per month. StreamNeo streams to YouTube and plays uploaded videos; it is not a camera-live service. Start the free day with StreamNeo.
Recommended Free Tools
Quick Recap
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.




