DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › FFmpeg

How to Stream Prerecorded Videos to YouTube Live from Ubuntu with FFmpeg

By Freedom251 Team · · 6 min read

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

You can send a prerecorded video from Ubuntu to YouTube Live with FFmpeg: enable live streaming for your channel, create or schedule an event in YouTube Studio, then use its RTMPS ingest URL and stream key in an FFmpeg command. For a scheduled event, FFmpeg starting is not enough—wait for the preview and click Go live in Live Control Room. The local method requires the Ubuntu computer and its internet connection to remain available for the duration of the stream.

Before you start

  • Your YouTube channel must be verified and have no live-streaming restrictions in the previous 90 days. Check the current eligibility and setup in YouTube’s live-streaming help.
  • Have the video file on the Ubuntu computer and an internet connection with enough upload capacity for the chosen stream bitrate.
  • Install an FFmpeg build that includes the needed video encoder, audio encoder, FLV muxer and RTMPS protocol support. Package builds vary, so check your installed build rather than assuming it has every component.
  • Treat the stream key as a password. Do not expose it in screenshots, shared scripts, public logs or shell history; reset it in YouTube if it is compromised.

Create a YouTube Live event and copy its ingest details

  1. Open YouTube Studio and go to Create > Go live to open Live Control Room. Create an immediate stream or schedule an event.
  2. In the encoder or stream settings, copy the stream URL and the stream key for that event. Use the RTMPS address shown by YouTube, not a hostname copied from an example. YouTube explains that RTMPS encrypts the connection in its RTMPS setup instructions.
  3. Keep the URL and key private. The key must match the selected event; if it is exposed, reset it through YouTube’s stream settings.

For an immediate stream, configure FFmpeg and begin sending. For a scheduled stream, you will start FFmpeg first, then inspect the incoming preview and click Go live when ready.

As an Amazon Associate I earn from qualifying purchases.

Choose encoding settings that fit the video and connection

YouTube’s current encoder recommendations list RTMP/RTMPS ingest, with RTMPS recommended; H.264, H.265/HEVC or AV1 video; frame rates up to 60 fps; and a two-second keyframe interval, not exceeding four seconds. The source file, installed FFmpeg build and available upload capacity determine which settings are practical. These are ingest recommendations, not a guarantee that a particular file can be sent unchanged.

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.
Setting YouTube recommendation or consideration
Rate control CBR
Keyframes Two-second interval recommended; maximum interval four seconds
Audio codec AAC or MP3; 5.1-channel audio over RTMP/RTMPS requires AAC
Audio sample rate 44.1 kHz for stereo; 48 kHz for 5.1
Audio bitrate 128 Kbps recommended for stereo; 384 Kbps for 5.1
SDR color Rec. 709
H.264 bitrate examples 5–14 Mbps at 1080p30; 6–17 Mbps at 1080p60; 3–8 Mbps at 720p30 or 720p60

The bitrate ranges are YouTube’s published H.264 recommendations, accessed in 2026; consult its linked encoder page for the complete current table, including minimum and recommended values for other resolutions and codecs. Test with representative movement and audio, and make sure your sustained upload capacity can support the chosen bitrate.

#1 Best Overall
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS | Capture Card for Streaming, Compatible with iPad Mac OS Windows, Quest 3, OBS, PS5/4, Switch2/1, Xbox, Camera (Silver)
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0

Check FFmpeg and prepare a safe command

First inspect the local build and the input file:

  • ffmpeg -version shows the installed version and build configuration.
  • ffmpeg -protocols lists protocols available in that build; confirm RTMPS support.
  • ffmpeg -encoders and ffmpeg -muxers help confirm the video/audio encoders and FLV muxer are available.
  • ffprobe -hide_banner -i input.mp4 (if ffprobe is installed) reports the input’s video dimensions, frame rate and audio streams. Use the actual filename and inspect the output before choosing conversion settings.

The following is an illustrative pattern, not a tested command for every Ubuntu package, video or YouTube event. Replace the endpoint and key using the values in your Live Control Room; adapt resolution, frame rate, audio mapping and bitrate to the input and connection. Do not publish a command containing a real key.

ffmpeg -re -stream_loop -1 -i input.mp4 
  -c:v libx264 -preset veryfast -b:v 6000k -maxrate 6000k -bufsize 12000k 
  -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv 'rtmps://CURRENT_INGEST_URL/STREAM_KEY'

At 30 fps, a GOP of 60 frames corresponds to a two-second keyframe interval. At a different frame rate, adjust -g and -keyint_min to keep the interval near two seconds. The sample’s 6000 Kbps video rate is an example value, not a universal setting; choose a value in line with YouTube’s current table and your upload capacity. The command encodes video as H.264 and audio as AAC, so it will not preserve the original encoding unchanged.

Rank #2
Audio Express AXHDCAP 4K HDMI Video Capture Card, Cam Link Card Game Audio Adapter HDMI to USB 2.0 Record Capture Device for Streaming, Live Broadcasting, Video Conference, Teaching, Gaming
  • [Enhanced 4K-1080P Video Capture Experience] Capture the Magic: Elevate your video recordings to new heights with our upgraded anti-static 1080P Video Capture Card. Immerse yourself in stunning visuals, supporting HDMI input at 4K 60FPS and USB output for capturing in 1080P, complete with rich stereo sound. Enjoy crystal-clear video recordings, dynamic gaming live streams, and professional conference broadcasts. Note: HDMI resolution: Max input can be 3840×2160@30Hz / Video output resolution: Max output can be 1920×1080@30Hz
  • [Seamless Real-Time Preview] Stay in the Moment: Our advanced ultra-low latency technology ensures seamless real-time transmission of video streams. Experience instant, lag-free previews, allowing you to capture every detail precisely. Effortlessly record video directly to your hard disk, all without compromising on quality or introducing any delays.
  • [Versatility and Broad Compatibility] Your Creative Hub: Connect your DSLR, camcorder, or action camera to a wide range of operating systems, including Windows, MacOS, and Linux. Unlock a world of possibilities with real-time streaming to popular platforms like Twitch, Youtube, OBS, Zoom, Potplayer, and VLC, giving you the tools to share your content effortlessly.
  • [Effortless Plug and Play] Simplicity Redefined: Say goodbye to complex installations. Our plug-and-play design eliminates the need for drivers or external power supplies. Seamlessly integrate high-definition acquisition into various scenarios, whether it's educational recordings, immersive gaming, precise medical imaging, captivating live streams, or professional broadcasting.
  • [Seize Every Detail with Precision] Unleash your creativity and attention to detail with our video capture card. Capture every nuance, every color, and every moment with precision, thanks to the enhanced capabilities of our technology. Whether you're a content creator, a gamer, or a professional, our capture card empowers you to seize the finest elements and bring them to life in your recordings and live streams.

-stream_loop -1 repeats the input indefinitely. Remove it if you want one pass. With looping, the stream continues to send the file repeatedly until you stop FFmpeg or the connection ends. The single-input example assumes the file has suitable audio; if it has no audio, or multiple audio streams, inspect and configure stream mapping rather than assuming the example’s audio selection is right.

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

Keep credentials out of shell history and shared files. A safer approach is to restrict access to any configuration or script containing the key, avoid pasting it into public logs, and use the secret-handling method appropriate to your shell and setup. FFmpeg command-line credentials may still be visible to local users or process inspection, so avoid running them on a shared machine.

Rank #3
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.

Start the encoder, verify the preview and finish the event

  1. Start FFmpeg with the correct input, event URL and protected stream key. Watch its output for connection or encoding errors.
  2. In Live Control Room, wait for YouTube to receive the feed. Check the preview, stream health messages, picture and audio.
  3. For a scheduled event, click Go live in Live Control Room only when the preview is ready. Starting FFmpeg alone does not make the scheduled public event live.
  4. Check that the event is accessible on its watch page and, where relevant, from a mobile device. Continue monitoring audio and video quality during the broadcast.
  5. When finished, end the event in Live Control Room where applicable, then stop FFmpeg. YouTube says streams under 12 hours are automatically archived; do not assume the same archive behavior for longer streams.

YouTube recommends setting up encoders at least two hours before an event, starting them at least 15 minutes before its scheduled time, testing comparable motion and audio, and monitoring the stream. These are operational recommendations, not guarantees against network or service interruptions.

Troubleshooting FFmpeg to YouTube Live

  • No connection or repeated timeout: Confirm you copied the RTMPS URL for the right event, including the correct scheme and server. Check that your FFmpeg build supports RTMPS and that the network allows the connection.
  • TLS or SSL error: Verify that you are using the RTMPS address rather than RTMP. YouTube’s RTMPS guidance suggests trying port 443 if the URL otherwise appears correct; use the current account-provided endpoint and do not guess a hostname.
  • No preview in Live Control Room: Check that FFmpeg is actively sending to the URL and key for the selected event. Read FFmpeg’s output and YouTube’s Live Control Room messages for connection or ingest errors.
  • Buffering or unstable ingest: Check sustained upload capacity and test with representative content. Reduce resolution or bitrate to a level the connection can sustain, then verify the preview and stream health again.
  • Missing or unsupported audio: Inspect the input’s audio streams and FFmpeg stream mapping. Use an ingest-supported audio codec and sample rate; YouTube currently lists AAC or MP3 for RTMP/RTMPS.
  • FFmpeg appears to be running, but viewers cannot watch: A running process alone does not prove the event is live. Check YouTube’s preview and health status, click Go live for a scheduled stream, and verify the watch page and actual audio/video output.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If you need a YouTube channel to keep playing uploaded videos 24/7, StreamNeo is a cloud alternative to leaving an Ubuntu process running at home. Upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops the uploaded videos from the cloud, so nothing has to stay on at home. Each slot streams the uploaded quality up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers, and automatically recovers if YouTube drops the stream. The first day is free with no card; one free day is available per account.

Rank #4
Sale
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.

StreamNeo streams to YouTube only and plays uploaded videos; it does not broadcast a camera feed. If that fits your use case, see StreamNeo or start your free day.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Capture Card, USB Video Capture Card Device, Audio Video Converter Grabber for RCA to USB-Convert VHS Mini DV VCR Hi8 DVD to Digital, for PC TV Tape Player Camcorder, MAC Windows Vista Compatible
  • AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
  • Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
  • Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
  • Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
  • Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions

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.

FFmpeglive streamingRTMPSUbuntuYouTube Live

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.

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.