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
VGSources
Contabo VPS

How to Loop Pre-Recorded Videos on a Contabo VPS with FFmpeg

A practical guide to looping and publishing a pre-recorded video from a Contabo VPS with FFmpeg, including RTMP setup, firewall direction, persistent processes, and common fixes.

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

To loop a local video forever and publish it from a Contabo VPS, run FFmpeg with -stream_loop -1 before the file’s -i option, and use -re so FFmpeg reads the file at its native frame rate. You also need a valid RTMP or RTMPS publishing address from the service receiving the stream; a Contabo VPS running FFmpeg is not, by itself, an RTMP server.

What you need before starting

  • A Contabo VPS with FFmpeg available in its operating system.
  • A video file on the VPS, at a path you can supply to FFmpeg.
  • A publishing endpoint and stream key from the service that will receive the stream, or a separately configured RTMP server you operate.
  • Credentials and permission to stream the media. A technically successful stream does not grant rights to music, footage, or other content in the video.

The command below is a template based on FFmpeg’s documented options, not a tested command. The required URL format, accepted codecs, and stream-key placement depend on the receiving service.

Publish a looping video to an RTMP endpoint

  1. Place the video on the VPS. Note its full path, for example /path/to/video.mp4. Replace that example with your actual file path.
  2. Get the destination URL. Copy the publishing address and key from your receiving service. An RTMP URL generally identifies a server and may contain an application and a stream or playpath. Use the exact URL format the destination provides; do not assume every service expects the key in the same position.
  3. Run FFmpeg with the loop option before the input.
    ffmpeg -re -stream_loop -1 -i /path/to/video.mp4 
      -c:v libx264 -c:a aac -f flv 
      'rtmp://RTMP_SERVER/APP/STREAM_KEY'

    Replace the file path and quoted publishing URL. Keep -stream_loop -1 before the corresponding -i; -1 requests infinite looping. The -re input option reads the file at its native frame rate, which is appropriate when publishing a file in real time rather than sending it as quickly as the VPS can process it.

  4. Check the FFmpeg output and destination. Look for connection or encoding errors in the terminal, then check the receiving service’s live preview or status. A successful connection does not guarantee that the destination accepts the selected codecs or that the video is being presented as intended.

Choose between transcoding and stream copy

Use the example’s encoding when conversion is needed

The template encodes video as H.264 using libx264, encodes audio as AAC, and packages the output as FLV. This is an example configuration, not a guarantee that every destination accepts it. Encoding requires the VPS to decode and re-encode the media; the available processing capacity and resulting performance depend on the VPS, source file, and encoding settings. No benchmark for a particular Contabo plan is established here.

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.

Consider stream copy only when the formats are compatible

If the source streams already match what the destination accepts, replacing the video and audio encoders with -c copy can avoid decoding and re-encoding. Compatibility depends on the source codecs, container, and destination requirements. Since no particular file or endpoint is specified, stream copy cannot be assumed to work; if it fails or the destination rejects the stream, use compatible encoding settings instead.

Make the process survive an SSH disconnect

A command running in an ordinary interactive SSH session may stop when that session ends. If the stream must keep running after you disconnect, run FFmpeg under a persistent process manager or service configured for your VPS operating system. The correct installation steps, manager, and restart policy depend on the distribution and setup, which are not specified here.

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.

Decide what should happen after a VPS reboot or an FFmpeg failure. A persistent process manager can keep a process detached from the SSH session; a service with an appropriate restart policy can also be configured to start or restart it. Verify the behavior on your own VPS rather than assuming that simply closing the terminal or rebooting will preserve the stream.

Understand the Contabo firewall and RTMP ports

The required firewall configuration depends on which direction the stream travels. Contabo’s firewall documentation says, “All inbound traffic is blocked from the moment a firewall is activated; the customer decides what is allowed in.” The network-level firewall applies rules to assigned instances, supports TCP, UDP, and ICMP rules, and leaves outbound traffic unrestricted.

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.

If FFmpeg publishes outward to another service

For a VPS that only initiates an outbound publishing connection, you generally do not need to open an inbound RTMP port in the Contabo firewall. The receiving service must be reachable, and the VPS’s own operating-system firewall or network setup must not block the outbound connection.

If the VPS receives RTMP connections

If you want clients or another encoder to connect to an RTMP server hosted on the VPS, you must configure and run that server separately. Allow its actual listening port and protocol in the Contabo firewall and check the guest operating system’s firewall as well. Do not open an inbound port merely because FFmpeg is publishing to a server elsewhere.

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

RTMP or RTMPS?

Use the transport supported by your destination. RTMPS is RTMP over a secure SSL connection. The example uses an rtmp:// address only to illustrate the command structure; if the destination gives you an rtmps:// address, follow its instructions and confirm that your FFmpeg build and destination support it.

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

Troubleshooting common failures

  • FFmpeg exits or says it cannot open the input: confirm the file exists at the path provided, that the FFmpeg process can read it, and that the input option refers to the intended file.
  • The stream plays once and stops: make sure -stream_loop -1 appears before the matching -i. The option applies to an input, so its position matters.
  • The stream runs too fast or is not paced like playback: use -re as an input option when publishing the file at its native frame rate.
  • FFmpeg cannot connect: check the server address, application and key format against the receiving service’s instructions, along with network reachability and credentials. Do not substitute a guessed endpoint.
  • The connection works but the receiver rejects or cannot play the stream: verify its accepted container and audio/video codecs. The sample uses H.264, AAC, and FLV; compatibility is destination-specific. Try stream copy only if the source and destination formats are known to match.
  • It stops after you close SSH: start it under a persistent process manager or service suitable for your VPS operating system, then verify that the process remains active after disconnecting.
  • Inbound clients cannot reach an RTMP server on the VPS: verify that the RTMP server is actually configured and listening, then check both the Contabo network firewall and the guest operating system’s firewall for the correct inbound rule.

Keep the stream running without managing a VPS process

If your goal is to keep a pre-recorded YouTube channel live rather than manage FFmpeg on a server, 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. Each slot supports one always-on stream, looping and playlists, and automatic recovery if YouTube drops the stream. Videos stream as uploaded, up to 4K 60fps, at one flat price per slot; there are no quality tiers. The first day is free with no card, one free day per account. The monthly option is $9.99 per month. StreamNeo is for YouTube and uploaded videos, not camera-based streaming.

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.

Start your free StreamNeo day.

Frequently Asked Questions

Does FFmpeg’s online documentation necessarily match the FFmpeg version installed on my VPS?

No. FFmpeg says its online command-line documentation is regenerated nightly for the newest revision; an installed package may be a different version.

Can I use the same stream key in FFmpeg and StreamNeo?

A YouTube stream key is supplied by YouTube, but configure each service using the connection instructions it provides. StreamNeo uses the YouTube key you add to your account.

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 Patch Notes

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.