October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Concat Demuxer

How to Use an FFmpeg Concat File for a Nonstop YouTube Stream on Hetzner

Use FFmpeg’s concat demuxer and -stream_loop -1 to play compatible prerecorded videos continuously to YouTube Live, with practical guidance for bandwidth, stream keys, monitoring, and recovery on Hetzner.

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

To loop a sequence of prerecorded videos to YouTube Live from a Hetzner server, put their paths in an FFmpeg concat playlist and pass -stream_loop -1 before that playlist’s -i option. The example below uses stream copy, so it works only when the files have compatible streams, codecs, and time bases. You also need the event’s current YouTube ingest URL and stream key, enough sustained outbound bandwidth, and a way to restart FFmpeg if it exits.

How do I loop an FFmpeg concat playlist forever?

Create a plain-text playlist file such as playlist.ffconcat. Put the format marker on the first line, exactly as shown, followed by one file directive per video in playback order:

ffconcat version 1.0
file 'clip-01.mp4'
file 'clip-02.mp4'
file 'clip-03.mp4'

Save the playlist alongside the videos, or use paths that resolve correctly from the directory where FFmpeg will run. The concat demuxer is line-oriented. Paths containing spaces or special characters need correct quoting or escaping; test the playlist with the exact paths and working directory you will use in production. The ffconcat version 1.0 marker must be the first line for automatic format recognition. This command explicitly selects the concat demuxer with -f concat. See the FFmpeg concat demuxer documentation.

Use this command shape

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.ffconcat 
  -c copy -f flv 'rtmps://<youtube-ingest-endpoint>/<stream-key>'

This is a command pattern, not a tested recipe. Replace the placeholder output with the exact RTMPS server URL and stream key shown for your YouTube Live event. Keep -stream_loop -1 among the input options before the -i playlist.ffconcat it applies to: FFmpeg options are order-sensitive. A value of -1 means loop indefinitely. The -re input option reads media at its native rate rather than sending it as fast as possible. The -c copy option copies encoded streams without re-encoding; it does not make incompatible files compatible.

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.

The example uses -safe 0 so the concat demuxer accepts paths that its default safety rules might reject. Use it only when you trust the playlist and every referenced path. If you can use paths accepted by the default rules, omit -safe 0. Check the installed FFmpeg build and output compatibility, then test privately or with an unlisted event before relying on it for a public stream. FFmpeg’s documentation describes its options and command-line behavior.

Will stream copy work with my videos?

Only if the files are compatible for concatenation. FFmpeg’s concat demuxer requires the files to have the same streams, codecs, and time bases. As the FFmpeg project puts it, “All files must have the same streams (same codecs, same time base, etc.).” Stream copy saves encoding work, but it cannot reconcile differing formats or stream layouts.

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.

Check these properties before going live

  • Use the same stream layout across files—for example, do not assume a playlist containing a video-only clip and clips with audio will join cleanly.
  • Check that codecs and time bases match across the playlist. Normalize files in advance if they differ.
  • Check duration metadata. The demuxer adjusts timestamps globally so each file begins where the preceding one ends; if stream durations do not align, gaps can result. Incorrect duration metadata can cause artifacts. A duration directive can override a file’s stored duration when needed.
  • Test transitions between every pair of files, not only playback of each file by itself. A playlist that plays individually may still have timestamp or stream-layout problems at joins.

If the files are not compatible, prepare normalized copies before streaming or use an appropriate re-encoding and filtering workflow. That takes additional preparation and, if encoding during the live run, CPU capacity. Do not expect -c copy to smooth out mismatched media.

How do I stream prerecorded videos continuously to YouTube Live?

  1. Create or select the event. In YouTube Studio, open the Live Control Room and create or select the live event. Obtain that event’s stream URL and stream key. YouTube’s live stream settings guide explains the settings, while its RTMPS guide covers the encrypted connection.
  2. Protect the stream key. Treat it like a password. Do not publish it, commit it to a public repository, or leave it in logs or an openly accessible configuration file. YouTube recommends RTMPS to encrypt the connection from your encoder to YouTube.
  3. Choose encoder settings for the actual output. YouTube’s current encoder guidance lists RTMP/RTMPS, 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, not exceeding four seconds. Its bitrate recommendations vary by codec, resolution, and frame rate. Use the row for your intended combination rather than treating one bitrate as universal.
  4. Match the media and output configuration. With -c copy, FFmpeg sends the source streams as they are. Confirm those streams suit the selected YouTube settings; a copy command cannot change codec, frame rate, resolution, bitrate, or keyframe interval. If they do not match, prepare suitable normalized files or use a conversion workflow.
  5. Preview and monitor the event. Start FFmpeg before relying on the public event. Inspect YouTube’s preview, confirm representative audio and motion, and watch for stream-health alerts during transmission. Resolve warnings before treating the feed as stable.

YouTube says streams under 12 hours are automatically archived; do not assume an uninterrupted archive for longer broadcasts. If an archive matters, plan the event duration and archive needs accordingly. See YouTube’s encoder live-stream guide.

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.

Can I run FFmpeg nonstop on a Hetzner server?

Potentially, but a Hetzner server is not automatically suitable just because FFmpeg can read the files. Suitability depends on your chosen location and plan, media workload, stream bitrate, sustained outbound capacity, and operating costs. Verify current Hetzner specifications and policies for the server you intend to use; no particular Hetzner plan or regional availability is established here.

Plan bandwidth and process recovery

  • Measure outbound capacity. YouTube recommends 20% upload-bandwidth headroom over the stream bitrate. Check actual sustained outbound capacity from your chosen host and allow for other traffic. YouTube notes, “The total bitrate you’re streaming cannot exceed the amount of upload bandwidth available.”
  • Account for the media workload. Stream copy usually avoids video re-encoding work, but the host still needs to read the media reliably and sustain the outgoing stream. If you normalize or re-encode during transmission, include the added CPU workload in your sizing and test.
  • Supervise FFmpeg. A single process stops when it exits. Use an appropriate process supervisor or service manager so a failure can trigger a restart, and alert on FFmpeg exit, encoder disconnects, low disk space, and YouTube stream-health warnings. A restart can restore the encoder connection, but monitor YouTube as well to confirm the event is receiving the feed again.
  • Test the complete failure path. Confirm you can identify a stopped process, restart it, and check that the correct event and stream key are still in use. Keep secrets out of public scripts and routine logs.

Troubleshooting common interruptions

Symptom Likely cause What to check or do
FFmpeg rejects a file or fails at a playlist boundary Incompatible streams, codecs, time bases, path syntax, or duration metadata Check every source file and path; compare stream layouts and timing. Correct quoting or escaping, adjust duration metadata where appropriate, or normalize the files before using stream copy.
The stream stops after one pass The loop option is missing, has a different value, or applies to the wrong input Place -stream_loop -1 before the concat input’s -i option. Verify the command line FFmpeg actually receives.
YouTube does not receive the encoder feed Wrong event URL or key, a key exposure or rotation, connection trouble, or unsupported output Check the exact URL and key in the Live Control Room, keep the key private, use the event’s current RTMPS endpoint, and inspect FFmpeg output and YouTube’s preview and stream-health alerts.
Health warnings or dropped frames appear Insufficient or variable outbound capacity, or output settings that do not fit the stream Compare actual bitrate and sustained host upload capacity; YouTube recommends 20% headroom. Check the relevant codec, resolution, and frame-rate row in YouTube’s current encoder guidance.
FFmpeg exits and the channel goes offline The process ended without a restart mechanism Inspect the exit reason and logs, fix the underlying fault, and run FFmpeg under a supervisor configured to restart it. Alert on exits and verify the YouTube feed after recovery.
The live event has no complete archive The stream lasted longer than YouTube’s stated automatic-archive window Plan around YouTube’s automatic archiving for streams under 12 hours; do not assume a longer broadcast will be archived uninterrupted.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If maintaining a Hetzner host, a compatible playlist, and process recovery is more work than you want, 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; your computer can stay off. It does not stream from a camera.

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.
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
  • Nothing has to stay on at home: playback runs in the cloud.
  • Each slot streams your uploaded quality up to 4K 60 fps at one flat price, with no re-encode or quality tiers.
  • StreamNeo automatically recovers if YouTube drops the stream.
  • The first day is free with no card required (one free day per account).
  • Monthly: $9.99 per month.

Start your free StreamNeo 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.

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.