October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk7 min

How to Set FFmpeg to Stream at 720p to YouTube from a Raspberry Pi

Configure FFmpeg for a 720p YouTube Live stream from a Raspberry Pi, with model-aware encoder guidance, bitrate settings, RTMPS setup, testing, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To send a Raspberry Pi video feed to YouTube Live at 720p, configure FFmpeg for H.264, constant bitrate (CBR), and a two-second keyframe interval; use an RTMPS ingest address and stream key from YouTube Live Control Room. Choose 30 or 60 fps according to your camera and Pi, and keep the bitrate within both YouTube’s live guidance and your connection’s reliable upload capacity. The exact FFmpeg input options depend on your capture device, operating system, and installed FFmpeg build, so there is no single verified command that works on every Pi setup.

Before you configure FFmpeg

First identify three things: which Raspberry Pi you have, how video enters it, and where audio comes from. A Pi camera, USB webcam, and capture card can require different FFmpeg input arguments; microphone and camera audio options also vary. Check those details before adapting an encoding template.

  • Pi model: Raspberry Pi’s encoding guidance describes hardware H.264 encoding through h264_v4l2m2m on Pi 4, and software H.264 encoding through libx264 on Pi 5. Do not assume the Pi 4 encoder is available on a Pi 5, or that either encoder is enabled in your FFmpeg build.
  • Video input: Determine whether the source is a Raspberry Pi camera, USB camera, or another capture device, and note its supported resolution and frame rates.
  • Audio input: Decide whether audio comes from the camera, a separate microphone, or is intentionally absent. The device name and input syntax are system-specific.
  • Software support: Check the installed FFmpeg build for the encoder you intend to use. Encoder availability and camera integration depend on the OS, FFmpeg build, and capture setup.

Raspberry Pi’s camera software documentation describes an FFmpeg/libav backend, but that does not make every camera capture path interchangeable with every FFmpeg command. Treat the examples below as encoding and output templates: supply the input arguments that match your actual devices, and confirm that your build supports the selected encoder.

Choose 720p frame rate and bitrate

YouTube’s live encoder guidance, accessed in 2026, lists the following H.264 live-ingest bitrate range for both 720p30 and 720p60. These are live-stream figures, not YouTube’s separate video-upload recommendations.

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.
Live format YouTube H.264 live bitrate When it makes sense
1280 × 720 at 30 fps 3 Mbps minimum; 8 Mbps recommended Use when the camera produces 30 fps or the Pi and upload connection have limited headroom.
1280 × 720 at 60 fps 3 Mbps minimum; 8 Mbps recommended Use only when the source provides 60 fps and the Pi can encode it reliably; motion can look smoother, but the extra frames raise encoding workload.

The 3–8 Mbps figures are YouTube’s listed H.264 live-ingest values; they are not a guarantee that a particular Pi or network will sustain a stream. Leave capacity for audio and network variation, and use a bitrate your upstream connection can maintain consistently. If the stream drops frames or YouTube reports unstable health, lower the video bitrate or choose 30 fps rather than forcing a higher setting.

Set the live encoder parameters

For a straightforward 720p Pi stream, H.264 is a compatibility-focused choice. YouTube accepts other video codecs too, so H.264 is not an exclusive YouTube requirement. For typical SDR, YouTube’s advanced recommendations include square pixels, progressive scan, Rec. 709, AAC or MP3 audio, and 128 Kbps stereo audio.

  • Resolution: 1280 × 720.
  • Frame rate: 30 or 60 frames per second, matched to the source and what the Pi can sustain.
  • Video codec: H.264.
  • Rate control: CBR (constant bitrate).
  • Keyframes: one every two seconds. YouTube recommends two seconds and lists four seconds as the maximum interval.
  • Protocol: RTMPS is YouTube’s recommended ingest protocol; use the server address provided in Live Control Room.
  • Audio: if sending stereo audio, AAC or MP3 at 128 Kbps is among YouTube’s advanced recommendations.

A two-second keyframe interval means the GOP size should correspond to twice the frame rate: 60 frames at 30 fps or 120 frames at 60 fps. In FFmpeg terms, -g commonly sets the GOP size in frames, but encoder options differ. Confirm how your selected encoder interprets keyframe settings rather than assuming the same flag behaves identically across builds.

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.

Adapt an FFmpeg command for your Pi

These are templates, not tested, universal copy-and-paste commands. Replace the input section with the syntax for your capture device and audio source, confirm all options against your FFmpeg build, and substitute your private YouTube ingest address and stream key. Never publish the key or leave it in a shared script, screenshot, or public log.

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.

Pi 4: hardware H.264, if available

On a Pi 4, Raspberry Pi’s performance guidance discusses the h264_v4l2m2m hardware H.264 path. If your installed FFmpeg exposes it, the following shows the intended output settings. The and text is explanatory placeholder text and must be replaced with real FFmpeg arguments for your device; it is not a runnable command as written.

ffmpeg -i -an -vf scale=1280:720 -r 30 -c:v h264_v4l2m2m -b:v 5M -minrate 5M -maxrate 5M -bufsize 10M -g 60 -f flv "rtmps://YOUR_INGEST_SERVER/YOUR_STREAM_KEY"

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.

This example uses 30 fps and a 5 Mbps target as an illustrative value within YouTube’s listed 720p H.264 live range, not a recommended setting for every connection. It disables audio with -an; remove that option and add the correct audio input and encoder settings if your stream needs sound. Check that your hardware encoder accepts the rate-control options shown and provides the CBR behavior you intend.

Pi 5: software H.264, with CPU headroom

Raspberry Pi’s current performance guidance describes software encoding with libx264 on Pi 5. Software encoding uses CPU capacity, so monitor load and stream stability during a representative test. Raspberry Pi’s camera documentation notes that Pi 5 software encoding can have greater latency than older hardware encoders in some real-time cases; for the rpicam-vid camera workflow, --low-latency reduces encoding latency with a coding-efficiency tradeoff.

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

ffmpeg -i -an -vf scale=1280:720 -r 30 -c:v libx264 -preset veryfast -b:v 5M -minrate 5M -maxrate 5M -bufsize 10M -g 60 -x264-params "nal-hrd=cbr" -f flv "rtmps://YOUR_INGEST_SERVER/YOUR_STREAM_KEY"

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

As with the Pi 4 template, replace the explanatory input placeholders, verify the options supported by your FFmpeg build, and configure audio separately if needed. The example’s preset and CBR-related options are not a guarantee that every build or output path will behave identically; confirm encoder behavior and YouTube stream health in a test.

Adjusting the templates for 60 fps

If the source and Pi can sustain 60 fps, change -r 30 to -r 60 and the two-second GOP example from -g 60 to -g 120. Do not up-convert a 30 fps source just to select 60 fps: that does not create additional motion detail and can waste processing and upload capacity.

Connect to YouTube Live and test

  1. Open YouTube Live Control Room. Create or select the live event and obtain its RTMPS ingest server address and stream key. Use the key privately; do not expose it in examples or logs.
  2. Build the FFmpeg input section. Add the correct video and, if needed, audio device arguments for your Pi, OS, and FFmpeg build. Check that FFmpeg recognizes the intended encoder.
  3. Set output parameters. Use 1280 × 720, a source-appropriate frame rate, H.264, CBR, and a two-second keyframe interval. Keep the bitrate within YouTube’s listed live range and your sustainable upload capacity.
  4. Start a private or otherwise appropriate test stream. Verify that video and audio arrive correctly and that the picture is not cropped, stretched, or unexpectedly silent.
  5. Test representative content and watch stream health. YouTube advises testing with audio and movement similar to what you will stream. Check Live Control Room stream health before the event and monitor it while live.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Copyright and channel-policy checks

Using FFmpeg to transmit a video does not grant permission to stream it. Before broadcasting, make sure you have the rights needed for the video, music, and other material in the feed. YouTube’s live-stream checks can flag content, and a technically healthy stream does not establish that the content complies with copyright or channel policies. For a pre-recorded or looping program, consider whether the content and presentation comply with YouTube’s rules on reused content and monetization; passing a live ingest test does not guarantee monetization eligibility.

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.

Troubleshoot common problems

  • FFmpeg says the encoder is unknown: Your build may not include the named encoder. Inspect the encoders available in that build and select a supported path; the Pi 4 hardware encoder and Pi 5 software-encoder guidance are not interchangeable.
  • The Pi cannot keep up or the stream stutters: Check CPU load, frame drops, and stream health. On Pi 5, software encoding can be demanding; reduce the frame rate to 30, reduce bitrate within YouTube’s live guidance, or simplify the source workflow.
  • YouTube reports unstable stream health: The bitrate may exceed steady upstream capacity, or the connection may be varying. Test with motion and audio, then lower the bitrate or frame rate until the feed is stable.
  • Video arrives but audio does not: The templates use -an to make the video-only case explicit. Remove it only when adding the correct audio input and encoder options for your microphone or other source.
  • YouTube does not receive the stream: Recheck the RTMPS server address and private stream key copied from the current Live Control Room event. Keep the key secret, and confirm that the output format and encoder are supported by your FFmpeg build.
  • Latency is too high for the use case: Pi 5 software encoding may introduce more latency than older hardware encoders in some real-time camera cases. Raspberry Pi documents rpicam-vid --low-latency as a way to reduce encoding latency, with a coding-efficiency tradeoff; confirm that this camera workflow fits your setup.

Or let it run in the cloud

If your goal is an always-on YouTube channel playing uploaded videos rather than a live camera feed, StreamNeo is a different option from running FFmpeg on a Pi. Upload the recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; StreamNeo loops the uploaded video in the cloud, with automatic recovery if YouTube drops the stream. Uploaded quality is preserved up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers. The first day is free with no card required. The monthly option is $9.99 per month.

StreamNeo is for uploaded-video playback to YouTube, not a camera feed. See StreamNeo for plan details, or start the free first 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.

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
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.