You can stream a local video playlist from a Raspberry Pi 5 to YouTube Live with FFmpeg. The practical starting point is to check that the clips have compatible streams, then use FFmpeg’s concat demuxer and stream copy to avoid re-encoding. That does not make incompatible files compatible: if the clips or YouTube ingest settings require a different output, you will need to preprocess or encode them, and the Pi 5’s video encoders are software-based.
What you need before starting
- A Raspberry Pi 5 with a working network connection and enough upload capacity for the selected stream bitrate.
- FFmpeg built with the required demuxer, muxer, and any codecs you plan to use. Check your installed build rather than assuming every package includes the same support.
- Videos stored locally on the Pi or on an accessible mounted drive.
- A YouTube channel able to create a live stream and its ingest URL and stream key from YouTube Studio’s Live Control Room.
The steps below show a stream-copy starting point, not a universal command for every folder. Test a representative clip and confirm YouTube receives a clean preview before scheduling a long broadcast.
Inspect and order the video files
“MP4” describes a container, not the codecs or stream layout inside it. Two MP4 files can differ in video codec, audio codec, frame rate, resolution, pixel format, number of streams, or timing. FFmpeg’s concat demuxer expects the files to have the same streams, including matching codecs and time bases; differing duration metadata can also cause gaps or artifacts. See the FFmpeg FAQ.
Use ffprobe on a representative clip, and on each file if the folder may contain mixed material. For example:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
- 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.
ffprobe -hide_banner -i "/media/videos/01-intro.mp4"
Check the reported video and audio codecs, dimensions, frame rate, pixel format, stream count, and duration. Also confirm the encoded streams are suitable for the YouTube ingest settings you intend to use. If files differ, do not assume stream copy will join them seamlessly; preprocess them into a consistent format or use a concat-filter workflow that re-encodes.
Create an explicit playlist file so playback order does not depend on shell glob sorting. Save this as a UTF-8 text file, for example /media/videos/playlist.ffconcat:
ffconcat version 1.0
file '/media/videos/01-intro.mp4'
file '/media/videos/02-main.mp4'
file '/media/videos/03-outro.mp4'
Use the actual paths and the order you want viewers to see. Paths containing apostrophes, unusual characters, or leading or trailing spaces need careful quoting and escaping in the concat file; do not generate it by blindly inserting arbitrary filenames into shell commands.
Rank #2
- 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 stream copy or re-encoding
| Method | Use it when | Trade-off |
|---|---|---|
Concat demuxer with -c copy |
Clips have compatible stream layouts, codecs, and time bases, and their encoded streams already suit the intended ingest. | Avoids video re-encoding and uses less processing, but does not change codecs, resolution, frame rate, or bitrate. Duration errors may produce gaps or artifacts. |
| Preprocess or concatenate with a filter and encode | Clips differ or you need to normalize codec, resolution, frame rate, or other output properties. | Provides more control over the output but requires encoding; measure whether the Pi 5 can keep up with the real workload. |
FFmpeg’s copy mode passes encoded streams through without decoding and re-encoding them. It cannot convert an unsuitable source into an ingest-compatible one. The FFmpeg FAQ describes the concat filter as the option when concatenation requires re-encoding.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsSet YouTube’s ingest requirements
In YouTube Studio, open Live Control Room and create or select a stream. Copy its ingest URL and stream key into your encoder setup. YouTube describes the stream key as what lets it accept the encoder feed; treat it like a password, never publish it, and reset it if it is exposed. See YouTube’s stream-key guidance.
YouTube recommends RTMPS for encrypted ingest. Copy the RTMPS URL offered in Live Control Room rather than assuming a conventional RTMP address is encrypted. Confirm that your FFmpeg build and the selected endpoint support the output format you use. YouTube’s live encoder settings specify conventional RTMP/RTMPS guidance including H.264, constant bitrate (CBR), and a two-second keyframe interval, with a maximum interval of four seconds.
Rank #3
- 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.
- Video: For conventional SDR RTMP/RTMPS, use H.264, progressive scan, square pixels, and Rec. 709 SDR color as appropriate to your source.
- Bitrate: Choose the row in YouTube’s current encoder bitrate table for your codec, resolution, and frame rate; there is no single rate for every stream. The current table lists H.264 1080p30 at 10 Mbps and H.264 1080p60 at 12 Mbps. Recheck the corresponding row for your intended settings before streaming.
- Keyframes and frame rate: Target a two-second keyframe interval and do not exceed four seconds. YouTube lists a maximum frame rate of 60 fps.
- Audio: YouTube’s advanced recommendations list AAC or MP3, 44.1 kHz stereo audio, and 128 kbps stereo audio.
These are YouTube’s published recommendations, not settings that FFmpeg can impose on copied streams. With -c copy, the source’s encoded properties remain as they are. If they do not match the output you need, use an appropriate tested encoding configuration instead. See YouTube’s live encoder settings and advanced live encoding recommendations.
Build and start a looping FFmpeg stream
For compatible files, this command is a schematic starting point. Replace the playlist path and ingest URL with yours; the URL below intentionally uses placeholders. FFmpeg input options apply to the input that follows, so keep -stream_loop -1 before the playlist input and check option behavior against your installed FFmpeg version.
ffmpeg -re -f concat -safe 0 -stream_loop -1 -i /media/videos/playlist.ffconcat
-c copy -f flv
'rtmps://INGEST_HOST/APP/STREAM_KEY'
-re reads the media at approximately its intended playback rate instead of sending it as fast as possible. The concat demuxer reads the ordered list; -stream_loop -1 repeats that input indefinitely; -c copy avoids re-encoding; and -f flv selects the conventional RTMP/RTMPS output container. Verify the actual RTMPS endpoint, output format, and build compatibility for your YouTube stream rather than treating this example as guaranteed to work unchanged.
Rank #4
- 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
Protect the stream key: do not include it in screenshots, public logs, shared scripts, or public repositories. A key embedded in a shell command can also be saved in shell history or visible to other users on the Pi. Restrict access to scripts and logs that contain it, and reset it in YouTube if it leaks.
Preview, go live, and end the broadcast
- Start FFmpeg and watch its output for connection errors, dropped frames, or processing warnings.
- Open the stream’s preview in Live Control Room. Check that video and audio appear correctly and that the event is accessible before relying on it.
- For a scheduled stream, select Go live in Live Control Room after the preview is ready, following YouTube’s event workflow. Continue monitoring the stream and the Pi’s network connection.
- To finish, stop FFmpeg and end the stream in Live Control Room as appropriate. YouTube says streams under 12 hours are automatically archived.
YouTube’s encoder settings and live streaming tips cover stream configuration and monitoring.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What to expect from a Raspberry Pi 5
Raspberry Pi’s official camera documentation states, “Raspberry Pi 5 uses software video encoders.” See Raspberry Pi camera software documentation. That means you should not assume the Pi 5 has a dedicated hardware H.264 encoder for this workflow.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 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.
Stream copy is therefore a sensible first attempt when the files already fit the playlist and ingest requirements: it avoids a video encode. If you must transcode, whether the Pi keeps up depends on the codec, resolution, frame rate, filters, FFmpeg build, thermals, and other system load. No benchmark for this exact workflow is established here. Test a representative clip with the full intended settings and monitor whether processing stays ahead of playback before committing to a long stream.
Troubleshooting common failures
- FFmpeg reports concat or stream compatibility errors: Compare each file’s streams, codecs, and time bases. Convert the clips to a consistent set of streams or use a concat-filter and encode workflow.
- The playlist joins with a gap, glitch, or unexpected timing: Check the source duration metadata and stream compatibility. Incorrect duration information can affect concat timing; correct or preprocess the files and test the transitions.
- YouTube rejects the feed or reports an unsupported format: Confirm you copied the correct RTMPS ingest URL and key, that the output format is accepted by the endpoint, and that the encoded streams meet YouTube’s current requirements. Stream copy cannot correct an unsuitable codec or bitrate.
- The stream connects but playback stutters or drops frames: Compare the selected bitrate with the current YouTube table row for your codec, resolution, and frame rate; check Pi processing load and available upload capacity. If transcoding, reduce workload or preprocess to a compatible stream-copy format.
- The preview has no sound or the wrong audio: Check that the intended audio stream exists in each clip and that the copied audio codec and properties suit the ingest. Normalize the audio in a preprocessing or encoding step if needed.
- The stream key was exposed: Reset it in Live Control Room, update the encoder configuration, and remove the exposed key from shared scripts or logs where possible.
Copyright and YouTube policy checks
Having local copies of the videos does not itself grant permission to broadcast them. Before streaming, confirm you have rights to the video, music, and other included material, and review YouTube’s rules for live content and monetization. Repeatedly looping content does not guarantee eligibility for monetization or compliance with YouTube policies. Use YouTube’s own notices and channel guidance to resolve claims or restrictions before scheduling a long-running stream.
Or let it run in the cloud
If the goal is a continuous YouTube channel rather than learning to maintain a Pi-based encoder, StreamNeo can run uploaded videos from the cloud. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; 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. Monthly is $9.99 per month. StreamNeo streams to YouTube only. See StreamNeo or start the free first day.
Quick Recap
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.




