October 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 ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
Admit one · Blog

How to Loop Pre-Recorded Videos on YouTube Live Using Linode and FFmpeg

Use FFmpeg’s -stream_loop -1 on a Linode Linux host to broadcast a prerecorded video repeatedly to YouTube Live, with setup, encoder settings, monitoring, and troubleshooting steps.
Opened Runtime8 min Written byDocumentaryTube Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To loop a prerecorded video on YouTube Live from a Linode server, configure an encoder stream in YouTube Live Control Room, then run FFmpeg with -stream_loop -1 before the video’s -i input. The loop runs until you stop FFmpeg or the connection fails; you must preview and start the live event in YouTube, and monitor it while it runs.

Before you begin

  • A verified YouTube channel with live streaming available. YouTube says channels must have no live-streaming restrictions in the previous 90 days, and its help page sets a minimum livestreaming age of 16. Check current eligibility in YouTube’s live-streaming requirements.
  • A Linode Compute Instance running Linux, or another Linux host you administer. Linode’s guide outlines creating an account and Compute Instance for a streaming server: Linode streaming-server guidance. It does not establish a specific instance size, encoding benchmark, or current price for this workload.
  • FFmpeg installed with the codecs and network protocol support needed for your selected settings.
  • A local copy of the prerecorded video, with a known path and working audio/video streams.
  • The YouTube ingest URL and stream key for the event. Keep the key private; anyone who has it may be able to broadcast to your stream.

Prepare the Linode host and video

  1. Create and secure the instance. Follow Linode’s current account and Compute Instance setup instructions. Apply the operating system’s current security updates and use a secure way to connect to the server. The appropriate instance depends on the source media, chosen output settings, and actual encoding capacity; no fixed size is established for this FFmpeg workload.
  2. Install FFmpeg. Use the package instructions for your Linux distribution and verify that the build includes the encoder and output protocol you intend to use. FFmpeg’s official documentation describes its options and formats at ffmpeg.org/ffmpeg.html.
  3. Copy the video to the instance. Confirm the file path and inspect its streams before starting. For example, use ffprobe /path/to/video.mp4 if the installed FFmpeg package includes ffprobe. Check that the file has the expected video, audio, frame rate, and resolution; a video without an audio stream may require adjusting the command rather than assuming an audio track exists.

Set up the YouTube Live event

  1. Open YouTube Studio and go to Create > Go live to enter Live Control Room.
  2. Create or select an encoder stream/event and configure its visibility and other event details as needed. YouTube documents the encoder workflow in its stream setup instructions.
  3. Copy the exact server/ingest URL and stream key shown for that stream. Use RTMPS if offered and supported by your FFmpeg build. YouTube describes RTMPS as RTMP secured with TLS/SSL in its ingest protocol guidance.
  4. Do not publish or share the stream key. Paste the actual URL and key into your local command or a protected configuration, not into a public post or shared script.

Choose settings and run the loop

This command is a template, not a tested Linode configuration. Replace every uppercase placeholder with values suited to the source, frame rate, available server capacity, and YouTube ingest details. The important loop setting is an input option: -stream_loop -1 must come before the corresponding -i. FFmpeg documents this option in its official command-line reference.

ffmpeg -re -stream_loop -1 -i /path/to/video.mp4 
  -c:v libx264 -preset veryfast -b:v VIDEO_BITRATE 
  -maxrate VIDEO_BITRATE -bufsize VIDEO_BUFFER 
  -pix_fmt yuv420p -g KEYFRAME_INTERVAL 
  -c:a aac -b:a 128k -f flv 'RTMPS_INGEST_URL/STREAM_KEY'

What to set in the template

  • -re reads the file at its native playback rate rather than sending it as fast as possible.
  • VIDEO_BITRATE and VIDEO_BUFFER are placeholders, not literal FFmpeg values. Select a compatible bitrate for the resolution and frame rate, then set the buffer in a form accepted by FFmpeg (for example, a value with a unit suffix). YouTube’s current encoder settings give its recommended configuration by video format and resolution; follow that guidance rather than assuming one bitrate fits every file.
  • -g KEYFRAME_INTERVAL sets the GOP/keyframe interval in frames. YouTube recommends a two-second interval and says not to exceed four seconds. Convert the interval to frames for your output frame rate—for example, a two-second interval at 30 fps corresponds to 60 frames. YouTube’s published guidance also specifies constant bitrate (CBR); use a configuration that actually maintains CBR rather than treating a target bitrate as a guarantee.
  • -c:v libx264 encodes H.264 video; confirm the installed FFmpeg build supports it. YouTube also documents other ingest-compatible video codecs and frame rates, but this example uses H.264.
  • -c:a aac -b:a 128k encodes audio as AAC at the example bitrate. Confirm that the source has audio and that this setting is appropriate for the content.
  • -f flv selects the streaming output container used for RTMP/RTMPS ingest. Replace the quoted output with the exact ingest URL and key format provided in Live Control Room; do not copy a placeholder as a real credential.

Match output resolution and frame rate to what the source and host can sustain. YouTube’s encoder guidance covers supported settings, including frame rates up to 60 fps, H.264/H.265/HEVC/AV1 video options, AAC or MP3 audio, and CBR. A Linode instance may not encode every resolution in real time; confirm the machine can keep up before relying on a long broadcast.

Preview, start, and monitor the broadcast

  1. Run the completed FFmpeg command in a terminal session that will remain active, or manage it with an appropriate persistent service/session method. Keep the logs available so connection or encoder errors can be diagnosed.
  2. Wait for YouTube Live Control Room to receive the encoder feed, then check the preview for picture, sound, correct framing, and playback motion before starting the event.
  3. Start the event in Live Control Room. Monitor YouTube’s stream health and the FFmpeg output, particularly after startup and after any network interruption. YouTube’s stream health guidance explains the status indicators.
  4. Check the Linode host’s outbound throughput. YouTube recommends approximately 20% upload bandwidth headroom above the total stream bitrate; the server’s actual network path must sustain that margin rather than only matching the nominal encoder bitrate. See YouTube’s recommended encoder settings.

Stop the stream and plan for archiving

End the broadcast in Live Control Room and stop the FFmpeg process on the server. YouTube’s help page says streams under 12 hours are automatically archived; that statement does not establish automatic archiving for an indefinitely long broadcast. For longer runs, plan separate sessions or verify the archive behavior for the specific event in YouTube’s current encoder streaming guidance.

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.

Linode versus a computer you already control

Consideration Linode Compute Instance Your own computer
Availability Runs remotely, so your home computer need not stay on; availability still depends on the instance and its network. Requires the computer, FFmpeg process, and local network to remain available.
Media access The file must be transferred to and kept available on the instance. The file can remain on local storage, provided the machine can read it throughout playback.
Encoding capacity Depends on the selected instance and workload; no specific size or performance is established here. Depends on the computer’s encoding capability and whether it can sustain the chosen settings.
Network Depends on the instance’s outbound connectivity and available throughput. Depends on the local connection and its sustained upload capacity.
Administration and cost Requires remote-host setup and maintenance; current workload-specific price is not stated. Uses equipment and service you already control, but requires local power, connectivity, and administration.

Neither option is universally cheaper or better. Compare current hosting costs and the reliability and encoding capacity you actually need; the Linode guide does not provide a workload-specific benchmark or price comparison.

Troubleshooting common failures

  • YouTube does not receive a signal: check that the RTMPS URL and stream key match the active encoder stream, that the key has not been revoked or mistyped, and that FFmpeg supports the required protocol. Review the FFmpeg error output and YouTube’s stream-health status.
  • The stream connects but video is black or incorrect: inspect the input with ffprobe, verify the path and video stream, and confirm the command is encoding the intended file. Check the preview before going live.
  • There is no sound: verify that the file contains an audio stream. If it does not, remove or change the audio mapping/encoding assumptions rather than expecting AAC encoding to create source audio. If sound exists but is silent or distorted, inspect the selected audio stream and test a representative segment.
  • FFmpeg cannot keep up or the stream stutters: reduce output resolution, frame rate, or encoding load; test a faster preset if using software encoding; and check the instance’s actual CPU and network capacity. Preserve YouTube’s recommended keyframe interval and network headroom where possible.
  • Connection drops interrupt the broadcast: inspect host connectivity and FFmpeg logs, then reconnect using the same active event credentials if YouTube still accepts them. A single FFmpeg command does not itself guarantee automatic recovery after a disconnect.
  • The video does not loop: confirm -stream_loop -1 appears before the input’s -i and that the process has not exited because of a file, codec, or output error.

Copyright and channel-policy checks

Having a video file does not by itself establish the right to broadcast it. Before streaming, confirm that you have permission for the footage, music, narration, and any other included material, including rights for live use. YouTube’s copyright and channel rules apply to live streams as well as uploads; review the current live-streaming requirements and YouTube policy pages for your content and channel status. Repeating a prerecorded video also does not guarantee eligibility for monetization: YouTube evaluates channels under its monetization policies, including reused-content rules, independently of the streaming setup.

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.
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 you want a YouTube channel to keep prerecorded videos live without maintaining a Linode instance or leaving FFmpeg running yourself, StreamNeo is a cloud service for looping uploaded videos and playlists to YouTube Live.

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
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. Upload a recording or build a playlist.
  2. Add your YouTube stream key once.
  3. Go live; StreamNeo loops the media from the cloud.
  • Nothing at home has to stay on; the stream runs in the cloud.
  • Uploaded media streams as made, up to 4K 60fps, at one price per slot without quality tiers.
  • Automatic recovery is included if YouTube drops the stream.
  • The first day is free with no card; it is 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.

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 Migrate a 24/7 YouTube Stream to a New VPSAdmit one · BlogHow to Migrate a 24/7 YouTube Stream to a New VPSOpened04 OCT 2026Runtime6 min
  2. How to Run a YouTube Playlist on a Headless Linux Server—and Broadcast It LiveAdmit one · BlogHow to Run a YouTube Playlist on a Headless Linux Server-and Broadcast It LiveOpened04 OCT 2026Runtime6 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
Windows Errors? Fix Them Before They SpreadFree repair scan
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.