October DealsAmazon USOctober deal check: compare before you payAmazon 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 NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
FFmpeg

How to Stream a Video Folder to YouTube with FFmpeg on a Raspberry Pi 5

A practical guide to checking playlist compatibility, looping files with FFmpeg, configuring YouTube Live ingest, and testing performance on Raspberry Pi 5.

By VGSources Team 7 min read

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.

You can stream a local video playlist from a Raspberry Pi 5 to YouTube Live with FFmpeg. If the files have compatible streams and already meet YouTube’s ingest requirements, use the concat demuxer and -c copy to avoid re-encoding. If they do not, you will need to preprocess or encode them—and Pi 5 uses software video encoders, so test the workload before relying on it for a long broadcast.

Before you start

  • A Raspberry Pi 5 with Raspberry Pi OS or another Linux installation, enough storage for the media, and a stable internet connection with upload capacity for the stream.
  • FFmpeg installed with the required input, output muxer, and codecs. Check the installed build and its option behavior; FFmpeg versions and build configurations can differ.
  • A YouTube channel that can use live streaming, with a stream created or selected in YouTube Studio.
  • A curated playlist and a private place to store the YouTube stream key.

YouTube recommends RTMPS for encrypted ingest. Copy the RTMPS stream URL from Live Control Room rather than assuming an ordinary RTMP URL is encrypted. YouTube’s live encoder settings describe its current conventional RTMP/RTMPS recommendations; confirm the applicable table there before choosing output settings.

Inspect and prepare the video folder

Check the actual streams, not just the file extensions

MP4 is a container, not a guarantee that two files contain the same codecs, stream layout, or timing. Inspect representative files—and ideally every file in the playlist—with ffprobe. Check video and audio codecs, dimensions, frame rate, pixel format, stream count, and duration. Compare the streams and time bases across files before choosing the no-re-encode path.

ffprobe -hide_banner -i "/media/videos/01-intro.mp4"

The concat demuxer expects matching streams, including codecs and time bases. Differences may stop concatenation from working correctly. Duration metadata errors can also cause artifacts or gaps. FFmpeg’s concat guidance explains the compatibility constraints and the alternative concat-filter approach.

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.

Make the order explicit

Do not rely on shell glob order if the sequence matters. Create a UTF-8 text file, for example /media/videos/playlist.ffconcat, with the entries in the intended order:

ffconcat version 1.0
file '/media/videos/01-intro.mp4'
file '/media/videos/02-main.mp4'
file '/media/videos/03-outro.mp4'

Use the real paths to your files. Paths containing apostrophes, unusual characters, or leading or trailing spaces require careful quoting and escaping; validate the list rather than generating it with a command that assumes every filename is simple.

Choose between stream copy and encoding

Path Use it when What it does and the tradeoff
Concat demuxer with stream copy The clips have matching stream layouts, codecs, and time bases, and their encoded streams are already suitable for YouTube ingest. -c copy avoids re-encoding, but does not change codecs, resolution, frame rate, or bitrate. It cannot make incompatible files compatible or make unsuitable streams meet YouTube’s requirements. Incorrect duration metadata may cause gaps or artifacts.
Preprocess or concatenate with the concat filter, then encode The clips differ or you need to normalize the output format, resolution, frame rate, or bitrate. Encoding gives you more control over output consistency but adds processing work. Raspberry Pi 5 uses software video encoders, so measure whether it can sustain your actual settings before scheduling a long stream.

FFmpeg documents copy as avoiding re-encoding and recommends the concat filter for concat operations that require re-encoding. See its concat FAQ. Do not choose stream copy simply because every filename ends in .mp4.

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.

Set YouTube’s ingest settings

For conventional SDR RTMP/RTMPS ingest, YouTube’s current recommendations include H.264 video, constant bitrate (CBR), a keyframe interval of two seconds (not more than four), AAC or MP3 audio, and a maximum frame rate of 60 fps. It recommends progressive scan, square pixels, Rec. 709 SDR color, and stereo audio at 44.1 kHz and 128 kbps. The recommended video bitrate depends on the ingest codec, resolution, and frame rate; use the row for your exact combination in YouTube’s live encoder settings table, not a universal bitrate.

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

For example, the table available in 2026 lists 10 Mbps for H.264 1080p30 and 12 Mbps for H.264 1080p60. These are recommendations for those specific codec, resolution, and frame-rate combinations, not general targets for every stream. Check the current table when configuring the encoder.

These settings matter most when you are encoding or checking whether existing files are suitable. A stream-copy command passes the encoded streams through; it does not convert them to H.264, make their bitrate constant, or set a new keyframe interval.

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 run the FFmpeg command

Compatible files: illustrative stream-copy starting point

After confirming the playlist is compatible and the files meet the ingest requirements, the command shape is:

ffmpeg -re -f concat -safe 0 -i /path/to/playlist.ffconcat 
  -stream_loop -1 -c copy -f flv 
  'rtmps://INGEST_HOST/APP/STREAM_KEY'

Replace the playlist path and endpoint with your own. The URL shown is a placeholder, not a working YouTube endpoint. Copy the RTMPS URL and stream key from YouTube Live Control Room, and check that your FFmpeg build supports the required muxer and codecs. Confirm the placement of -stream_loop against your installed FFmpeg version: it is an input option, and input options apply to the input that follows them. FFmpeg documents the option in its advanced options.

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

This is a starting point, not a universal drop-in command. The concat demuxer’s compatibility requirements still apply, and the selected YouTube endpoint and FFmpeg build must accept the output format. If the source streams do not meet YouTube’s ingest requirements, use a tested encoding configuration instead of assuming stream copy will fix them.

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

When the files need normalization

Use a preprocessing or concat-filter-and-encode workflow when streams differ or need normalization. Choose the output codec, dimensions, frame rate, bitrate, keyframe interval, and audio settings to match the applicable YouTube recommendation. Because Pi 5’s video encoding is software-based, no fixed resolution or frame rate can be promised for every media file and FFmpeg build. Test a representative clip with the filters and settings you intend to use, then check whether processing keeps up with playback. If it does not, preprocess the files on another machine or use a cloud streaming option.

Keep the stream key private

A YouTube stream key tells YouTube to accept an encoder feed and functions like a password. Do not expose it in screenshots, shared logs, scripts given to others, or public repositories. Avoid leaving it in shell history where other users can read it; if it is exposed, reset it in YouTube Studio. See YouTube’s guidance on stream keys.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Preview the feed and go live

  1. In YouTube Studio, open Live Control Room and create or select the stream you want to use.
  2. Copy the stream URL and stream key shown there into your FFmpeg output configuration. Prefer the RTMPS URL when supported.
  3. Start FFmpeg and wait for the incoming feed to appear in Live Control Room’s preview.
  4. Check the preview, audio and video quality, and the encoder’s output and upload connection. For a scheduled stream, select Go live in Live Control Room when the preview is ready.
  5. To finish, stop FFmpeg and end the broadcast in Live Control Room as appropriate. YouTube says streams under 12 hours are automatically archived; see its live streaming tips.

YouTube also advises checking that the event is accessible and monitoring audio and video quality throughout the stream. A successful connection at startup does not establish that the feed will remain healthy for the whole broadcast.

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.

What to expect from Raspberry Pi 5

Raspberry Pi’s official camera documentation states: “Raspberry Pi 5 uses software video encoders.” See Raspberry Pi camera software documentation. Stream copy can avoid a video encode when the source streams are already suitable, which makes it the more practical first option for compatible files.

For transcoding, performance depends on the codec, resolution, frame rate, filters, FFmpeg build, thermal conditions, and other system load. No fixed live-transcode capability for this exact workflow is established. Run a representative test and monitor whether the Pi keeps up with playback before depending on it for an extended stream.

Troubleshooting

  • Concat reports mismatched streams or the join fails: Compare codecs, stream layouts, and time bases across the files. The concat demuxer needs matching streams; preprocess the clips or use a concat-filter-and-encode workflow if they differ.
  • There are gaps, jumps, or artifacts at clip boundaries: Check duration metadata and timestamps as well as stream compatibility. Incorrect duration information can affect concatenation; test the playlist before going live.
  • YouTube rejects the feed or does not show a preview: Verify the RTMPS URL and stream key from Live Control Room, confirm that the key is current, and check that the installed FFmpeg build supports the chosen muxer and codecs. Stream copy does not convert a codec or adjust an unsuitable source to YouTube’s settings.
  • The Pi cannot keep up after you enable encoding: Test the real codec, resolution, frame rate, filters, and system load. Reduce the encoding workload or preprocess the files elsewhere if the Pi cannot sustain playback speed.
  • The stream stops after a key appears in a screenshot or log: Reset the compromised key in YouTube Studio and update FFmpeg with the new one. Treat the key as a password.
  • FFmpeg rejects the loop option or loops unexpectedly: Check your installed FFmpeg version’s option documentation and position -stream_loop as an input option for the playlist input.

Or let it run in the cloud

If your goal is a continuously looping YouTube channel, StreamNeo is a cloud alternative: upload your videos, add your YouTube stream key, and go live. Nothing has to stay on at home; it plays uploaded video, not a camera feed. It supports any uploaded quality up to 4K 60fps at one price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card, one free day per account. Monthly is $9.99 per month. StreamNeo streams to YouTube only. See StreamNeo for details, then start the free day.

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.

Leave a Reply

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

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.

More from Patch Notes

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.