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 DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
FFmpeg

How to Loop a Pre-Recorded Video on YouTube Live with FFmpeg on Oracle Cloud

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.

To loop a prerecorded video on YouTube Live from Oracle Cloud, run FFmpeg on a Compute instance with -stream_loop -1 before the input file, then send the encoded output to the RTMPS ingest URL and stream key shown in YouTube Live Control Room. You will need an eligible YouTube channel, a suitable Oracle Cloud instance with enough encoding capacity and outbound bandwidth, and a plan to monitor and restart the process if the host or network fails.

This is a live-ingestion workflow: the video appears as a YouTube live stream. It does not make a regular uploaded video repeat automatically.

What you need before starting

  • YouTube Live access: Enable live streaming and verify that the channel has no live-streaming restriction in the preceding 90 days. YouTube’s current eligibility and setup details are in its live streaming help.
  • An OCI Compute instance: It must be able to read your video file and encode it at the resolution and frame rate you choose. Oracle’s Always Free resources are subject to availability, account limits, and billing conditions; if you rely on Always Free compute, create the instance in your tenancy’s home region.
  • Enough sustained network capacity: The instance must upload the stream reliably, with spare capacity beyond the stream bitrate.
  • FFmpeg and a compatible media file: Confirm the file’s video and audio codecs, dimensions, frame rate, and audio track before broadcasting.
  • A protected YouTube stream key: YouTube provides the RTMPS URL and key in Live Control Room. Treat the key like a password.

Oracle documents 10 TB per month of outbound transfer for Always Free resources, but that allowance does not guarantee that a suitable instance shape is available, that it can encode your chosen settings, or that your account will incur no charges. Check current capacity, tenancy limits, workload performance, and billing in your OCI account before relying on it. See Oracle Cloud Free Tier and Always Free resources.

Configure the YouTube Live event

  1. In YouTube Studio, open Create > Go live and complete the channel’s live-stream setup if prompted.
  2. Create or schedule the live stream in Live Control Room. Choose the intended visibility and event details, and check the stream’s settings before starting.
  3. Open the encoder setup and copy the RTMPS server URL and stream key. Use the exact values YouTube displays; do not guess the URL path or paste a real key into a public script, post, or support request.
  4. Keep Live Control Room open for the preview and stream-health indicators. You will use these to confirm that FFmpeg is sending usable video and audio.

YouTube recommends RTMPS, an encrypted extension of RTMP. Its encoder guidance also covers HLS for specific workflows, including some codecs not supported over RTMP; use the ingest method YouTube provides for the selected workflow. General FFmpeg encoder setups commonly use RTMPS. YouTube’s current encoder settings and bitrate guidance should guide the output choices.

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.

Prepare Oracle Cloud and FFmpeg

Check the instance and file

Make sure the Compute instance can access the complete media file and has sufficient CPU capacity—or supported hardware encoding—for sustained encoding at your selected settings. An Always Free allowance is a billing entitlement, not a performance guarantee. Check actual CPU use and outbound bandwidth during a test rather than assuming that a particular shape will handle the workload.

Install FFmpeg using the package method appropriate for the instance’s operating system, then confirm it is available with ffmpeg -version. Put the media file somewhere readable by the account that will run FFmpeg. If the video is large, allow time to transfer it to the instance before the event begins.

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.

Choose output settings that fit the source and YouTube

There is no single bitrate that fits every stream. Match the output resolution and frame rate to the source and the viewer experience you intend, then consult YouTube’s current encoder matrix for the selected codec and format. For H.264, YouTube lists recommended video bitrates of 10 Mbps for 1080p at 30 fps and 17 Mbps for 1080p at 60 fps. The recommendations differ for other resolutions and codecs. YouTube’s listed settings include constant bitrate (CBR) and a recommended two-second keyframe interval, with an interval no longer than four seconds.

For H.264 output, FFmpeg’s -g value sets the GOP length in frames. At 30 fps, -g 60 represents a two-second GOP; at 60 fps, a two-second GOP would be 120 frames. Set the GOP to match the output frame rate rather than copying a frame count without checking it. The example below uses 4.5 Mbps as an illustrative value only; it is not a recommendation for 1080p and may not suit your chosen resolution or frame rate.

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.

Leave network headroom: YouTube recommends 20% spare bandwidth over the stream’s bitrate. For a stable result, test the actual upload path and observe Live Control Room’s stream-health feedback. A connection that barely matches the configured bitrate can cause buffering or dropped frames.

Run FFmpeg in a loop and send it to YouTube

The following is an illustrative command template, not a tested configuration. Replace the input path, RTMPS URL, and key with your own values from Live Control Room. Do not use the example bitrate or GOP unchanged unless they fit your output settings.

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
ffmpeg -re -stream_loop -1 -i input.mp4 
  -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k 
  -pix_fmt yuv420p -g 60 -c:a aac -b:a 128k -f flv 
  'rtmps://YOUR_YOUTUBE_INGEST_URL/YOUR_STREAM_KEY'
  • -re reads the file at its native frame rate so packet timing resembles a live feed. It is useful for a file input; do not indiscriminately apply it to genuine live-capture inputs.
  • -stream_loop -1 loops the input indefinitely. It must appear before the corresponding -i option.
  • -c:v libx264 encodes video as H.264. Select a codec and settings supported by the ingest method and appropriate to the source.
  • -b:v, -maxrate, and -bufsize configure video rate control in this example. Choose values from YouTube’s guidance for your resolution, frame rate, and codec.
  • -pix_fmt yuv420p sets a widely compatible pixel format. Check that the chosen encoder and source can produce the intended format.
  • -g sets GOP length in frames. Use a value that corresponds to the recommended two-second keyframe interval for your output frame rate.
  • -c:a aac -b:a 128k encodes audio as AAC at the illustrative bitrate shown. Confirm that the source has the audio you expect and check YouTube’s guidance for the selected output.
  • -f flv selects the streaming container used by this RTMP-style output workflow.

Because a stream key is a credential, avoid saving it in a world-readable script or sharing a command containing it. Restrict access to the configuration that stores it, and replace the key in YouTube if it is exposed.

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

Test before relying on the stream

  1. Start with a short test event or an appropriate test configuration in Live Control Room.
  2. Run FFmpeg and wait for the event preview to appear. Check that the intended video is moving, the audio is present and in sync, and the image is not cropped or distorted.
  3. Watch Live Control Room’s stream-health indicators and verify that the instance has at least 20% spare upload bandwidth beyond the configured stream bitrate, as YouTube recommends.
  4. Let the stream run long enough to catch CPU saturation, unstable network throughput, or a failure when the input loops back to its beginning.
  5. After correcting any issues, begin or schedule the real broadcast using the appropriate event controls in Live Control Room.

YouTube automatically archives streams under 12 hours. That statement does not establish that a single uninterrupted stream longer than 12 hours will be archived as one video; plan separately if an archive is important for a longer broadcast.

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.

Keep a long-running stream available

A loop option keeps FFmpeg reading the file again, but it does not make the full system self-healing. The process can exit, the instance can become unavailable, and the network connection to YouTube can fail. Monitor both the FFmpeg process and YouTube stream health, and decide in advance how someone or a supervisor will restart the process after an interruption.

FFmpeg documents FIFO output recovery options that can retry after certain temporary network failures. This is an optional hardening measure, not a guarantee of uninterrupted playback and not a substitute for monitoring or testing. See the FFmpeg format documentation for FIFO options and the FFmpeg command-line documentation for input and output options.

Common problems and fixes

No preview appears in Live Control Room

  • Check that the event is open for encoder input and that FFmpeg is still running.
  • Copy the RTMPS URL and stream key again from the correct event. Do not add a guessed path or reuse a key from another stream.
  • Check whether the instance can reach the ingest service and whether outbound traffic is being blocked by network rules.

YouTube reports a weak or unstable stream

  • Measure the instance’s actual upload capacity while the stream is running. YouTube recommends 20% spare bandwidth; reduce bitrate or choose a lower resolution or frame rate if you cannot maintain that margin.
  • Check CPU load and encoder performance. If encoding cannot keep up, reduce output demands or use an appropriate supported encoder.
  • Confirm the configured rate-control, codec, and keyframe interval against YouTube’s current guidance for the selected output.

The stream has no sound, wrong sound, or poor sync

  • Inspect the input’s audio streams and confirm that the chosen audio encoder is receiving the intended track.
  • Check the preview and playback on another device; a file can contain an unexpected track or audio layout even when FFmpeg starts successfully.
  • Use settings supported by the chosen output format and confirm that audio remains consistent when the file loops.

The video freezes or the process stops at the file boundary

  • Verify that -stream_loop -1 is positioned before the relevant -i input and that the file is readable throughout.
  • Review FFmpeg’s output for decode errors, unsupported streams, or a failing disk read. Test the file’s end-to-start transition before a long broadcast.
  • Do not treat FIFO retries as recovery from every failure. Check process supervision, instance state, and YouTube’s stream health separately.

Or let it run in the cloud

If you would rather not maintain FFmpeg and an OCI instance, 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. It loops uploaded videos in the cloud; it does not stream a camera feed.

  • Your computer and home internet connection do not have to stay on.
  • Any quality up to 4K 60fps streams as uploaded, at one flat price per slot with no re-encode or quality tiers.
  • StreamNeo automatically recovers if YouTube drops the stream.
  • The first day is free with no card, one free day per account.

The monthly plan is $9.99 per month. UPI and cards are available in India; card checkout is available worldwide. Each slot includes one always-on stream, 10 GB of storage per slot pooled across active slots, 24/7 looping and playlists, automatic recovery, and StreamNeo team support. All plans include the same product; only the billing length changes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.