Recommended Free Tools
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To run a 24/7 Gurbani stream from Ubuntu, prepare media you have permission to use, publish it to YouTube Live with FFmpeg over RTMPS, and supervise the FFmpeg process with systemd. The machine, network connection, source media, and YouTube stream key must remain available; a restart policy can relaunch FFmpeg after a process failure, but it cannot prevent every interruption.
What you need before you start
- An Ubuntu machine with a reliable internet connection and enough upload capacity for your chosen stream bitrate. It must stay powered on and connected for a local setup to keep streaming.
- A prepared video file, or a tested combination of audio and video sources, that FFmpeg can read continuously.
- A YouTube channel with Live Control Room access and a stream key. YouTube’s activation and account requirements can vary; check the channel’s Live Control Room rather than assuming a new channel can stream immediately.
- Permission to use every recording, arrangement, performance, and visual in the stream. Owning a recording or having permission for one version does not necessarily establish rights to every underlying composition or other asset.
This guide uses one local file containing both audio and video. If your source is audio-only, separate audio and video files, or a playlist, adapt and test the input before installing it as a service.
Install FFmpeg and check your Ubuntu release
Identify the release
Check your Ubuntu release before installing or relying on a package version:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →lsb_release -ds
apt-cache policy ffmpeg
FFmpeg is available from Ubuntu’s package archive. The Ubuntu Packages listing for Ubuntu 24.04 LTS (noble) showed version 7:6.1.1-3ubuntu5 in universe; package versions and repository state vary by release and updates. Do not assume that version applies to another Ubuntu release.
#1 Best Overall
- 【AMD Ryzen 4300U True 4-Core CPU: Outperforms N95 & i3-10110U】KAMRUI P2 Mini PC is equipped with true 4-core AMD Ryzen 4300U processor built on advanced 7nm Zen2 architecture,This means you get consistent, unthrottled performance for hours on end, whether you’re running multiple browser tabs, streaming 4K content, or managing virtual machines. Compare that to Intel N95 (4 efficiency cores that throttle under load) or Intel i3-10110U (only 2 cores total), and the difference is night and day: The KAMRUI P2 AMD Ryzen 4300U (28W) is 40% faster than the Intel i3-10110U and 25% faster than the Intel N95 in multi-core tasks, ensuring smooth, lag-free performance even during heavy workloads.
- 【Integrated AMD Radeon Graphics: 2.5X Stronger for Tri 4K】The KAMRUI P2 AMD 4300U Mini PC have unlocked the full potential of the built-in AMD Radeon Vega 5 graphics with 28W power delivery, making it 2.5 times stronger than the Intel UHD graphics found in the N95 and i3-10110U. This means you can enjoy Tri 4K@60Hz displays without a single stutter, perfect for productivity setups, home theaters, or even light photo/video editing and casual gaming. While the Intel N95/i3-10110U struggle to run a single 4K display without lag, The KAMRUI AMD 4300U Mini PC handles Tri 4K effortlessly, turning your workspace into a high-efficiency hub or your living room into a premium entertainment center.
- 【Large Storage Capacity, Easy Expansion】KAMRUI Pinova P2 mini computers is equipped with 16GB LPDDR4 for faster multitasking and smooth application switching. 512GB M.2 SSD ensures fast startup, fast file transfers and plenty of storage space,eliminating slow loading times and ensuring fast responsiveness. the two storage slots (1x M.2 2280 SATA/NVMe PCIe3.0 slot, 1x M.2 2280 SATA slot) can be combined to provide up to 4TB of total storage(Not included). This gives you enough space for all your projects, media and data.
- 【4K Triple Display】KAMRUI Pinova P2 4300U mini desktop computers is equipped with HDMI2.0 ×1 +DP1.4 ×1+USB3.2 Gen2 Type-C ×1 interfaces for faster transmission, Triple 4K@60Hz Display, KAMRUI P2 mini computer is ideal for visual home entertainment, home office, conference rooms, etc. USB3.2 Gen2 Type-A port ×2 with a transfer speed of up to 10 Gbps (21 times faster than USB 2.0) for efficient data transfer. Ideal for seamless multitasking between spreadsheets, browsers and presentations, or for an immersive entertainment experience.
- 【USB3.2 Gen2 Type-C 10Gbps, Versatile connectivity】KAMRUI P2 mini desktop pc fast and versatile connectivity! The USB3.2 Gen2 Type-C port offers a data transfer rate of 10Gbps and simultaneously supports DisplayPort 1.4 video output. The P2 AMD Ryzen 4300U Mini PC is complemented by Gigabit LAN, WiFi and Bluetooth, so nothing stands in the way of a productive working environment.
Install and verify
sudo apt update
sudo apt install ffmpeg
ffmpeg -version
If installation fails, check that the repositories configured for your release include the package and that package lists updated successfully. If an encoder or protocol option used below is unavailable, inspect the installed build:
ffmpeg -hide_banner -encoders
ffmpeg -hide_banner -protocols
The package’s build configuration also appears near the start of ffmpeg -version. Use the documentation or local manual matching the installed release; older Ubuntu manpages may describe a different FFmpeg build.
Prepare and test the Gurbani source
Check the media file
Keep the source in a stable location, for example /srv/gurbani/stream.mp4, and confirm that the Ubuntu account which will run FFmpeg can read it. Test the file locally before sending it to YouTube:
ffprobe -hide_banner /srv/gurbani/stream.mp4
ffplay /srv/gurbani/stream.mp4
Listen for silence, clipping, abrupt cuts, and gaps; check that picture and sound stay in sync. If you are using a playlist or separate inputs, test that exact input arrangement first. Do not assume a file that plays once locally will loop without errors.
Rank #2
- 【Great power in a small computer】Get fast performance from the AMD Ryzen 5 3500U CPU (2.1GHz-3.7GHz, 4 Cores 8 Threads) inside this mini pc, TDP 15W up to 25W. It's perfect for all your home office and business use, like daily computing, web browsing, and smooth media streaming. This small desktop computer handles everyday tasks easily and quietly.
- 【Work on many things at once with lots of storage】This mini PC comes with 16GB of fast DDR4 RAM (expandable up to 32GB), allowing you to smoothly run multiple programs, dozens of browser tabs, and large files all at once. It also features a spacious 512GB NVMe SSD that provides ample storage and delivers dramatically faster boot-ups, app launches, and file transfers compared to a traditional hard drive.
- 【See everything clearly on one or two 4K screens】Connect one or two monitors for more space to work or play. Dual HDMI ports on this mini pc support super sharp 4K Ultra HD video. It's great for doubling your work area for business or watching movies in high definition.
- 【Fast modern connections in a tiny box】Enjoy a better and more stable internet connection with the latest WiFi 6. Use Bluetooth 5.3 to connect wireless headphones, keyboards, and mice without wires. This small pc is very compact to save desk space and has extra USB ports (USB 2.0×2, USB 3.0×2, Type-c 2.0×1, Type-c 3.2 full featured×1, HDMI×2) for your printer, webcam, or other computer accessories.
- 【Reliable Warranty and Support】We provides 1 year warranty for each Mini computers. So you don't need to worry about any product problems. If you have any questions about the product, please contact our customer service, we will provide 24-hour professional technical support and serve you at any time.
Choose output quality from the source and connection
Use YouTube’s published encoder recommendations as a starting point, not as a guarantee that a particular connection will be stable. For H.264, YouTube lists these figures:
| Output profile | Minimum bitrate | Recommended bitrate |
|---|---|---|
| 720p30 | 3 Mbps | 6 Mbps |
| 1080p30 | 5 Mbps | 10 Mbps |
Allow upload headroom for network variation; the listed minimum is not a robust 24/7 target. Choose a resolution the source can genuinely support, and test upload capacity at the time and location where the stream will run. YouTube’s encoder settings also list RTMP/RTMPS; H.264, H.265/HEVC, or AV1; up to 60 fps; constant bitrate (CBR); a recommended two-second keyframe interval with a four-second maximum; and AAC or MP3 audio. The example below uses H.264, AAC, CBR, and a two-second keyframe interval.
Create the YouTube stream and protect its key
- Open YouTube Live Control Room and create or select the scheduled live stream.
- Find the current stream URL and stream key shown by YouTube. Prefer the RTMPS ingest URL when available; YouTube describes RTMPS as its secure streaming option.
- Keep the key private. Do not paste a real key into a public script, repository, screenshot, or support post. If a key is exposed, replace or reset it in Live Control Room before relying on the stream.
YouTube’s interface labels can change. Copy the current ingest details from the channel’s own Live Control Room rather than reusing an example URL or key from a guide. Treat the stream key like a password: anyone who obtains it may be able to send video to the stream.
Run a first FFmpeg test interactively
First test with placeholders replaced by the RTMPS base URL and key from Live Control Room. Do not include angle brackets in the actual values. This example loops one file, encodes it as 720p30 H.264 at YouTube’s 6 Mbps recommendation, encodes stereo AAC audio, and publishes in FLV format:
Rank #3
- 【AMD Ryzen 3 5300U CPU: Outperforms N150 & 3500U】 BOSGAME E5 mini PC is powered by the TSMC 7nm FinFET architecture AMD Ryzen 3 5300U processor (4 Cores, 8 Threads, up to 3.8GHz boost, 6MB total cache). Compared to low-end Intel N150 or 3500U chips which only have 4 single threads and throttle under load, the 5300U delivers over 30% faster multi-core speed. Run 30+ browser tabs, large Excel sheets, and Zoom meetings simultaneously without system lag.
- 【8GB DDR4 RAM & 256GB NVMe SSD Storage】 Installed with high-speed 8GB DDR4 dual-channel memory and a fast 256GB M.2 2280 SSD, eliminating slow boot times and application loading delays. To accommodate growing data requirements, the upgradeable hardware design features dual SODIMM slots that allow you to expand memory up to 64GB RAM, ensuring smooth operation during heavy multitasking.
- 【High-Capacity Dual M.2 SSD Storage Expansion】 Never worry about running out of space for your business files. In addition to the pre-installed 256GB system drive, the motherboard houses an extra empty internal M.2 2280 NVMe PCIe 3.0 slot. This allows you to easily add a second solid-state drive for up to an additional 2TB of storage capacity (upgrades not included) without needing to remove or reinstall the original operating system.
- 【Radeon 6-Core Graphics & Triple 4K Displays】 Integrated with official AMD Radeon Graphics (6 Graphics Cores, 1500 MHz frequency) for casual gaming, photo editing, and crisp 4K media decoding. Featuring 1x HDMI 2.0 port, 1x DisplayPort, and 1x Full-Function Type-C port, the E5 outputs true 4K@60Hz resolution to three monitors at once. This multi-screen setup eliminates constant window-switching for traders, programmers, and office workers.
- 【Dual 2.5GbE LAN Ports for Advanced Networking】 Experience fast wired network transmission speeds up to 2500Mbps without lagging or buffering. The integration of dual 2.5 Gigabit Ethernet ports (powered by Realtek RTL8125 controller) makes this compact computer an exceptional hardware choice for tech enthusiasts. Easily configure it into software routers, hardware firewalls (pfSense, OpnSense), home NAS servers, or local homelabs.
ffmpeg -re -stream_loop -1 -i /srv/gurbani/stream.mp4
-vf "scale=-2:720,fps=30,format=yuv420p"
-c:v libx264 -preset veryfast -tune zerolatency
-b:v 6M -minrate 6M -maxrate 6M -bufsize 12M
-g 60 -keyint_min 60 -sc_threshold 0
-c:a aac -b:a 160k -ar 44100 -ac 2
-f flv "/"
At 30 frames per second, a 60-frame GOP sets a two-second keyframe interval. Check that the source and installed FFmpeg build support the selected encoder and options. The scaling filter preserves aspect ratio and makes the width an even number; it does not restore detail absent from a lower-resolution source.
If you need 1080p30 and the source supports it, change the filter to scale=-2:1080,fps=30,format=yuv420p and use YouTube’s listed 10 Mbps H.264 recommendation consistently for -b:v, -minrate, and -maxrate; set -bufsize to 20M. Test that profile on the actual connection before leaving it unattended. If the source is already in the desired format, re-encoding still gives predictable output but uses CPU; stream copying may reduce CPU use, yet it cannot apply the same scaling, frame-rate, or encoding controls and depends on source compatibility.
For a separate audio file and video file, the input mapping and looping strategy must match those sources. Do not simply reuse the single-file command: test the intended inputs, synchronization, and repeat behavior first. FFmpeg protocol and option details depend on the installed build; if a command option fails, check that system’s local FFmpeg documentation and protocol list.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows 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 YouTube before making the stream unattended
- Confirm FFmpeg reports that it is reading the intended file and sending output without recurring errors.
- Check the YouTube preview and stream-health panel for incoming video, audio, and warnings.
- Listen to the preview and confirm that representative movement and audio are present, continuous, and in sync.
- Test a planned stop and restart, and observe whether YouTube receives the stream again. Do not assume restarting the process means the broadcast has no interruption.
- Verify the key has not appeared in terminal captures, logs, shell history, or files accessible to other users.
YouTube recommends testing before a live event, using representative audio and movement, and monitoring stream health and messages. Do not leave a newly assembled command running unattended until this test succeeds.
Rank #4
- Office Gaming Mini PC - UPGRADED GMKtec Nucbox M5 Ultra Series is equipped with the powerful AMD Ryzen 7 7730U processor, 8 Cores/16 Threads, Base 2.00GHz (Power Saving Quiet Mode) with Turbo Boost up to 4.50GHz (Performance Mode) in BIOS settings, Based on the ZEN 3+ architecture, this small but powerful mini pc delivers satisfying results in productivity, office work, and gaming. 35% Performance increase over AMD Ryzen 5 7430U/ Ryzen 7 5700U, 5600U, 5560U, 5500U.
- 16GB DDR4 RAM & 256GB PCIe SSD - Installed with DDR4 16GB RAM (1x16GB), the Nucbox M5 Ultra mini pc support expansion to 64GB RAM. Featured with 256GB M.2 2280 PCIe 3.0 SSD, support dual slot expansion to 4TB SSD. (Upgrades not included)
- DUAL NIC LAN 2.5G RJ45 - Fast Network Speeds: Enjoy up to 2500Mbps data transmission speed without worrying about lagging. Ideal for working, gaming, and surfing the internet. Great for Untangle, Pfsense or as a server office PC.
- Mini Desktop Computer with 4K Triple Screen Display - Nucbox M5 Ultra integrates AMD Radeon Graphics 8 Cores 2000 MHz GPU to deliver powerful graphics processing power to easily handle the demands of complex design software, 4K@60Hz UHD video editing, and playback. It can connect to 3 display screens simultaneously.
- Fast Internet WiFi 6E + BT5.2 Connection - GMKtec Mini PC with WiFi-6E Wireless, have 2.5G/5G/6G triple band, more faster and lower latency. Bluetooth 5.2 allowing you more quickly to connect other wireless devices (headset, mouse, keyboard, etc.) Interface features 2*USB3.2 ports, 2*USB2.0 ports, 1*HDMI 2.0 port(4K@60Hz), 1*USB-C port(PD/DP/DATA), 1*DP Port, 1*Audio 3.5mm (HP&MIC), 1*DC Power Port.
Keep the stream running with systemd
Store credentials in a restricted environment file
Create a root-owned environment file outside your public project directory. Replace the example values with the current YouTube URL and key, without surrounding them in angle brackets:
sudo install -o root -g root -m 600 /dev/null /etc/gurbani-stream.env
sudoedit /etc/gurbani-stream.env
Put these two lines in the file:
STREAM_URL=rtmps://YOUR_CURRENT_INGEST_URL
STREAM_KEY=YOUR_PRIVATE_STREAM_KEY
Use the exact URL form YouTube displays for the selected stream; if it already includes a path component, do not accidentally duplicate it. The service below appends the key after a slash, so the values must correspond to that format. Keep the file readable only by root. Avoid placing the key in the unit file itself, where it is easier to expose through copied configuration.
Create a service unit
Create /etc/systemd/system/gurbani-stream.service:
sudoedit /etc/systemd/system/gurbani-stream.service
Use this unit, adjusting the file path and FFmpeg binary path if your setup differs:
Free tools Windows power users keep installed
One-click scans. No signup required.
[Unit]
Description=Gurbani YouTube live stream
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
EnvironmentFile=/etc/gurbani-stream.env
ExecStart=/bin/sh -c 'exec /usr/bin/ffmpeg -nostdin -re -stream_loop -1 -i /srv/gurbani/stream.mp4 -vf scale=-2:720,fps=30,format=yuv420p -c:v libx264 -preset veryfast -tune zerolatency -b:v 6M -minrate 6M -maxrate 6M -bufsize 12M -g 60 -keyint_min 60 -sc_threshold 0 -c:a aac -b:a 160k -ar 44100 -ac 2 -f flv "$STREAM_URL/$STREAM_KEY"'
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
This unit uses the same 720p30 H.264 profile as the interactive test and starts FFmpeg without interactive input. Confirm the binary location with command -v ffmpeg. The shell expands the environment variables at process start; the key remains outside the unit file. Test the service with your actual URL format and credentials before enabling it at boot.
Best Value
- WHY CHOOSE G3 ULTRA MINI PC PENTIUM GOLD 7505 - Choose the Intel Pentium Gold 7505 for snappier everyday responsiveness: It delivers up to 30% faster single-core performance than the Ryzen 5 3500U, making office apps and web browsing feel noticeably quicker, while its Intel UHD Graphics (48 EUs) provides 2.4x the GPU performance of the N100 & N150's 24-EU graphics, ensuring smoother 4K streaming and light photo editing.
- 16GB RAM MEMORY & 512GB STORAGE - GMKtec Nucbox G3 Ultra mini computer is prebuilt with 16GB LPDDR4 RAM at 3200 MT/s, you will enjoy a speedier experience with Built-in 512GB M.2 SATA Hard Drive. Our mini desktop pc boots up in seconds, work on multiple browser tabs, software applications and quickly transfers files. There is a primary slot and secondary expansion storage. Primary slot is M.2 2280 PCIE and secondary slot is M.2 2280 SATA.
- RICH INTERFACE - Nucbox pentium mini computer is equipped with 3* USB 3.2 Gen2 ports, up to 10Gbps/S, 1*USB 2.0, HDMI(4K@60Hz)*2, 3.5mm Audio Jack. Supports WiFi 6, and Gigabit Ethernet RJ45 2.5GbE network connectivity, Bluetooth 5.2. This Mini PC supports multiple device connection and can be used with servers, monitoring equipment, office equipment, displays, projectors, televisions, etc.
- 4K DUAL SCREEN DISPLAY - Mini desktop computer is equipped with upgraded Intel Graphics(max 1000MHz), supports 4K video playback and AV1 decoding, connect the pc with a projector as a home theatre, enjoy a variety of entertainments. Two HDMI 2.0 ports allows you to multi-task efficiently on two 4K@60Hz displays.
- UPGRADED COOLING FAN - The G3 Ultra has upgraded the cooling fan to reduce fan noise and thermals. We are using an upgraded thermal paste as well to help reduce heat on the CPU.
Start it, enable it at boot, and inspect logs
sudo systemctl daemon-reload
sudo systemctl start gurbani-stream.service
sudo systemctl status gurbani-stream.service
sudo journalctl -u gurbani-stream.service -f
Once the stream works as a service, enable automatic startup after a reboot:
sudo systemctl enable gurbani-stream.service
To stop it deliberately, run sudo systemctl stop gurbani-stream.service. The Restart=always policy asks systemd to relaunch the process after it exits, including after an intentional stop only once a later start action occurs; systemd does not continuously restart a unit that an administrator has explicitly stopped. Confirm the behavior on the installed Ubuntu version and test one actual process failure before depending on it.
Systemd can restart a failed FFmpeg process, but it cannot fix invalid media, a revoked key, a failed network, a full disk, or a YouTube-side interruption. Inspect both the journal and YouTube’s stream-health panel, and make sure repeated restarts do not conceal a persistent error.
Troubleshoot common failures
FFmpeg exits immediately or cannot open the input
- Likely cause: A path typo, unsupported or damaged file, or insufficient file permissions for the service.
- Fix: Run
ffprobeon the exact path, play the file locally, and check its permissions. The service runs as root by default unless you configure a different user; if you do, grant that account the required read access.
YouTube receives no video or reports a connection problem
- Likely cause: An incorrect ingest URL or key, blocked outbound connection, unsupported protocol in the FFmpeg build, or an incorrect URL/key join.
- Fix: Copy current credentials from Live Control Room, verify the URL form and key separator, check
ffmpeg -protocols, and review the service journal. Reset an exposed or suspected-compromised key.
Stream health is unstable or YouTube reports dropped frames
- Likely cause: Insufficient or variable upload capacity, CPU saturation during encoding, or a source/output profile that is too demanding for the host.
- Fix: Test the connection and CPU while streaming. Try 720p30 before 1080p30 if the source and channel format permit; leave upload headroom rather than targeting the published minimum. A different encoder may be available, but check the machine and FFmpeg build before assuming hardware encoding is supported.
The stream stops after a period or does not recover cleanly
- Likely cause: FFmpeg or the host lost its connection, YouTube ended or interrupted ingest, or the process restarted but could not reconnect with the current media or credentials.
- Fix: Check
systemctl status,journalctl, and YouTube stream health. Test a full failure/recovery cycle. A supervisor reduces manual recovery work; it does not guarantee uninterrupted availability.
Audio is silent, distorted, or out of sync
- Likely cause: The source has unexpected audio streams, poor source levels, or an input timing problem.
- Fix: Inspect streams with
ffprobe, listen to the local source and YouTube preview, and adjust input mapping or encoding only after identifying the actual audio stream. Test the full loop for gaps and synchronization drift.
Copyright, reused material, and channel responsibility
FFmpeg only sends media; it does not grant rights to broadcast it. Verify rights for the particular Gurbani recording, performance, arrangement, lyrics or composition, and video assets you use. Traditional or devotional subject matter alone does not establish that a specific recording or arrangement is free to stream.
Copyright permission and YouTube’s channel monetization or reused-content decisions are separate questions. The technical setup cannot establish whether a channel or a particular broadcast meets YouTube’s current policies. Check YouTube’s current rules and the channel’s own notices before streaming; do not assume that looping a recording makes it original or policy-compliant.
Or let it run in the cloud
If maintaining an Ubuntu host, connection, service, and recovery checks is more than you want to manage, StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; it streams the uploaded file at its original quality up to 4K 60fps for one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. StreamNeo plays uploaded videos rather than going live from a camera. See StreamNeo or start the free first 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.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute

