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 DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
DocumentaryTube
FFmpeg

How to Run FFmpeg as a systemd Service for YouTube Streaming on OVHcloud

A practical guide to running FFmpeg under systemd on an OVHcloud Linux VPS, from YouTube RTMPS credentials and encoder settings to testing and troubleshooting.

By DocumentaryTube Team 8 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To keep FFmpeg streaming after you disconnect from SSH, run it under systemd on your Linux VPS, sending the video to the exact RTMPS endpoint and stream key shown in YouTube Live Control Room. systemd can supervise the process; it cannot fix a bad key, missing input, overloaded server, insufficient outbound capacity, or an unhealthy YouTube broadcast.

How the setup works

The path is: a video file or other input on your VPS → FFmpeg encodes or forwards it → YouTube receives it over RTMPS. systemd starts and supervises FFmpeg independently of your SSH session. A service showing as active only tells you about the local process; verify the stream itself in YouTube Live Control Room.

YouTube recommends RTMPS, an encrypted extension of RTMP. Its RTMPS ingestion uses port 443 and requires the hostname for TLS SNI authentication. Use the endpoint provided for your stream, not a guessed URL. YouTube’s RTMPS instructions and RTMPS ingestion documentation explain the connection requirements.

What you need before configuring systemd

  • A Linux VPS and its distribution/version. The exact package installation and service conventions depend on the OS image and installed systemd version.
  • An FFmpeg build that supports your chosen input, codecs, and RTMPS output. Check the installed build rather than assuming every distribution package has the same features.
  • A defined input: for example, a local video file. A live capture or network source needs a different input and reconnect strategy.
  • A YouTube Live event, the current RTMPS URL and stream key from its Live Control Room, and permission for the VPS to make outbound connections to the ingestion service on port 443.
  • Enough measured CPU capacity to encode the selected profile and enough outbound capacity for its bitrate, with room for variation. The available evidence does not establish a suitable OVHcloud plan, instance performance, or bandwidth allowance; check OVHcloud’s current terms and benchmark the actual VPS before relying on it.

Get the current RTMPS URL and stream key

  1. Open the relevant event in YouTube Live Control Room.
  2. In the Stream URL field, use the lock control to reveal the RTMPS URL, then copy that exact URL.
  3. Copy the stream key associated with the event. Treat it like a password: do not publish it, commit it to a repository, include it in screenshots, or place it in a configuration readable by everyone on the server.
  4. If you rotate or replace the key in YouTube Studio, update the server-side credential too. A process that continues running with an old key will not authenticate successfully.

YouTube’s instructions describe where to reveal the RTMPS URL and retrieve the key: Encrypt your stream using RTMPS.

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

Choose a YouTube-compatible FFmpeg profile

YouTube’s encoder guidance, checked 2026-10-03, lists RTMP/RTMPS; H.264, H.265/HEVC, and AV1; frame rates up to 60 fps; AAC or MP3 audio; and constant bitrate (CBR). It recommends a two-second keyframe interval and says not to exceed four seconds. For RTMP/RTMPS, 5.1 surround sound is supported only with AAC. YouTube says it detects resolution and frame rate by default; manual settings are available with a custom stream key. See the current YouTube encoder settings for the full table and any changes.

These H.264 figures are YouTube’s published minimum and recommended bitrates, not a promise that a particular VPS can encode or send them. Select the row that matches the actual output resolution and frame rate:

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.
Output H.264 minimum H.264 recommended
2160p / 4K, 60 fps 14 Mbps 50 Mbps
2160p / 4K, 30 fps 11 Mbps 42 Mbps
1440p, 60 fps 8 Mbps 34 Mbps
1440p, 30 fps 7 Mbps 21 Mbps
1080p, 60 fps 6 Mbps 17 Mbps
1080p, 30 fps 5 Mbps 14 Mbps
720p, 60 fps 3 Mbps 8 Mbps
720p, 30 fps 3 Mbps 8 Mbps
480p, 30 fps 0.4 Mbps 4 Mbps
360p, 30 fps 0.4 Mbps 4 Mbps

For AV1 and H.265/HEVC, consult YouTube’s current table for the exact resolution/frame-rate row rather than borrowing H.264 figures. The listed recommendations differ; for example, at 1080p30 YouTube lists 10 Mbps for AV1/H.265, while at 1080p60 it lists 12 Mbps. Audio guidance specifies 44.1 kHz for stereo and 48 kHz for 5.1; audio bitrate is 128 Kbps for stereo and 384 Kbps for 5.1.

FFmpeg documents this general real-time file-to-RTMP pattern: ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream. That is an illustrative RTMP example, not a complete YouTube command. RTMPS is RTMP over an encrypted connection; adapt the output using the exact YouTube endpoint and stream key, and confirm your installed FFmpeg supports the required output protocol. See FFmpeg’s protocol documentation.

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.
ffmpeg -re -i /path/to/input.mp4 
  -c:v libx264 -b:v 14M -maxrate 14M -bufsize 28M 
  -r 30 -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv 'RTMPS_URL/STREAM_KEY'

This is a template, not a universal preset: it illustrates a 1080p30 H.264 bitrate target, two-second keyframe interval at 30 fps, and stereo AAC settings. Match the bitrate, frame rate, GOP/keyframe behavior, scaling or input dimensions, audio settings, and output URL to your source and the current YouTube profile. Replace both placeholders with the exact event values; never paste a real key into a public example. If the file is not 1080p30, revise the profile rather than forcing these settings.

Create and validate the systemd service

Because systemd unit syntax and service security conventions vary by distribution and version, do not paste an unverified unit into production. Check the systemd manual installed for your VPS and your distribution’s service guidance before creating it. The unit needs, at minimum, an appropriate service user, a reliable executable path and working directory, the FFmpeg command, a deliberate restart policy, and a secure way to provide the stream key. Protect any credential file with permissions that prevent other local users from reading it. Avoid putting the key in a world-readable unit or a public repository.

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
  1. Install or select the required FFmpeg build using the package source and procedure documented for your distribution. Verify that the executable and chosen codecs/protocols are available on this host.
  2. Place the input file where the service user can read it. Check file ownership and permissions, and decide how the input should behave at end-of-file. A finite file does not loop unless you configure looping deliberately; live network inputs require their own reconnect handling.
  3. Create the unit under the location prescribed by your distribution, using the syntax and directives documented for its systemd version. Set the service user and working directory explicitly; keep credentials out of the unit text where possible.
  4. Validate the unit with the systemd tooling documented for the installed version before enabling it. Then enable/start it using the distribution’s normal service-management procedure.
  5. Inspect the service’s status and logs using the commands documented for your system. Confirm FFmpeg has opened the input and is sending output; then separately confirm YouTube receives a healthy preview.

No particular systemd unit, directive set, or restart behavior is established here. In particular, a restart policy can relaunch a process after exit but cannot make an invalid key valid, restore a missing input, or solve a persistent connection or capacity problem. Verify every directive and recovery behavior against the systemd manual for your installed version.

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

Test the stream before relying on it

YouTube’s guidance says, “Make sure to test before you start your live stream.” Send a representative test from the VPS, including typical movement and audio, and inspect the preview, stream health, and messages in Live Control Room. A speed test on your home internet is not a substitute: the relevant upload path is the outbound connection from the VPS that will run FFmpeg. Measure from that environment and leave practical headroom above the selected video bitrate.

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.
  • Confirm the selected event and current stream key are correct.
  • Confirm the exact RTMPS URL, hostname, application path, and outbound access on port 443.
  • Check the installed FFmpeg build supports the selected codecs, input, and encrypted output.
  • Verify the source has the intended duration/loop behavior, movement, and audible audio.
  • Check server load and outbound capacity while encoding the actual profile, not just while idle.
  • Wait for a healthy YouTube preview and review messages before starting a public broadcast.

Troubleshooting FFmpeg and YouTube streaming

Symptom Likely area to check What to do
Service stops as soon as SSH disconnects FFmpeg was launched in the interactive shell rather than as a systemd service, or the unit did not start successfully. Check service status and logs using the installed system’s documented commands; validate the unit and executable path.
Service is active but YouTube shows no incoming stream Local process status does not prove successful ingestion; possible causes include a wrong event/key/URL, blocked outbound connection, or FFmpeg output error. Read FFmpeg and service logs, verify the current Live Control Room values, and confirm RTMPS egress on port 443.
SSL or TLS connection error Incorrect protocol or server, an incorrect endpoint, or a connection issue. Use the exact RTMPS URL and hostname shown by YouTube. YouTube’s SSL guidance says to check protocol and server and to try port 443 if the URL appears correct; RTMPS ingestion documentation specifies port 443.
YouTube reports an unhealthy or unstable stream Encoder settings may not match the chosen profile, or the VPS’s compute/network capacity may be inadequate or variable. Match codec, resolution, frame rate, CBR bitrate, keyframes, and audio to YouTube’s current guidance. Measure the actual VPS under representative encoding load and lower the profile if needed.
FFmpeg cannot open the input or exits at end-of-file Wrong path, service-user permissions, unavailable network source, or an input that ends without loop behavior. Test the same input as the service user, correct access/path, and configure looping or source reconnection appropriate to the input.
Service repeatedly restarts but the stream never recovers Automatic process restart is repeating the same persistent failure, such as an expired key, absent source, or unreachable endpoint. Use logs to identify and fix the underlying failure before relying on restarts; confirm recovery by observing a new healthy preview in YouTube.

Or let it run in the cloud

If your goal is a continuously looping YouTube broadcast rather than managing a VPS, StreamNeo runs uploaded videos from the cloud. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Your computer and home connection do not need to stay on. It supports uploads up to 4K 60fps at one flat price per slot, automatically recovers if YouTube drops the stream, and the first day is free with no card required.

The same product is included at every billing length; only duration changes: Daily $0.99 per day · Weekly $2.99 per week · Monthly $9.99 per month · 6 months $49.99 for 6 months · Yearly $89.99 a year. Start the no-card free day at StreamNeo registration.

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

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.