Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Mountain View desk6 min

How to Stream a USB Video to YouTube Live with FFmpeg on Raspberry Pi

Use FFmpeg on Raspberry Pi to read a video from USB in real time and send it as a YouTube Live feed. Includes RTMPS setup, a looping command template and troubleshooting.

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.

To stream a video from a USB drive to YouTube Live with FFmpeg, mount the drive, confirm the file path, then have FFmpeg read the file in real time and send it to YouTube’s current RTMPS ingest address with your stream key. This is a live feed made from a local file—not a normal YouTube video upload. The steps below use a looping command template; your Raspberry Pi’s ability to encode it in real time depends on its model, the video and FFmpeg build.

What you need

  • A YouTube channel that is permitted to livestream, with the intended live stream’s current RTMPS ingestion address and stream key.
  • A Raspberry Pi with FFmpeg installed and network access to YouTube’s ingest service.
  • A mounted USB drive containing a video file that your FFmpeg build can read.

You do not need a camera, capture card or microphone to send an existing video file. If you already have a suitable USB drive, no additional storage is required.

As an Amazon Associate I earn from qualifying purchases.

Prepare the YouTube Live stream

In YouTube Studio, create or select the live stream you intend to use and copy its currently displayed RTMPS ingestion address and stream key. The exact interface and assigned values can change, so use the values shown for your stream rather than a hard-coded endpoint. YouTube requires livestreaming to be enabled for the channel; permission-related errors can prevent an incoming stream from working. See YouTube’s liveStreams documentation and livestreaming eligibility information.

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

YouTube distinguishes the incoming feed from the event viewers watch: a liveStream represents the ingest, while a liveBroadcast is the broadcast. In YouTube Studio, check that the feed is arriving on the broadcast you plan to show. The distinction is also described in the liveBroadcast documentation.

#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

Treat the stream key like a password. Do not publish it in an article, screenshot, public log or shell history. Anyone with access to the key may be able to send a feed to your stream.

Mount the USB drive and verify the file

Connect the drive and locate its mount point using your operating system’s file manager or command line. There is no single Raspberry Pi path that applies to every OS and configuration. Confirm the video is present and readable before starting FFmpeg. For a shell check, substitute the actual path:

ls -l "/path/to/usb/video.mp4"

Keep the quotation marks if the file or directory name contains spaces. FFmpeg reads regular files as inputs, but it does not mount a removable drive or discover its path for you. See the FFmpeg command-line documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
  • Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
  • Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
  • CanaKit Premium High-Gloss Raspberry Pi 4 Case with Integrated Fan Mount, CanaKit Low Noise Bearing System Fan
  • CanaKit 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter, Set of Heat Sinks, Display Cable - 6 foot (Supports up to 4K60p)
  • CanaKit USB-C PiSwitch (On/Off Power Switch for Raspberry Pi 4)

Check which FFmpeg features are available

Run these commands on the Raspberry Pi that will stream:

ffmpeg -version
ffmpeg -encoders
ffmpeg -protocols

Check that the installed build includes the encoders and output protocol you plan to use. Availability of libx264, AAC encoding and RTMPS output varies by build. A file’s container and codecs also affect whether it can be sent without conversion. Copying the source audio and video with -c:a copy and -c:v copy is appropriate only when those codecs and the container are acceptable for the chosen YouTube ingest; otherwise, transcode to suitable output codecs.

Send the video to YouTube with FFmpeg

This is a command template, not a tested configuration for every Raspberry Pi. Replace the quoted input path with the USB file’s real path and replace the destination placeholder with the current RTMPS ingest address and stream key shown for your YouTube stream. Keep the key private, and first confirm that your FFmpeg build supports the selected encoders and RTMPS output.

Rank #3
ELECROW CrowPi Case Kit for Raspberry Pi 5, 9-Inch Display | Basic Kit with 9-Inch Display & Sensors for Learning and Programming, Raspberry Pi 5 Compatible
  • Not including the Raspberry Pi 5 (8GB), the Crowpi advanced version comes with the Raspberry Pi 5
  • ELECROW Black Case for the Raspberry Pi 5, CrowPi is equipped with a 9-inch HD touchscreen along with a camera; All the regular components used in DIY electronics are packed into the CrowPi development board, such as LCD, LED matrix, buzzer, light sensor, PIR sensor, ultrasonic sensor, IR sensor, etc
  • Raspberry Pi Sensors: The Crowpi raspberry pi 5 programming kit is jam-packed with lots of buttons such as 19 different sensors in a tidy easy to use package; You don't have to wait and wire things
  • Build Quality: Solid ABS shell and well made components in one place make it strong and convenient to travel
  • Programming Lessons: This raspberry pi 5 learning kit ships with step by step instructions and provides 21 lessons to take you through identifying components reading code and running it in the terminal
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>"

FFmpeg’s option order matters: input options go before their corresponding -i; output options go before the output URL; and the destination URL belongs at the end. In this template, -re reads the file at its native rate instead of sending it as fast as possible. -stream_loop -1 repeats the input indefinitely. Remove -stream_loop -1 for a single play-through; when that file ends, FFmpeg exits and the live ingest may stop. FFmpeg documents these input options in its command-line reference.

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

Choose output settings for the Pi and source

The codec and preset in the example are choices for illustration, not a guarantee that a particular Pi can sustain real-time encoding. Performance depends on the Pi model, source resolution and codec, FFmpeg build, and available network capacity. Set the output video bitrate, frame rate, resolution, GOP/keyframe interval and audio settings to values appropriate for YouTube’s current encoder guidance and your hardware and connection. No single bitrate or configuration is established as correct for every Pi and video.

If encoding is too demanding, consider whether the source can be sent without re-encoding, but only use stream copy when its codecs and container suit the ingest. Confirm the result in YouTube’s live preview rather than assuming a command that starts locally is producing a usable broadcast.

Rank #4
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
  • Fully assembled for plug-and-play operation
  • Includes Raspberry Pi 5 with 8GB RAM
  • 256 GB PCIe Pi NVMe SSD (Pre-loaded with Pi 64-Bit OS)
  • M.2 HAT+
  • CanaKit Turbine Black Case for the Pi 5

Choose an ingest protocol

For this ordinary FFmpeg workflow, RTMPS is the practical default: YouTube documents it as RTMP tunneled through SSL, using a valid endpoint and port 443. That adds encrypted transport while retaining the familiar RTMP-style workflow. Copy the exact current endpoint provided for the stream, and ensure the network permits access to port 443. See YouTube’s RTMPS guide.

YouTube also documents RTMP, HLS and DASH ingestion. HLS and DASH have different encoder requirements and generally higher latency, so they add complexity without a clear benefit for this straightforward file-to-live workflow unless a specific codec or delivery need calls for them. Protocol options are outlined in YouTube’s ingestion protocol documentation.

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

Confirm the feed before viewers see it

Open the live control room or preview and verify that YouTube is receiving both video and audio before making the broadcast public. Check the broadcast association as well as the incoming feed: sending data to a stream does not by itself establish that the intended event is ready for viewers.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

Symptom What to check Fix
YouTube shows no incoming feed Channel livestream permission, the current ingest address and stream key, and the destination URL formatting. Confirm livestreaming is enabled, recopy the values from the intended stream, and check YouTube’s permission-related live-stream errors in its liveStreams documentation.
Connection fails over RTMPS The endpoint spelling, the RTMPS destination and network access to port 443. Use the exact current RTMPS address from YouTube and allow outbound access to port 443. YouTube describes endpoint and port requirements in its RTMPS guide.
FFmpeg cannot open the file The drive’s mount point, exact filename, quotation marks around paths with spaces, and read permissions. Verify the path with ls -l, correct it in the command, and make sure the USB volume is mounted and readable.
FFmpeg reports an unknown encoder or protocol The output of ffmpeg -encoders and ffmpeg -protocols on the Pi. Use components present in that build or install an FFmpeg build that includes the required encoder and RTMPS support.
Video stutters, falls behind or fails to encode in real time Pi model, input resolution and codec, encoding load and upload capacity. Use output settings the hardware and network can sustain; if suitable for the source and ingest, stream-copy compatible codecs instead of transcoding. There is no universal Pi setting that guarantees real-time output.
The feed stops when the video finishes Whether the command includes -stream_loop -1. Add the option before -i to loop continuously, or keep it out if you intend one play-through and expect FFmpeg to exit at the end.
Feed arrives, but the intended event is not ready Whether the incoming liveStream is associated with the broadcast you mean to show. Check the selected event in YouTube Studio and its preview before making it public.

Copyright and YouTube policy checks

Having a file on a USB drive does not establish that you have the rights to broadcast it. Before going live, confirm that you are allowed to stream the video and its music, artwork and other included material. YouTube’s copyright and reused-content rules are separate from whether FFmpeg can transmit a file; technical success does not establish policy compliance.

Or let it run in the cloud

If your goal is a continuing YouTube stream rather than operating a Raspberry Pi, StreamNeo is a cloud option: upload a recording or build a playlist, add your YouTube stream key once, and go live. The cloud keeps the loop running, 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; it automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month. StreamNeo streams to YouTube and plays uploaded videos; it does not stream from a camera. Learn more at StreamNeo, or start the free first day.

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 4 4GB Starter PRO Kit - 4GB RAM
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM); Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
$159.99
Bestseller No. 4
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
Fully assembled for plug-and-play operation; Includes Raspberry Pi 5 with 8GB RAM; 256 GB PCIe Pi NVMe SSD (Pre-loaded with Pi 64-Bit OS)
$339.97

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 *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.