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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

You can use a Raspberry Pi, FFmpeg, and a YouTube Live stream key to broadcast a local music playlist continuously. The basic path is to prepare compatible audio files, create a YouTube live event, encode the playlist with a visual and audio stream, send it to YouTube over RTMPS, then monitor both the encoder and YouTube’s stream health. This is a do-it-yourself setup, not a guaranteed 24/7 service: the Pi, power, storage, network, and reconnection behavior all need checking on your specific hardware.

What you need before you start

  • A Raspberry Pi with a compatible FFmpeg build, adequate cooling and power, and local storage for the operating system and playlist. The Pi model and encoder path affect what it can sustain; Raspberry Pi’s May 2026 note discusses H.264 encoding performance on Pi 5-series computers but does not establish a universal model or resolution for this workload: Raspberry Pi H.264 encoding performance note.
  • Audio files you have the right to broadcast. YouTube’s copyright and monetization rules still apply to a continuous playlist; having a local copy or permission to listen does not by itself establish streaming rights. Review YouTube’s current guidance before broadcasting.
  • A YouTube channel enabled for live streaming, a live event, and its stream key.
  • A stable upload connection with enough capacity for the stream bitrate and headroom. YouTube recommends leaving 20% of available upload bandwidth unused: YouTube streaming tips.

Prepare and check the playlist

Keep the music files on local storage rather than depending on a network share during an unattended broadcast. Put them in the intended playback order and check that their streams are compatible before concatenating them. FFmpeg’s concat demuxer reads a text manifest and processes files sequentially; its documentation requires matching streams, including codec and time base. Differences in stream lengths and inaccurate duration metadata can create timestamp gaps or artifacts: FFmpeg Formats Documentation.

Create a concat manifest

Create a plain-text file named playlist.txt, with one entry per file in playback order. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
file '/home/pi/music/track-01.mp3'
file '/home/pi/music/track-02.mp3'
file '/home/pi/music/track-03.mp3'

Use paths that exist on your Pi. If filenames contain apostrophes or unusual characters, use FFmpeg’s documented concat syntax to escape them correctly. The manifest does not convert incompatible media into a uniform format; check the files’ audio streams with ffprobe or normalize them first.

#1 Best Overall
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Preflight the sequence

Play a short test of the sequence locally before sending it to YouTube. Listen at file boundaries for silence, abrupt cuts, or overlapping audio, and check whether the reported durations match playback. The concat demuxer adjusts timestamps between files; mismatched stream lengths or duration metadata can make boundaries imperfect. Do not assume that concatenation will produce seamless transitions.

Create a YouTube Live event and protect the stream key

  1. Open YouTube Studio and go to Create > Go live. In Live Control Room, create or schedule the event and select the encoder workflow.
  2. Choose RTMPS for ordinary live content. YouTube describes RTMPS as RTMP carried over SSL and documents its ingestion endpoint, port 443, and required URL format in its RTMPS ingestion guide.
  3. Copy the server URL and stream key from Live Control Room. Keep the key private: anyone who obtains it may be able to send video to that live ingest.
  4. Keep the event open to check its preview and stream-health messages when the encoder connects. Starting FFmpeg sends an encoder feed; it does not necessarily start or end the viewer-facing event in the way you expect, so confirm the event’s status in Live Control Room.

YouTube’s API distinguishes the ingest configuration (liveStream) from the viewer-facing event (liveBroadcast). They are related but not interchangeable. The API guide describes binding a broadcast to a stream and using one stream for a 24/7 feed: YouTube Live Streaming API: broadcasts and streams.

Rank #2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
  • Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Choose an encoding profile the Pi and connection can sustain

For RTMP/RTMPS, YouTube lists H.264, constant bitrate (CBR), and AAC or MP3 audio among its supported encoder settings. It recommends a keyframe interval of 2 seconds and says not to exceed 4 seconds. For stereo audio, its guidance specifies 44.1 kHz and 128 kbps. Its recommended H.264 video bitrates include 3 Mbps for 720p at 30 fps and 5 Mbps for 1080p at 30 fps. See the current YouTube encoder settings and bitrate table for other frame sizes and rates.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Choice Starting point What to assess
Video size and frame rate For a static visual, consider a modest output such as 720p at 30 fps rather than choosing resolution for its own sake. Confirm the specific Pi and FFmpeg encoder can sustain the output without overheating or falling behind. A still image reduces visual complexity but does not prove a particular encoding workload will run reliably.
Video bitrate YouTube recommends 3 Mbps for H.264 at 720p/30 fps and 5 Mbps at 1080p/30 fps. These are YouTube recommendations, not guarantees of Pi performance. Leave upload headroom; YouTube recommends 20% unused capacity.
Keyframes 2-second interval recommended; no more than 4 seconds. Set the interval explicitly if the chosen FFmpeg encoder supports it, and verify that the output follows the intended profile.
Audio AAC or MP3; YouTube’s stereo guidance is 44.1 kHz at 128 kbps. Check that the selected encoder is available in your FFmpeg build and that the output is audible and correctly channelled.

Use a wired Ethernet connection if practical, test the actual upload path, and account for all simultaneous traffic. If you choose dual ingest, YouTube says the primary and backup bitrates together must fit the available upload bandwidth. Do not infer that a Pi’s brand or model alone guarantees a particular resolution, frame rate, or continuous operating time.

Rank #3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
  • CanaKit Raspberry Pi 5 Essentials Starter Kit

Build and run the FFmpeg command

The following is a starting template, not a tested command for every Raspberry Pi or FFmpeg build. It assumes the concat manifest is readable, all audio files are compatible, and FFmpeg can encode H.264 and AAC. Replace the placeholders with your actual paths and YouTube RTMPS URL. Confirm encoder names and options with the installed build using ffmpeg -encoders and ffmpeg -h encoder=libx264 (or the relevant encoder’s help); Raspberry Pi builds may provide different software or hardware encoders.

ffmpeg -re -f concat -safe 0 -i /home/pi/playlist.txt 
  -loop 1 -framerate 30 -i /home/pi/static-image.png 
  -map 1:v:0 -map 0:a:0 
  -c:v libx264 -tune stillimage -pix_fmt yuv420p 
  -r 30 -g 60 -b:v 3000k -maxrate 3000k -bufsize 6000k 
  -c:a aac -b:a 128k -ar 44100 -ac 2 
  -f flv 'RTMPS_URL_WITH_STREAM_KEY'

In this example, the image supplies the video stream and the concat input supplies audio. The 30 fps output with a 60-frame GOP targets a 2-second keyframe interval; the video bitrate is set to YouTube’s recommended 720p/30 H.264 value. The command does not scale the image to a specified resolution, and it assumes libx264 is available. Set and verify the image dimensions and encoder options for your chosen output. If you use another encoder, consult that encoder’s help for its CBR and keyframe controls rather than assuming these flags transfer unchanged.

Rank #4
SANOOV Raspberry Pi 5 4GB Kit, 4GB RAM Single Board Computer with Active Cooler and ABS Case, Complete Raspberry Pi 5 Starter Kit for IoT Robotics Retro Gaming
  • All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
  • Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
  • Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
  • Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
  • Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online

The -re option reads the input at its native rate, while the image loop provides frames for the duration of the audio input. This template does not itself loop the playlist forever, restart FFmpeg after failure, or ensure the YouTube event remains live. The consulted FFmpeg concat documentation establishes sequential file processing, not a complete 24/7 loop or restart mechanism. If you add looping or a system service, verify the behavior against the current documentation and your installed FFmpeg build, then test it before relying on unattended operation.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Do not place a real stream key in a script that other users can read, a public repository, or support logs. A command-line argument may also be visible to local processes or retained in shell history. Restrict access to any file or service configuration containing the key, and rotate the key in YouTube Studio if it is exposed.

Best Value
RasTech Raspberry Pi 5 8GB Kit with Active Cooler and Pi5 Case
  • 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
  • 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
  • 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
  • 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
  • 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test the stream and keep watch on it

  1. Start with a private or unlisted test event where appropriate. Run FFmpeg and wait for the encoder feed to appear in Live Control Room.
  2. Check the preview for a stable picture, correct audio, and sensible sync. Read YouTube’s stream-health messages rather than treating a running FFmpeg process as proof that viewers can watch.
  3. Listen to a track boundary and verify several minutes of output. Check the Pi’s CPU load, temperature, storage, and network stability during the actual encoding workload.
  4. Only make the event public when the preview and health checks are satisfactory. Continue monitoring the encoder and YouTube status; YouTube recommends testing before going live and watching stream quality.

For unattended use, arrange a local monitoring and restart strategy, protect the stream key, and decide how you will be notified if the process or network fails. Treat that as your operational design, not a YouTube guarantee. An encoder process can remain open while the ingest is unhealthy, and a reconnect may not be seamless or keep the broadcast active.

Troubleshooting common failures

Symptom Likely cause What to check or change
FFmpeg cannot open a playlist file Manifest path, media path, permissions, or concat syntax is wrong. Check each path and file permission; use absolute paths and correct quoting. Test the manifest locally before connecting to YouTube.
Audio cuts, gaps, or artifacts at track boundaries Files have mismatched streams or inaccurate duration information. Inspect the files’ codecs, time bases, and durations. Normalize incompatible media and retest; concat demuxing does not promise seamless transitions.
YouTube does not show an incoming feed Wrong protocol, RTMPS URL format, port, or stream key; FFmpeg may also lack a required encoder or muxer. Copy the current server URL and key from Live Control Room, use the RTMPS endpoint and port 443, and check FFmpeg’s error output and available encoders.
Preview buffers or reports poor health Upload capacity is unstable or insufficient, or the Pi cannot sustain encoding. Test upload speed under real conditions, leave YouTube’s recommended 20% headroom, reduce output bitrate or resolution, and check Pi load and temperature.
The process runs but the broadcast stops or disconnects The YouTube event state, network, or ingest has failed independently of the local process. Check Live Control Room and stream-health status, then implement and test a monitor/restart procedure. A running process alone does not guarantee reconnection or a continuously viewable broadcast.

Or let it run in the cloud

If you want a 24/7 YouTube playlist without keeping a Raspberry Pi or other computer running at home, StreamNeo runs uploaded videos from the cloud. Upload your recording or build a playlist, add your YouTube stream key, and go live. It keeps the stream running with your computer off, automatically recovers if YouTube drops the stream, and plays uploads as made up to 4K 60fps at one flat price per slot. The first day is free with no card. Monthly billing is $9.99 per month. StreamNeo is for YouTube streams of uploaded videos, not camera broadcasts. Start the free trial at StreamNeo registration.

Quick Recap

Bestseller No. 1
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95
Bestseller No. 2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$419.99
Bestseller No. 3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit
$189.99

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.

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