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

You can send authorized local media from a Raspberry Pi 3 to YouTube Live with FFmpeg by preparing the files, looping a supported input or arranging a sequence, and publishing to the ingest URL and private stream key shown in YouTube Live Control Room. FFmpeg’s infinite-loop option covers one input; it does not by itself create a multi-file playlist. Test the complete setup on your Pi before relying on it for a long broadcast: no cited benchmark establishes a Raspberry Pi 3’s sustained streaming capacity.

Before you start

This guide is for files you own, have licensed, or are otherwise authorized to rebroadcast. A public YouTube video or a video’s inclusion in a playlist does not establish permission to retransmit it. YouTube’s delivery guidance says the uploader must be the copyright holder or the authorized representative for the video and audio delivered to YouTube. See YouTube’s video and audio formatting specifications.

  • A Raspberry Pi 3 with a working operating system, power supply, and network connection.
  • A current FFmpeg installation that supports your media’s container, video, and audio codecs. Check the installed build with ffmpeg -version.
  • Local media files that FFmpeg can read, with rebroadcast rights cleared.
  • A YouTube channel with live streaming enabled. First-time activation may take up to 24 hours, according to YouTube’s live streaming setup guidance.
  • Sustained upload bandwidth sufficient for your selected video bitrate, plus capacity for network overhead and ordinary variation.

Configure YouTube Live and protect the stream key

  1. Open YouTube Studio and go to Create > Go live to open Live Control Room. Create or select the live event you intend to use.
  2. In the encoder or stream settings shown for that event, copy YouTube’s server or stream URL and the stream key. These are account- and event-specific; use the values currently displayed in Live Control Room rather than a URL copied from an old tutorial. YouTube’s encoder setup is documented at Set up your encoder for live streaming.
  3. Keep the key private. Treat it like a password: do not publish it in a script shared online, a screenshot, or a public repository. If it is exposed, replace or reset it in YouTube Studio before streaming again.
  4. Set up the event and its visibility, title, and other controls in YouTube before starting FFmpeg. Start the encoder only when the event is ready to receive its feed.

Choose settings your Pi and connection can sustain

YouTube’s current encoder guidance supports RTMP or RTMPS ingest, H.264, H.265/HEVC, or AV1 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 connection. For a straightforward FFmpeg setup, H.264 video and AAC audio are common choices; verify that your installed FFmpeg build and Pi can handle the selected encoding path. See YouTube’s encoder settings, bitrates, and resolutions.

The following are YouTube’s published H.264 bitrate recommendations, not measurements of Raspberry Pi 3 performance:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Output target YouTube recommended H.264 bitrate
480p at 30 fps 4 Mbps
720p at 60 fps 8 Mbps
1080p at 30 fps 14 Mbps
1080p at 60 fps 17 Mbps

Choose a target based on the source file, the Pi’s observed behavior, and a measured sustained upload rate—not just the line’s advertised maximum. Leave headroom for network fluctuations. Set the output resolution and frame rate deliberately, and use a two-second keyframe interval. If the Pi cannot encode reliably at the intended settings, lower the resolution, frame rate, or bitrate and test again. The cited guidance does not establish a universal Pi 3 performance ceiling.

Loop one local file indefinitely

For one authorized file, FFmpeg’s -stream_loop -1 input option repeats that input indefinitely. Place it before the corresponding -i. The example below uses a placeholder for the private ingest address and key; replace it with the RTMPS URL and key displayed for your event. The example assumes a source FFmpeg can decode and a build that can encode H.264 and AAC.

Rank #2
CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)
  • 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 -re -stream_loop -1 -i "/home/pi/media/video.mp4" 
  -c:v libx264 -preset veryfast -b:v 4000k -maxrate 4000k -bufsize 8000k 
  -r 30 -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "YOUR_RTMPS_INGEST_URL/YOUR_STREAM_KEY"

This example targets 480p30 only if the input is already 480p or you add an appropriate scale filter; it does not resize the source as written. The 4000k video bitrate corresponds to YouTube’s 4 Mbps H.264 recommendation for 480p30, but the Pi still needs to decode and encode the actual input. The -g 60 setting at 30 fps requests a 2-second GOP/keyframe interval. Adapt resolution and bitrate together for your intended output, and confirm the resulting stream settings and health in Live Control Room.

-re reads the file at its native playback rate rather than sending it as fast as possible. FFmpeg documents -stream_loop as repeating an input, with -1 meaning an infinite loop; see FFmpeg’s main options. Because this is an input option, keep it before the relevant -i.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply
  • 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

Play multiple local files in sequence

Looping one input is not the same as playing a playlist of different files. The loop option repeats the same input; it does not discover playlist entries or advance through a directory. Prepare and validate a sequence using a playlist or concat workflow supported by your installed FFmpeg build, then apply looping to that sequence only after confirming how the chosen input method behaves. File paths containing spaces, inconsistent codecs, differing resolutions, and mismatched audio layouts can all cause sequence errors or visible transitions.

There is no single playlist command included here because a valid command depends on how the media is prepared and on the formats and FFmpeg build in use. Do not substitute arbitrary YouTube playlist URLs: the available evidence does not establish a current, tested extraction-and-rebroadcast workflow, and public availability is not permission. For reliability, keep the authorized source files locally and verify that the entire sequence plays in order before connecting it to a live event.

Test the full setup and monitor the broadcast

  1. Run a local playback or short encoding test with the exact files and settings you plan to use. Check that video and audio decode, loop or advance as intended, and do not drift out of sync.
  2. Start the YouTube event in Live Control Room, then launch FFmpeg with the event’s current RTMPS ingest URL and key.
  3. Watch YouTube’s stream health and any encoder messages while sending representative movement and audio. Confirm the event receives the expected resolution, frame rate, and audio.
  4. Observe the Pi’s CPU load, temperature, memory, and network stability during a sustained test. If frames are dropped, the stream disconnects, or the device throttles, reduce the encoding workload or improve the setup and repeat the test.
  5. Keep an operator able to stop FFmpeg and respond to YouTube warnings, local power/network interruptions, or source-file errors. A command running on a Pi is not a guarantee of uninterrupted broadcasting.

Troubleshooting common failures

  • YouTube does not receive a signal: Confirm the event is ready, live streaming is enabled, and the server URL and stream key were copied from that event. Check for stray spaces or shell characters in the URL, and ensure the Pi can reach the network. Replace a key that may have been exposed.
  • Authentication or ingest errors: Recopy the current stream key and ingest URL from Live Control Room. Do not rely on a saved value from a different event. Check that the output uses a format and transport YouTube accepts.
  • FFmpeg reports an unknown option or encoder: Check ffmpeg -version and ffmpeg -encoders. The installed build may lack the chosen encoder or differ from the command’s assumptions; use a supported encoder and adjust the command accordingly.
  • Input or playlist cannot be opened: Check file paths, permissions, mounted storage, and supported codecs. A multi-file sequence requires a separately prepared playlist/sequence input; -stream_loop -1 alone only repeats one input.
  • Choppy output, dropped frames, or overheating: The cause may be CPU load, thermal throttling, storage stalls, or an unstable uplink. Test the complete workload, lower output demands, improve cooling or power stability, and leave more upload headroom.
  • Audio is missing or out of sync: Confirm the input has an audio stream, FFmpeg can decode it, and the output codec is accepted. Test the actual source files and monitor sync through a sustained run.
  • Stream stops when the process or Pi stops: This method depends on the Pi, power, network, and FFmpeg process continuing to run. Configure local process supervision if appropriate, but test recovery behavior rather than assuming a restart will reconnect cleanly to the same event.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If you do not want a Raspberry Pi, computer, or home connection to remain on, StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos. Upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded media in the cloud, not camera footage. Each slot streams the upload as made, up to 4K 60fps, at one flat price per slot with no re-encode or quality tiers; it also includes automatic recovery if YouTube drops the stream. The first day is free with no card (one free day per account). Monthly billing is $9.99 per month.

Start the free StreamNeo day to upload a video, add your stream key, and send the stream to YouTube.

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

Quick Recap

Bestseller No. 2
CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)
CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)
Dual Band 2.4GHz and 5GHz IEEE 802.11.b/g/n/ac Wireless LAN, Enhanced Ethernet Performance
$109.99
Bestseller No. 3
CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply
CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply
Includes Raspberry Pi 3 B+ (B plus) with 1.4 GHz 64-bit Quad-Core Processor and 1 GB RAM; Dual band 2.4GHz and 5GHz IEEE 802.11.b/g/n/ac wireless LAN, Enhanced Ethernet Capability
$89.99
Bestseller No. 4
Bestseller No. 5
Element14 Raspberry Pi 3 B+ Motherboard
Element14 Raspberry Pi 3 B+ Motherboard
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
$52.59
Best Value
Element14 Raspberry Pi 3 B+ Motherboard
  • 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

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.