October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
Admit one · Blog

How to Loop a Local Playlist to YouTube Live with FFmpeg on Raspberry Pi

Use FFmpeg’s input loop option to send prerecorded local files as a continuous YouTube Live feed from a Raspberry Pi. Learn the setup, settings, testing steps, and common fixes.
Opened Runtime7 min Written byDocumentaryTube Team

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

You can use FFmpeg on a Raspberry Pi to send a looping playlist of prerecorded files to YouTube Live: create or schedule a live event, make a local playlist, loop that input with -stream_loop -1, and send the output to YouTube’s ingest server. This is not the same as looping a YouTube watch-page playlist URL. The right command depends on the files, FFmpeg build, Pi model, and network, so test the complete setup before relying on it.

What “YouTube Live playlist” means here

This method treats the playlist as a list of media files stored on the Raspberry Pi or accessible to it. FFmpeg reads those prerecorded files and sends one continuous live feed to YouTube. YouTube’s official setup guidance describes connecting an encoder with a server URL and stream key; the documentation cited here does not establish that a YouTube watch-page playlist URL can be used directly as an FFmpeg media playlist.

The broadcast is live as an ingest stream, even though its content was recorded earlier. Use only video and audio you have the rights to broadcast. A loop does not change copyright ownership or make reused content eligible for monetization.

Before you start

  • A Raspberry Pi and a working FFmpeg installation. The available documentation does not establish a Pi model, operating system image, or package source that is suitable for every workload.
  • Local prerecorded files and enough storage for them. Files should have compatible audio/video streams and timing if you plan to concatenate or stream-copy them.
  • A YouTube account with Live available, plus a scheduled or created stream in YouTube Live Control Room.
  • A stable upload connection with headroom above the output bitrate. Measure performance on the actual connection rather than assuming the nominal service speed will be sustained.
  • A plan for monitoring the stream. Pi encoding capacity varies by model, settings, and source; YouTube’s bitrate recommendations are not Raspberry Pi performance guarantees.

Create the YouTube Live destination

  1. In YouTube Live Control Room, create or schedule the live stream and open its encoder settings.
  2. Copy the server URL and stream key shown for that event. Use the current values in your account; do not assume every account or event has identical protocol options.
  3. Keep the key secret. YouTube describes a stream key as password-like: do not put it in a public script, screenshot, article, or shared shell history. If it is exposed, reset it in Live Control Room and update your encoder.
  4. Open the stream preview and confirm YouTube receives the feed before you rely on it for an event or long-running channel.

YouTube’s encoder guide says streams under 12 hours are automatically archived. Do not assume a longer loop will be stored as one uninterrupted archive.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

Prepare a local playlist

Make a text playlist whose entries point to the files you want FFmpeg to play. For a concat-demuxer workflow, a basic file named playlist.txt can contain entries such as:

file '/home/pi/videos/program-01.mp4'
file '/home/pi/videos/program-02.mp4'
file '/home/pi/videos/program-03.mp4'

Use paths that exist on your Pi. The concat demuxer has its own syntax and requirements; consult the installed FFmpeg build’s documentation and verify that the files’ streams and timestamps are compatible. A playlist that parses successfully is not proof that transitions will be seamless.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

Choose output settings that YouTube accepts

YouTube’s live encoder settings currently list RTMP/RTMPS ingest, H.264, H.265, and AV1 video, AAC or MP3 audio, constant bitrate (CBR), and frame rates up to 60 fps. YouTube recommends a two-second keyframe interval and says it should not exceed four seconds. Follow the current YouTube settings for your chosen codec and resolution.

Example SDR H.264 target YouTube-recommended bitrate What it does not establish
1080p at 30 fps 5 Mbps Whether a particular Pi can encode it in real time or a particular connection can sustain it
720p at 30 fps 3 Mbps Whether a particular Pi can encode it in real time or a particular connection can sustain it

These are YouTube’s published recommendations for ordinary SDR H.264, not measured Raspberry Pi capacities or guarantees of delivery. Choose a bitrate your upload can sustain reliably, leave headroom, and test with representative motion and audio. Raising resolution or frame rate may increase the required bitrate and encoding load.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

Build and test the FFmpeg command

FFmpeg options are order-sensitive: -stream_loop is an input option and belongs before the -i it applies to. In current FFmpeg documentation, -1 means loop indefinitely. The following is a command pattern, not a universal copy-and-paste command; adapt encoding, audio, playlist input, and destination to your files and installed build.

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i /home/pi/playlist.txt 
  -c:v libx264 -preset veryfast -b:v 5M -maxrate 5M -bufsize 10M 
  -r 30 -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "rtmp://INGEST_SERVER/APP/STREAM_KEY"

Replace the destination with the server URL and key from Live Control Room; never publish a real key. This example targets a 30 fps H.264 output and a two-second GOP at that frame rate. Its encoder options may be unsupported, too demanding, or inappropriate for a given Pi and FFmpeg build. Confirm the local encoder is available, inspect the source files, and check current YouTube requirements before using it. The example does not guarantee that concatenated files have continuous timestamps or that the Pi can sustain the encode.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

Stream-copy versus re-encode

Stream-copying can reduce CPU load if every source file already has compatible codecs, stream layouts, timestamps, and output characteristics. If the sources differ or do not meet the required output settings, transcoding may be necessary. Do not assume a no-re-encode command will work without inspecting the files and testing the actual output.

Protect the stream key in practice

A key embedded directly in a command may be saved in shell history or visible to other users with access to the process. Prefer a protected configuration method appropriate to your operating system and account. Avoid sharing scripts containing credentials, and rotate the key promptly if it becomes public.

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.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Validate the stream before leaving it running

  1. Start FFmpeg and check its output for input errors, encoder initialization failures, or repeated reconnects.
  2. Watch YouTube’s preview and stream-health indicators. Confirm both video and audio arrive and that the playlist advances as expected.
  3. Let the stream run through at least one playlist transition. Listen and watch for gaps, frozen video, timestamp jumps, or audio loss.
  4. Check Pi load and temperature during the intended workload, and verify that the network sustains the chosen bitrate. A short idle test will not reveal whether a long encode overheats or falls behind.
  5. Test again after changing resolution, frame rate, codec, files, FFmpeg build, or network conditions.

YouTube recommends testing before the event and monitoring stream health while live. Its current encoder settings and the installed FFmpeg documentation are the authoritative references for platform and command behavior; neither supplies a benchmark proving a specific Pi configuration will work.

Troubleshooting common failures

Symptom Likely cause What to check or change
FFmpeg cannot open the playlist or a media file Incorrect path, playlist syntax, permissions, or unsupported input Check each path and permissions; validate the concat playlist syntax and test each file individually.
YouTube does not receive a signal Incorrect server URL or key, unavailable live access, or an ingest connection problem Copy the current event credentials again in Live Control Room, verify the selected protocol and account state, then reconnect.
Video stutters, buffers, or stream health degrades Insufficient upload headroom, unstable network, or encoding falling behind Measure sustained upload performance, reduce output demands, and check Pi load while streaming.
FFmpeg reports encoder errors or the Pi cannot keep pace Encoder unavailable in the installed build or workload too demanding Confirm the encoder is present; test lower resolution or frame rate, or use compatible source settings. No Pi-specific performance level is established here.
Image or sound breaks at playlist boundaries Incompatible codecs, stream layouts, or timestamps among files Inspect and normalize the source media or transcode to consistent output settings; test each transition.
The stream key no longer works or may be exposed Key was reset, copied incorrectly, or compromised Generate or retrieve the current key in Live Control Room, update the protected configuration, and revoke an exposed key.
A long broadcast is not one continuous archive YouTube’s stated automatic archive behavior applies to streams under 12 hours Do not rely on a longer loop being archived as a single uninterrupted video; plan recording and retention separately.

Or let it run in the cloud

If you do not want a Pi and home connection to host the broadcast, 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 from the cloud, so nothing has to stay on at home. Each slot streams the upload as made, up to 4K 60fps, at one flat price per slot; there are no quality tiers or re-encoding. StreamNeo automatically recovers 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. The service streams to YouTube only and plays uploaded video; it does not broadcast a camera feed. See StreamNeo or plan details. Start your free day with StreamNeo.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Screening Room

  1. How to Migrate a 24/7 YouTube Stream to a New VPSAdmit one · BlogHow to Migrate a 24/7 YouTube Stream to a New VPSOpened04 OCT 2026Runtime6 min
  2. How to Run a YouTube Playlist on a Headless Linux Server—and Broadcast It LiveAdmit one · BlogHow to Run a YouTube Playlist on a Headless Linux Server-and Broadcast It LiveOpened04 OCT 2026Runtime6 min
  3. How to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootAdmit one · BlogHow to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootOpened04 OCT 2026Runtime6 min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.