Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon 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×
Skip to content
DocumentaryTube
Admit one · Blog

How to Run a 24/7 YouTube Stream of Church Sermons with systemd on Ubuntu

A practical guide to looping church sermon videos with FFmpeg on Ubuntu, supervising the process with systemd, monitoring YouTube health, and planning archives.
Opened Runtime8 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can keep prerecorded church sermons streaming to YouTube from an Ubuntu host by looping the media with FFmpeg and running FFmpeg as a systemd service. The service can start at boot and restart after a process exits, but it cannot guarantee YouTube is receiving healthy audio and video: test the broadcast and monitor YouTube Studio as well as the local service.

What you need before setting up the stream

  • A YouTube channel enabled for live streaming. First-time activation can take up to 24 hours, according to YouTube Help, so enable it well before your planned launch. In YouTube Studio, create or select a stream and retrieve its ingest URL and stream key. Keep the key secret; treat it like a password and do not put a real key in a public script, repository, log, or screenshot. YouTube’s live-streaming setup guide explains connecting an encoder with the URL and key.
  • An always-on Ubuntu host. It may be a church-owned machine or a Linux server you administer. The sermon media must be accessible locally, and the host needs enough CPU for the selected encoding settings and stable outbound upload capacity. No one host size fits every file, resolution, and network.
  • FFmpeg and systemd. Check the FFmpeg version installed on the host before relying on particular options; available encoders and behavior depend on the build. FFmpeg reads file inputs and writes to output URLs, and option placement matters because many options apply to the next input or output.
  • Permission for every part of the recording. Confirm that your church may rebroadcast the sermon, music, artwork, and other third-party material. The technical setup does not establish rights or resolve legal requirements for your jurisdiction.

Choose stream settings and prepare the media

Set resolution, frame rate, and bitrate with the actual upload connection and content in mind. A spoken sermon with a still image or simple slides may not need the same bitrate as detailed motion video; test representative material rather than assuming one preset suits every church or connection. YouTube’s encoder guidance lists RTMP and RTMPS ingest, supports H.264, H.265, and AV1, and supports frame rates up to 60 fps. It recommends constant bitrate and a 2-second keyframe interval, which should not exceed 4 seconds. YouTube recommends RTMPS for encrypted transport. See YouTube’s encoder settings for current platform guidance.

Use a speed test to check upload capacity before choosing a bitrate. YouTube Help says, “We recommend running a speed test to test your upload bitrate.” Leave practical headroom for network variation and other traffic, and verify the resulting picture and sound in a test broadcast. The exact sustainable bitrate depends on the connection and the chosen output settings.

For a finite local video that should repeat, FFmpeg’s input-loop option is -stream_loop -1. Put it before the relevant -i. The following is an illustrative command structure, not a tested, universal configuration; replace the paths, ingest URL, settings, and key handling for your installed FFmpeg build and media.

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.
ffmpeg -stream_loop -1 -re -i /srv/sermons/sermon.mp4 
  -map 0:v:0 -map 0:a? 
  -c:v libx264 -preset veryfast -b:v 2500k -maxrate 2500k -bufsize 5000k 
  -r 30 -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv "rtmps://INGEST-URL/STREAM-KEY"

This example assumes a video stream and optional audio stream, H.264 video, 30 fps, a 2-second GOP, and AAC audio. The numerical encoding values are example choices, not YouTube requirements or a guarantee of quality or fit. Confirm supported encoders and options with the installed FFmpeg build, for example by checking its version and encoder list. Substitute the actual YouTube ingest endpoint and key without exposing the key in a public file or log. For production, use a protected configuration or secret-handling approach appropriate to your server rather than publishing credentials in a script.

FFmpeg option order is significant: input options such as -stream_loop belong before the input they affect, while output encoding options belong before the output URL. The -re option reads file input at its native rate, which is useful for simulating a live feed rather than sending a file as fast as possible. If the media is a playlist or has unusual stream layout, revise input and mapping rather than assuming this single-file example applies.

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.

Create a systemd service to start FFmpeg at boot

Run the stream as a dedicated, unprivileged Linux account. Store media and configuration in locations readable by that account, and restrict access to files containing the stream key. The unit below shows a typical pattern; adapt paths and command options to your server. It is not a substitute for testing the service and broadcast on the installed Ubuntu and FFmpeg versions.

  1. Create a service account and prepare paths. Make sure the chosen account can read the sermon file and any protected configuration, but does not have unnecessary administrative privileges. Choose a stable working directory.
  2. Create the unit file. As an administrator, create /etc/systemd/system/sermon-stream.service. Put the actual FFmpeg command in ExecStart as a single command line; do not place shell variables or shell redirection there unless you explicitly invoke a shell. Keep credentials protected.
[Unit]
Description=Church sermon YouTube stream
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=sermonstream
WorkingDirectory=/srv/sermons
ExecStart=/usr/bin/ffmpeg -stream_loop -1 -re -i /srv/sermons/sermon.mp4 -map 0:v:0 -map 0:a? -c:v libx264 -preset veryfast -b:v 2500k -maxrate 2500k -bufsize 5000k -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -c:a aac -b:a 128k -ar 44100 -f flv rtmps://INGEST-URL/STREAM-KEY
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Restart=always and RestartSec=10 are typical configurable choices, not settings that ensure recovery from every fault. In particular, a process restarting does not fix a wrong key, inaccessible media, a sustained network outage, or a YouTube-side issue. Protect the service definition if it contains a real key; a key embedded in a unit can be exposed to administrators and may appear in diagnostic output.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
  1. Reload systemd, enable the service, and start it. Enabling configures boot behavior; starting launches it for the current session. They are separate operations. Run these commands as an administrator:
sudo systemctl daemon-reload
sudo systemctl enable sermon-stream.service
sudo systemctl start sermon-stream.service
  1. Inspect its state and logs. Check both immediately and after a restart or reboot test:
sudo systemctl status sermon-stream.service
sudo journalctl -u sermon-stream.service -f

systemd’s boot targets collect units needed during startup, and enabling a unit attaches it to a startup target. See the systemd unit documentation. A service showing “active” means the local process is running; it does not establish that YouTube is receiving usable audio and video.

Test the broadcast and monitor its health

Before relying on a 24/7 broadcast, run a test with representative sermon audio and video. YouTube says, “Make sure to test before you start your live stream.” Open the stream in YouTube Studio and check its preview and stream-health indicators while also watching the FFmpeg journal. Confirm that viewers can hear intelligible audio, see the intended picture, and that the stream remains connected.

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
  • Local service status: use systemctl status to see whether the process is running or repeatedly failing.
  • Local logs: use journalctl to find errors such as missing files, unsupported encoders, malformed options, or connection failures.
  • YouTube reception: use YouTube Studio’s preview and stream health to verify the platform receives the signal. A clean local log or active service alone is not an end-to-end health check.

For ongoing operations, assign someone to respond to alerts or check both sides of the stream. Restart policies can retry after a process exits, but they do not detect every silent or degraded broadcast condition.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Plan for sermon archives separately

YouTube Help says streams under 12 hours are automatically archived. A single continuous 24/7 event exceeds that stated automatic-archive threshold, so do not rely on it to produce complete, neatly separated sermon recordings. If complete archives matter, either divide broadcasts intentionally into shorter events and verify the resulting archive behavior, or maintain a separate local recording and retention process. YouTube’s Live API documentation describes archive and DVR settings and notes that archive availability depends on those settings: live broadcast resource.

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.
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.

Common problems and fixes

Symptom Likely cause What to check
Live streaming is not available yet First-time channel activation may still be processing. Enable live streaming in advance; YouTube says first-time activation can take up to 24 hours. Check channel status in YouTube Studio.
FFmpeg exits immediately Invalid command, unsupported encoder or option, unreadable media, or incorrect paths. Inspect journalctl -u sermon-stream.service, verify the file path and permissions, and check the installed FFmpeg build and available encoders.
FFmpeg runs, but YouTube does not show a healthy stream Incorrect ingest URL or key, incompatible output, connection trouble, or another platform-side problem. Verify the URL and key in YouTube Studio, keep the key private, check the encoder settings and FFmpeg logs, then inspect YouTube’s preview and health indicators.
The stream repeatedly disconnects and restarts Unstable outbound connectivity, a process error, or an upstream interruption. Review service logs and network stability. systemd can restart an exited process, but retries alone cannot repair a persistent network or YouTube-side fault.
The picture or audio is wrong or missing Unexpected file streams, mapping, codec support, or output settings. Inspect the source media’s streams, adjust FFmpeg mapping and encoding for that file, and test with YouTube before unattended operation.
A full-day archive is missing or incomplete The broadcast was one continuous event beyond YouTube Help’s under-12-hour automatic-archive statement, or archive/DVR behavior differs. Use shorter intentional broadcasts or a separate recording workflow, and verify archive settings and actual results.

Choose self-hosting or a managed cloud stream

FFmpeg plus systemd gives a church control over its Ubuntu host, media paths, and configuration, but the church must administer storage, networking, service configuration, and monitoring. A managed service moves the always-on process to a provider, but compare storage limits, scheduling and control, archive handling, recurring cost, and service availability before choosing one. YouTube’s encoder guide lists Gyre as a cloud-based option for streaming prerecorded video 24/7; verify its current terms and capabilities directly rather than assuming specific pricing or limits.

For a YouTube-only cloud alternative, StreamNeo runs uploaded videos continuously from the cloud, so a church computer does not have to stay on. Each slot streams the upload as made, up to 4K 60fps, at one flat price per slot rather than quality tiers; it includes 10 GB storage per slot pooled across active slots, looping and playlists, and automatic recovery if YouTube drops the stream. The first day is free with no card, one free day per account. The monthly option is $9.99 per month. UPI and cards are available in India, with card checkout worldwide. StreamNeo plays uploaded videos and streams to YouTube; it does not replace a live camera feed.

Or let it run in the cloud

With StreamNeo, upload the sermon recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; your upload streams at its original quality up to 4K 60fps for one flat price per slot, and the service automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month. It is for uploaded videos on YouTube, not a camera broadcast. Start a StreamNeo free 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.

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 Screening Room

  1. How to Send a YouTube Live Stream to a Premiere—and What “Premiere Playlist” Can’t DoAdmit one · BlogHow to Send a YouTube Live Stream to a Premiere-and What “Premiere Playlist” Can't DoOpened04 OCT 2026Runtime6 min
  2. How to Run a YouTube Live Playlist from a Raspberry PiAdmit one · BlogHow to Run a YouTube Live Playlist from a Raspberry PiOpened04 OCT 2026Runtime4 min
  3. How to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootAdmit one · BlogHow to Make a 24/7 Indian Music YouTube Stream Restart After a Server RebootOpened04 OCT 2026Runtime6 min
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.