To broadcast a recorded sermon as a YouTube Live stream from Ubuntu Server 24.04, prepare a YouTube Live broadcast, then use FFmpeg to play the local video at normal speed and send its audio and video to YouTube over RTMPS. You will need the broadcast’s ingestion URL and private stream key, a readable media file, and an internet connection able to sustain the chosen bitrate. The commands below are templates: check your server’s FFmpeg build and the file’s codecs before choosing stream copy or transcoding.
What you need before you start
- A YouTube channel with access to the Live Control Room and a broadcast configured for the intended date and audience. Channel eligibility and account-specific settings can affect what options are available.
- Ubuntu Server 24.04 with FFmpeg installed. Package versions and enabled encoders can vary, so verify the tools on the actual server rather than assuming a particular build.
- A sermon recording stored on the server, with read permission for the account that will run FFmpeg.
- Enough sustained upload bandwidth for the outgoing video and audio bitrate, plus some headroom for network variation.
YouTube treats the incoming encoder stream and the viewer-facing broadcast as related but distinct objects. Select the intended broadcast and use the stream settings associated with it; do not assume that starting an encoder alone creates or starts the correct broadcast. See YouTube’s LiveStreams API reference.
Prepare the YouTube Live broadcast and stream key
- Open YouTube Studio and go to the Live Control Room. Create or select the scheduled broadcast you want viewers to watch.
- Open the broadcast’s stream settings and copy the ingestion address and stream key shown for that stream. Keep the key private: anyone who has it may be able to send video to your channel.
- Use the RTMPS endpoint and path supplied by YouTube. RTMPS adds TLS to RTMP, and YouTube’s ingestion guidance specifies a secure endpoint and port 443. Do not substitute a URL copied from an unrelated example. See YouTube’s RTMPS ingestion guide.
- Leave the Live Control Room available during testing and the event so you can inspect the incoming preview, stream health and messages.
Check the file and the Ubuntu FFmpeg build
First confirm the input path, its audio/video streams and its codecs. Replace /srv/sermons/sunday-sermon.mp4 below with the actual path:
ffprobe -hide_banner -i /srv/sermons/sunday-sermon.mp4
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCheck which FFmpeg version and encoders the server has:
#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.
ffmpeg -versionffmpeg -hide_banner -encoders
Confirm that the file is readable by the account that will run the stream. If the file has unusual codecs, multiple audio tracks, no audio, or variable frame rate, decide how to handle those characteristics before going live. These checks describe your local file and installed build; YouTube’s published guidance does not establish what is installed on a particular Ubuntu 24.04 host.
Choose output settings that YouTube can ingest
YouTube’s encoder guidance lists H.264, H.265/HEVC and AV1 video options, AAC or MP3 audio, constant bitrate (CBR), frame rates up to 60 fps, and a recommended two-second keyframe interval that should not exceed four seconds. Confirm your FFmpeg build supports the codec combination you choose. The current guidance is at YouTube’s encoder settings page.
For an H.264 output, YouTube publishes these minimum and recommended video bitrates by resolution and frame rate:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsRank #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.
| Output | Minimum H.264 video bitrate | Recommended H.264 video bitrate |
|---|---|---|
| 720p30 | 3 Mbps | 8 Mbps |
| 720p60 | 3 Mbps | 8 Mbps |
| 1080p30 | 5 Mbps | 14 Mbps |
| 1080p60 | 6 Mbps | 17 Mbps |
These are YouTube’s published H.264 values, not a guarantee that your connection can sustain them or that every sermon needs the highest setting. Match the output resolution and frame rate to the source and the desired viewing quality, then make sure the server’s upload can hold the video bitrate plus audio and network overhead without interruption. A 1080p30 H.264 example using YouTube’s recommendation is 14 Mbps video; YouTube also recommends AAC stereo audio at 128 Kbps.
Send the sermon with FFmpeg
Use the exact RTMPS ingestion URL and stream key from the selected YouTube broadcast. The commands below are adaptable examples, not a verified Ubuntu 24.04 package-specific test. Put credentials in a protected location and avoid leaving a stream key in shell history, shared logs or screenshots.
Option A: copy already compatible streams
If the file’s video and audio codecs, parameters and stream layout are suitable for YouTube, stream copy avoids re-encoding. This template selects the first video and first audio stream and copies them:
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.
ffmpeg -re -i /srv/sermons/sunday-sermon.mp4 -map 0:v:0 -map 0:a:0 -c:v copy -c:a copy -f flv "rtmps://YOUR_YOUTUBE_INGESTION_URL/YOUR_STREAM_KEY"
Replace the RTMPS placeholder with the full endpoint and key exactly as YouTube provides them. Do not literally include the placeholder text. The -re option reads the file at its natural playback rate instead of sending it as fast as the server can process it. The FLV muxer is used for the RTMP-family output; it does not mean the input file itself must be FLV.
Copying is only appropriate when the source streams are compatible and the output meets the chosen YouTube settings. If YouTube reports an unsupported codec, bitrate or keyframe interval, or if the source has multiple tracks or unsuitable parameters, transcode rather than assuming copy will work.
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
Option B: transcode to 1080p30 H.264 and AAC
For a source that needs transcoding, this template targets 1080p30 H.264 at a 14 Mbps video rate, AAC stereo at 128 Kbps and a two-second GOP. Verify that your FFmpeg build includes libx264 and that the server can encode in real time:
ffmpeg -re -i /srv/sermons/sunday-sermon.mp4 -map 0:v:0 -map 0:a:0 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,fps=30" -c:v libx264 -preset veryfast -tune zerolatency -b:v 14M -minrate 14M -maxrate 14M -bufsize 28M -g 60 -keyint_min 60 -sc_threshold 0 -pix_fmt yuv420p -c:a aac -b:a 128k -ar 48000 -ac 2 -f flv "rtmps://YOUR_YOUTUBE_INGESTION_URL/YOUR_STREAM_KEY"
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →This output scales the picture to fit within 1920×1080, pads to that canvas without changing the aspect ratio, and outputs 30 frames per second. At 30 fps, a 60-frame GOP corresponds to two seconds. The bitrate and GOP values follow YouTube’s published 1080p30 H.264 recommendation and two-second keyframe guidance. Encoding speed depends on the source, CPU and FFmpeg build; if the server cannot encode fast enough, use a lower output target, compatible stream copy, or a machine with more encoding capacity.
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.
If the source has no audio, the example will fail because it maps an audio stream. If it has several tracks, explicitly choose the intended one. If you need a different resolution or frame rate, change the filter, bitrate and GOP together rather than changing only one setting.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Test, then start the broadcast
- Run a test stream well before the sermon is due. Use a recording segment with audio and visual movement similar to the full sermon; a static title card alone will not reveal every issue.
- Check the incoming preview in the Live Control Room. Listen for clean audio, verify picture framing and synchronization, and make sure the stream is arriving under the intended broadcast.
- Monitor YouTube’s stream health and messages. Its diagnostics can report unsupported codecs or resolution, bitrate outside expected ranges, long keyframe intervals, missing audio or video, multiple streams, and starved video. The LiveStreams API documentation describes health states and configuration issues.
- When the test is satisfactory, stop it and start the scheduled broadcast at the intended time using the Live Control Room’s available controls. Confirm the broadcast is live to viewers before leaving the session unattended.
Run the stream unattended on Ubuntu
For an unattended service, run the encoder under an appropriate process supervisor or scheduler, keep logs, and decide how an operator will be alerted if the process exits or YouTube stops receiving data. A restart policy can recover from a process failure, but it does not by itself diagnose network, key, source-file or platform problems. Test the chosen service configuration with the actual user account, file permissions and secrets before relying on it for a live service. The YouTube and Ubuntu sources cited here do not prescribe a specific systemd unit or guarantee a restart policy.
Troubleshooting common failures
- YouTube receives no video: Check that the selected broadcast is the intended one, the RTMPS endpoint and key were copied correctly, and the server can make outbound connections to the provided endpoint on port 443. Review FFmpeg output and the Live Control Room messages.
- Authentication or connection fails: Recopy the stream key and full ingestion address from the selected broadcast, check for accidental whitespace or truncation, and ensure the URL uses the secure RTMPS endpoint YouTube supplied.
- Unsupported codec, resolution or keyframe warning: Inspect the input with
ffprobe. If its streams do not match YouTube’s settings, transcode to a supported output and keep the keyframe interval at two seconds or less than or equal to four seconds. - Bitrate warning or unstable health: Compare the configured output with the chosen resolution and frame rate, then check sustained upload capacity. Reduce the output resolution or bitrate if the connection cannot maintain the target; avoid setting the encoder at the limit of a variable connection.
- Audio is absent or wrong: Confirm an audio stream exists, map the intended track, and check the Live Control Room preview. The example commands select the first audio stream only.
- Video stutters or falls behind: Check whether FFmpeg is encoding slower than real time, whether the server is overloaded, and whether the connection is stable. Test the same output settings before the event and use stream-health messages to distinguish encoding from ingestion problems.
- FFmpeg cannot find the file: Use the absolute file path and confirm read access for the service account. A path available in an interactive shell may not be accessible to a service running as another user.
File containers are not the same as the live output
An input sermon can be an MP4, MKV or another readable format; the outgoing stream is packaged for the selected RTMP-family protocol. OBS’s format guide describes MKV as its default for resilient local recording, MP4 as widely compatible but requiring finalization, and FLV as an RTMP container with limited H.264/AAC codec support. Those notes apply to OBS recordings and do not mean you must convert a source sermon to FLV before FFmpeg reads it. See the OBS Audio/Video Formats Guide.
Or let it run in the cloud
If you do not want an Ubuntu server, home computer or network connection responsible for keeping the broadcast running, StreamNeo is a YouTube-only cloud service for looping uploaded videos. Upload the sermon recording or build a playlist, add your YouTube stream key once, and go live. The service keeps playback running in the cloud, supports uploads as made up to 4K 60fps at one flat price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly is $9.99 per month. Start your free StreamNeo 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.




