You can stream a prerecorded video from a USB drive to YouTube Live by mounting the drive on your Raspberry Pi and having FFmpeg read the file in real time, then send it to YouTube over RTMPS. This is a live feed, not a normal YouTube video upload. To repeat the file continuously, use FFmpeg’s -stream_loop -1 option.
What you need before you start
- A Raspberry Pi with FFmpeg installed, a working internet connection, and enough upload capacity for the stream.
- A USB drive containing a video file that your FFmpeg build can read.
- A YouTube channel with livestreaming enabled, plus the current RTMPS ingestion address and stream key for the intended stream.
You do not need a camera, capture card, or microphone to send an existing video file. YouTube treats the incoming feed and the viewer-facing event as separate objects: the live stream is the feed sent to YouTube, and the live broadcast is the event viewers watch. See Google’s documentation for live streams and live broadcasts.
A stream key works like a credential. Keep it private: do not put it in a public post, screenshot, or log. Avoid leaving it in shell history where other users of the Pi can access it.
Prepare a YouTube Live stream
- Open YouTube Studio and create or select the live event you intend to show.
- Locate the stream’s current RTMPS ingestion address and stream key in the live setup or control room. Copy the values shown for that stream; do not rely on an endpoint or key copied from an old tutorial.
- Check that livestreaming is enabled for your channel. If the channel is not permitted to go live, FFmpeg cannot bypass that restriction. YouTube documents permission-related errors in its live streaming API errors.
- Keep the live control room available so you can verify the incoming picture and sound before making the broadcast public.
YouTube describes RTMPS as “a regular RTMP (RealTime Messaging Protocol) video stream tunneled through an SSL connection.” Its guidance requires a valid endpoint and port 443. For this ordinary low-latency workflow, RTMPS is the practical choice; consult the YouTube RTMPS guide if you need protocol details.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#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.
Mount the USB drive and confirm the video path
Connect the drive and use your desktop file manager or command line to find where your Raspberry Pi’s operating system mounted it. There is no single path that applies to every Pi installation. Before streaming, confirm the file exists and that the account running FFmpeg can read it. For example, substitute your actual mounted path and filename:
ls -l "/path/to/usb/video.mp4"
Use quotation marks around a path containing spaces. FFmpeg reads regular files, but it will not mount or locate a removable drive for you. Its command-line documentation explains input handling.
Check your FFmpeg build
Codec encoders and output protocols vary between FFmpeg builds. Check what is installed on this Pi before choosing a command:
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.
ffmpeg -version
ffmpeg -encoders
ffmpeg -protocols
- Look for
libx264if you plan to encode video with the example below. - Check that AAC encoding is available for the example audio settings.
- Confirm that the build supports RTMPS output. A build lacking the required encoder or protocol will not run the template as written.
Copying the source audio and video with -c:v copy and -c:a copy avoids re-encoding, but only works when the source codecs and container are acceptable for the selected YouTube ingest. If they are not, transcode to suitable output codecs instead.
Free tools Windows power users keep installed
One-click scans. No signup required.
Send the file to YouTube with FFmpeg
This is a command template, not a guarantee that a particular Raspberry Pi can encode a particular file in real time. Replace the quoted file path and destination with the values for your setup. Keep the key private and check that the installed build supports the selected encoders and RTMPS before running it.
ffmpeg -re -stream_loop -1 -i "/path/to/usb/video.mp4" \
-c:v libx264 -preset veryfast -pix_fmt yuv420p \
-c:a aac -b:a 128k \
-f flv "<RTMPS_INGESTION_URL>/<STREAM_KEY>"
Replace <RTMPS_INGESTION_URL> and <STREAM_KEY> with the current values YouTube provides for your stream. The destination URL is the final argument.
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.
-rereads the file at its native rate instead of sending it as fast as possible.-stream_loop -1repeats the input indefinitely. Omit this option for one play-through; when the file ends, FFmpeg exits and the live ingest may stop.-iidentifies the input file. Input options belong before the corresponding-i; output options belong after the input and before the destination.-c:v libx264,-preset veryfast,-pix_fmt yuv420p, and the AAC settings are example choices, not a universal Pi configuration.
FFmpeg documents -stream_loop -1 for infinite input looping. The command syntax and options are described in its official command-line reference.
Set output quality for your Pi and source
Choose output resolution, frame rate, video bitrate, keyframe interval (GOP), and audio settings to suit the source, the Pi’s encoding capacity, the available upload bandwidth, and YouTube’s current encoder guidance. The appropriate values are not universal. Performance depends on the Pi model, video resolution and codec, FFmpeg build, and network; a command that works on one setup may overload another. Do not assume that the example’s encoder settings will sustain your file in real time.
Check the incoming feed before going public
Watch the live preview or control room for incoming video and audio. Confirm that the image is moving, audio is present when expected, and the broadcast is set to the intended visibility before sharing it with viewers.
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
Troubleshoot a missing feed or interrupted stream
- No incoming feed: Confirm livestreaming is enabled for the channel, then recheck the exact current ingestion address and stream key. A wrong or outdated value prevents FFmpeg from connecting.
- Connection or RTMPS error: Check the spelling of the RTMPS endpoint, the port and network access to port 443, and whether your FFmpeg build supports the output protocol. YouTube’s RTMPS guide covers the endpoint and port requirements.
- Input file not found or permission denied: Recheck the USB mount location, exact filename, quotation marks around paths with spaces, and read permission for the account running FFmpeg.
- Encoder or protocol not found: Review
ffmpeg -encodersandffmpeg -protocols. Install or use a build with the needed support, or adjust the command to encoders and protocols that are available. - Choppy video, slow encoding, or Pi overload: The Pi may not keep up with the selected resolution, codec, frame rate, or encoding settings. Try a less demanding output configuration that still suits the source and YouTube’s current guidance, and check that the upload connection can sustain the stream.
- Stream stops at the end of the file: If you want a repeating feed, include
-stream_loop -1. Without it, FFmpeg makes one pass and exits when the input ends. - FFmpeg connects but the preview is wrong or silent: Check the selected input file and its audio/video streams, then confirm the output codec and settings are suitable for the ingest. Watch the preview rather than assuming a successful connection means the intended content is coming through.
Copyright and YouTube policy for prerecorded streams
Having a video file does not establish that you have the right to rebroadcast it. Use material you created or are authorized to stream, including its music and other embedded content. A live feed is still subject to YouTube’s copyright and channel rules; check the current guidance in YouTube Studio before scheduling or starting a public broadcast. Repeating a file does not change those obligations.
Or let it run in the cloud
If your goal is a YouTube channel that keeps a prerecorded video or playlist running, StreamNeo is a cloud alternative to keeping this Raspberry Pi and its USB drive on. Upload the recording, add your YouTube stream key once, and go live. StreamNeo loops uploaded videos from the cloud; it does not stream from a camera.
- Nothing has to stay powered on at home for the stream to continue.
- Each slot streams the uploaded file as made, up to 4K 60fps, at one flat price per slot, with no re-encode or quality tiers.
- It automatically recovers if YouTube drops the stream.
- The first day is free with no card required, one free day per account.
- Monthly billing is $9.99 per month.
StreamNeo is for YouTube streaming from uploaded videos. See StreamNeo, or start the free first day.
Recommended Free Tools
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.
Frequently Asked Questions
Can I stream once without looping the file?
Yes. Leave out -stream_loop -1; FFmpeg will read the file once and exit when it reaches the end.
Does the Raspberry Pi upload the video to my YouTube channel library?
No. FFmpeg sends a live feed to YouTube Live; it is not the normal video-upload process.
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.




