DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › FFmpeg

How to Stream a Folder of Videos to YouTube Live with a Raspberry Pi 5

By Freedom251 Team · · 8 min read

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 stream a folder of prerecorded videos to YouTube Live from a Raspberry Pi 5 by making an ordered FFmpeg playlist, feeding it to FFmpeg at real-time speed, and sending the output to the ingest URL and stream key from YouTube Studio. Use stream copy only when the files are compatible; otherwise FFmpeg must transcode, which relies on the Pi 5’s CPU. Test the whole stream before relying on it for a live event.

What you need before you start

  • A Raspberry Pi 5 running an OS with FFmpeg installed. The Pi 5 has a quad-core 2.4 GHz Cortex-A76 CPU, microSD storage, USB 3.0 ports and Gigabit Ethernet; Raspberry Pi lists 4Kp60 HEVC decoding, not hardware video encoding. Its encoding is software-based, so a particular resolution and frame rate cannot be assumed to run continuously without testing. Raspberry Pi 5 specifications.
  • Your video files stored on the Pi or on attached storage, with enough capacity for the library and operating system.
  • A YouTube channel with live streaming enabled. First-time enablement may take up to 24 hours, according to YouTube’s live streaming setup guidance.
  • A stable network connection. Prefer wired Ethernet where practical, and test sustained upload performance with your intended output.
  • FFmpeg built with the encoder and RTMPS support you intend to use. Build capabilities vary, so check your installed version rather than assuming an encoder exists.

1. Create a YouTube Live stream and protect its key

  1. Open YouTube Studio and create or select the live stream. Choose its privacy and scheduling options.
  2. Copy the stream URL and stream key shown for that stream. Use the current values from Studio; do not reuse a key from an unrelated stream.
  3. Keep the key secret. Do not publish it in a public script, repository, screenshot or support post. Anyone who has it may be able to send video to your broadcast.
  4. Prefer the RTMPS endpoint if your FFmpeg build supports it. YouTube recommends encrypted RTMPS; its developer reference describes RTMPS ingest over SSL on port 443. Some interfaces ask for the URL and stream name separately, while others use a combined destination. Use the exact current URL and key format supplied for your stream. YouTube Live ingestion protocols.

Start the encoder before checking the Studio preview. For scheduled streams, YouTube may show a preview and require you to press Go live in Studio; an encoder connection alone does not necessarily make the event public. Follow the status shown for your stream in Studio. YouTube’s setup instructions.

As an Amazon Associate I earn from qualifying purchases.

2. Make an ordered playlist from the folder

FFmpeg’s concat demuxer reads a text file that lists media files in playback order. It does not decide a useful order for your folder. Sort the filenames lexically if that matches your intended sequence, or write the entries manually.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. In a terminal, go to the folder containing the videos, or create a playlist file whose paths point to the files.
  2. Create a text file such as playlist.ffconcat. The first line must be ffconcat version 1.0, followed by one file line per video. For example:
    ffconcat version 1.0
    file '01 - Opening.mp4'
    file '02 - Main video.mp4'
    file '03 - Closing.mp4'
  3. Save the file as plain text. Check spelling, capitalization and spaces in every path. For paths with apostrophes or unusual characters, follow FFmpeg’s quoting rules and test the list before going live.
  4. Preview the files in sequence, especially the transitions between them. The concat demuxer works best when the files have compatible streams and parameters; differences in codecs, timestamps, duration handling or stream layout can cause errors or awkward transitions.

FFmpeg’s default safe-path behavior rejects some paths it considers unsafe. A playlist using relative paths in the same directory is a straightforward starting point. If you need absolute paths or unusual path syntax, consult the FFmpeg concat demuxer documentation, understand the implications before changing safe-path handling, and test locally.

#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

3. Choose stream copy or transcoding

Approach When it fits Trade-off
Stream copy/remux The video and audio codecs, stream parameters, timestamps and output container are compatible with each other and with YouTube ingest. Usually avoids the CPU cost of video encoding, but is less flexible and may fail or glitch with mixed or incompatible files.
Transcode Files need a consistent output codec, bitrate, frame rate, resolution or audio format. Provides control over the outgoing stream but uses the Pi 5’s CPU for software encoding. Sustained capability depends on the media, output settings, software and cooling; no specific mode is guaranteed.

The Pi 5’s 4Kp60 HEVC capability is decoding support, not an HEVC hardware encoder. Raspberry Pi’s Director of Software Engineering, Gordon Hollingworth, explained the design decision: “For Pi 5 we feel the hardware encode is a mm² too far.” See the Raspberry Pi 5 announcement. If you need to transcode, start with a modest output resolution and frame rate, then confirm the Pi can sustain them before increasing quality.

4. Set FFmpeg output to YouTube’s requirements

YouTube’s encoder guidance supports H.264, H.265/HEVC and AV1 video, AAC or MP3 audio, constant bitrate (CBR), and up to 60 fps. It recommends a two-second keyframe interval and says the interval must not exceed four seconds. Use YouTube’s current bitrate table for your chosen codec, resolution and frame rate; there is no single suitable bitrate for every stream. For SDR it lists Rec. 709 and 8-bit guidance; for stereo audio it lists 44.1 kHz and 128 kbps. Check the latest YouTube encoder settings before choosing your output.

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

For a copy workflow, only copy when the source streams already meet the requirements and can be muxed as required. For a transcode workflow, choose an encoder actually available in your FFmpeg build, configure the output codec and audio, use CBR and a compliant keyframe interval, and select a bitrate from YouTube’s table. Do not assume a command or encoder option is identical across FFmpeg builds.

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

The following is a command shape, not a universal ready-to-run command. Replace the placeholders with settings supported by your build and the current YouTube guidance. Store the stream key outside any public script, and do not share a command containing the real key:

Rank #3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
  • CanaKit Raspberry Pi 5 Essentials Starter Kit
ffmpeg -re -f concat -i playlist.ffconcat 
  [copy compatible streams OR configure video/audio encoding] 
  [set output bitrate and keyframe interval] 
  -f flv "[RTMPS ingest URL and stream key from YouTube Studio]"

Here -re paces file input in real time rather than sending it as fast as the files can be read. The bracketed sections are intentionally not literal FFmpeg options: fill them in for the selected copy or transcode path, output format and installed encoders. Confirm that your build supports the chosen RTMPS destination and output format before the event. FFmpeg documents the concat input behavior at ffmpeg.org; YouTube’s supported ingest and stream settings are documented in its encoder guidance.

5. Test the entire stream before the event

  1. Run FFmpeg with a short representative sequence that includes both motion and the audio you intend to broadcast.
  2. Check YouTube Studio for the incoming preview and stream-health status. Confirm that video is moving, audio is present and levels are sensible, and the picture is not visibly corrupted.
  3. Let the stream run long enough to reveal sustained CPU, network or file-boundary problems. A successful connection at startup does not prove the Pi can maintain the selected output.
  4. Check each transition between files. Look for missing audio, frozen frames, abrupt changes, errors or timestamp problems.
  5. For a scheduled event, confirm the preview and use Studio’s Go live control when the interface requires it.

YouTube recommends testing before a live event. Its encoder help says streams under 12 hours are automatically archived; do not rely on that automatic archive behavior for a broadcast planned to exceed 12 hours. YouTube encoder help.

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

6. Decide how playback should end or repeat

A concat list plays the listed files in order; it does not make a folder loop forever by itself. If you need repeat playback, deliberately arrange a repeat strategy supported by your installed FFmpeg build, such as looping or regenerating the playlist. Test end-of-list behavior and the transition back to the first file before depending on it. Loop behavior can differ with FFmpeg version and source format, so do not assume a loop option works identically for every playlist.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

  • YouTube shows no incoming video: Recheck the current stream URL and key, RTMPS support and destination format, and confirm the stream is selected in Studio. Keep the key private; if exposed, replace it in Studio.
  • FFmpeg reports a missing file or concat error: Check the playlist’s first line, path spelling, working directory, quoting and file permissions. Test with a simple relative-path list before using unusual or absolute paths.
  • Playback stops or breaks at a file boundary: The files may have mismatched codecs, parameters, stream layouts or timestamps. Test the affected files individually and use a consistent transcode output if compatible stream copy is not viable.
  • Frames drop or the Pi struggles during transcoding: Software encoding may exceed the Pi’s sustainable CPU capacity at the selected output. Reduce resolution or frame rate, use a compatible stream-copy path if possible, or lower the encoding workload; then repeat a sustained test.
  • Audio is missing, distorted or out of sync: Check whether all files contain compatible audio streams and inspect transitions in the preview. Configure consistent audio output when transcoding, using YouTube’s published guidance.
  • FFmpeg connects but the broadcast is not live: Inspect Studio’s preview, health status and scheduling controls. A scheduled stream may still need an explicit Go live action.
  • Live streaming is unavailable: Confirm that the channel has live streaming enabled and allow for YouTube’s stated first-time activation period, which may take up to 24 hours.

Or let it run in the cloud

If your goal is an always-on YouTube channel rather than running a Pi at home, StreamNeo keeps uploaded videos playing to YouTube Live from the cloud. Upload your recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay powered on at home, and StreamNeo automatically recovers if YouTube drops the stream. The video streams as uploaded at any quality up to 4K 60fps for one flat price per slot. The first day is free with no card. Monthly pricing is $9.99 per month. It plays uploaded videos rather than broadcasting a camera feed. Start your free StreamNeo day.

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.

Frequently Asked Questions

Will the Raspberry Pi 5 hardware-encode my videos?

No. Raspberry Pi specifies 4Kp60 HEVC decoding, while video encoding on Pi 5 is software-based.

Can I use a mixed folder of MP4, MKV and other formats?

Possibly, but the container extension alone does not establish compatibility. Test the actual streams and file transitions; transcode to a consistent output if stream copy is not compatible.

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
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.

FFmpeglive streamingRaspberry PiRaspberry Pi 5YouTube Live

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.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.