DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober 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 Loop a Prerecorded Video on YouTube Live with FFmpeg on Oracle Cloud

Use FFmpeg’s infinite input loop on an OCI instance to send a prerecorded video to a YouTube Live event, with guidance on RTMPS, settings, testing, and recovery.

By DocumentaryTube Team 8 min read
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, encode or copy the media into a YouTube-compatible stream, and send it to the RTMPS address and stream key shown in YouTube Live Control Room. The instance must stay running and have enough processing capacity and upload bandwidth; Oracle’s Always Free allowance does not guarantee available capacity or suitable encoding performance.

What this setup does—and what it does not do

This is a live-ingestion workflow: FFmpeg repeatedly reads a local prerecorded file and sends it to a YouTube Live event. It does not make an ordinary uploaded YouTube video repeat automatically. You need a channel eligible to stream live and an encoder connection to a stream configured in YouTube Live Control Room. YouTube says streams under 12 hours are automatically archived; that guidance does not establish what will happen to a single uninterrupted stream lasting longer than 12 hours. YouTube Help: Create a live stream with an encoder.

The broad sequence is: verify live access, create the event, prepare an Oracle Cloud Infrastructure (OCI) instance and media file, install and configure FFmpeg, run a short test, then monitor the stream. RTMPS is YouTube’s recommended general encoder connection; use the exact endpoint shown in Live Control Room rather than guessing its URL path. YouTube Help: Choose live encoder settings, bitrates, and resolutions.

1. Check YouTube access and create the live event

  1. Enable live streaming and check restrictions. Verify the channel can stream and has no live-streaming restriction in the preceding 90 days. Complete any account verification or activation steps YouTube displays before you plan a broadcast.
  2. Create or schedule the stream. In YouTube Studio, open Live Control Room and create or schedule an encoder stream. Use the live-stream configuration shown there; do not assume the settings for an uploaded video are the same.
  3. Copy the ingest details securely. Copy the RTMPS server URL and stream key from the event’s encoder settings. Treat the key like a password: anyone who obtains it may be able to broadcast to that event. Do not put it in a public script, repository, screenshot, or article.

YouTube recommends RTMPS, its encrypted extension of RTMP. The exact server URL and key are event-specific, so substitute the values supplied in Live Control Room. YouTube Help: encoder settings.

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.

2. Prepare an Oracle Cloud instance and media file

Choose and check the instance

If you are relying on OCI Always Free compute, Oracle says eligible Always Free compute instances must be created in the tenancy’s home region. Oracle also lists 10 TB per month of outbound data transfer for Always Free resources. These allowances do not guarantee that a suitable shape is available, that your tenancy has capacity, or that a particular instance can encode your source reliably. Check the current console entitlements, capacity, tenancy limits, workload performance, and billing state before relying on the instance. Oracle Cloud Infrastructure: Always Free Resources.

For a sustained broadcast, the instance needs to read the full media file and keep up with the chosen video and audio encoding workload. Whether a CPU can do that depends on the source, encoder, resolution, frame rate, and settings; the Always Free allowance by itself says nothing about your encoding speed. Test the actual workload before depending on it.

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.

Transfer the source file and protect credentials

Place the video somewhere the instance can read, such as its local disk, and confirm the available storage is sufficient. Use a private transfer method and restrict permissions on files containing the stream key. Avoid embedding the key directly in a command that could be retained in shell history or visible to other users on the instance. A protected configuration file or a carefully managed environment variable is safer; restrict access to it and do not print it in logs.

3. Install FFmpeg and choose compatible output settings

Install FFmpeg using the package manager for the operating system on your OCI instance, or use a trusted FFmpeg build appropriate to that system. Confirm it is available with ffmpeg -version. Package names and available encoder builds vary by operating system and repository, so use that system’s current package instructions rather than assuming one installation command fits every instance.

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

Choose the output codec, resolution, frame rate, bitrate, and keyframe interval to match YouTube’s current encoder guidance and your source. YouTube’s guidance gives recommended H.264 bitrates of 10 Mbps for 1080p at 30 fps and 17 Mbps for 1080p at 60 fps. It recommends CBR and a two-second keyframe interval, not exceeding four seconds. Those figures apply to the specified H.264 resolutions and frame rates; other resolutions and codecs have different recommendations. Check the current table before selecting settings. YouTube Help: encoder settings and bitrate table.

For file input, FFmpeg’s -re option reads at the input’s native frame rate, which is useful when packet timing should resemble a live feed. Do not apply it indiscriminately to a genuine live-capture input. Put -stream_loop -1 before the relevant -i; this tells FFmpeg to loop that input indefinitely. FFmpeg documentation.

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

4. Run FFmpeg with an infinite input loop

This illustrative command re-encodes the file to H.264 and AAC, outputs FLV for the RTMP-family ingest, and sends it to an RTMPS endpoint. It is a template, not a tested configuration; the sample bitrate and GOP are not universal recommendations.

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'

Replace input.mp4 with the media file’s path and the URL with the exact RTMPS URL and key from Live Control Room. Keep the real key private. FFmpeg documents the input-loop option, real-time input rate, RTMP-family protocols, and FLV streaming output. FFmpeg documentation.

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.

Adjust the command to your source and target

  • Bitrate: The sample’s 4500 kbps video bitrate is only an example. Set bitrate and output resolution/frame rate in line with YouTube’s current table and the bandwidth your connection can sustain. The cited 1080p H.264 recommendations are 10 Mbps at 30 fps and 17 Mbps at 60 fps; do not apply them to different codecs or resolutions as if they were universal.
  • Keyframes: -g 60 means 60 frames per GOP. It corresponds to a two-second GOP only at 30 fps. At another frame rate, choose a GOP that gives the recommended two-second interval; keep the interval within YouTube’s stated maximum of four seconds.
  • Re-encode or copy: The example re-encodes video and audio. Re-encoding lets you select output settings but uses instance processing capacity. Stream copy can avoid encoding work when the source codecs and parameters are compatible with the chosen YouTube ingest settings, but it does not convert an incompatible source into a compatible one. Confirm the source format and test playback before depending on stream copy.
  • Preset and pixel format: veryfast and yuv420p are example x264 and pixel-format choices, not a guarantee that any instance can encode at the selected resolution and frame rate. Watch FFmpeg’s output for speed falling below real time or encoding errors.
  • Audio: The example encodes AAC at 128 kbps. Check that the file has the audio you intend to broadcast and verify it in YouTube’s preview; a silent source will not gain meaningful program audio by being encoded.

FFmpeg also supports FIFO output recovery options that can retry after certain temporary network failures. Treat that as optional hardening, not a guarantee of uninterrupted playback or a substitute for monitoring. FFmpeg format documentation.

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

5. Test the stream before relying on it

  1. Start the command while the YouTube event is open in Live Control Room.
  2. Wait for the incoming stream preview and check that video, motion, and audio are present and correct.
  3. Check the stream-health indicators and the instance’s outbound bandwidth. YouTube recommends leaving 20% spare bandwidth, testing the stream, previewing it in Live Control Room, and monitoring stream health. YouTube Help: encoder settings and YouTube Help: streaming tips.
  4. Confirm FFmpeg can sustain the selected encoding settings without falling behind. Make changes and test again if the preview stutters, the health status degrades, or the instance cannot keep up.

Do not treat a successful connection as proof the stream will stay healthy indefinitely. For a long broadcast, plan how you will notice a stopped process, host interruption, lost network connection, or YouTube-side disconnect, and how you will restart or reconnect.

6. Troubleshoot common failures

  • YouTube never receives the stream: Recheck that the event is open and the endpoint and key exactly match its Live Control Room settings. Ensure the instance has outbound network access. If the key has been exposed, replace it in YouTube and update the protected configuration.
  • The connection is refused or drops repeatedly: Confirm you are using the provided RTMPS endpoint and not a guessed URL. Check instance networking and available upload bandwidth. A retry feature may help with temporary failures, but does not resolve a persistent network or configuration problem.
  • Preview appears but playback stutters or stream health is poor: Check the uplink and leave the recommended bandwidth headroom. Reduce the target bitrate or output demand if the connection or instance cannot sustain the selected settings, then test again.
  • FFmpeg falls behind or reports encoding errors: Verify that the file is readable and that the chosen codec is available in the installed FFmpeg build. Check whether CPU encoding can keep up; choose a less demanding output or a suitable hardware encoder if the instance supports one, then validate the result in Live Control Room.
  • Video works but audio is absent or wrong: Inspect the source’s audio streams and check the audio codec and mapping. Confirm sound in the Live Control Room preview before relying on the event.
  • The stream stops after a host or process interruption: Restarting FFmpeg may restore the encoder connection, but a host reboot, network outage, or YouTube event state may require separate recovery. Monitor the process and event, and test your restart procedure rather than assuming automatic recovery.
  • You expect one archive from a stream longer than 12 hours: YouTube’s cited guidance promises automatic archiving for streams under 12 hours, not a single archive for a longer uninterrupted stream. Plan around that limit rather than relying on an unsupported archive outcome.

7. Check rights and channel-policy risks

Looping a file does not grant permission to broadcast its music, footage, narration, or other protected material. Use content you own or are authorized to stream, and check rights for every component, including background music. YouTube’s live-streaming access and content rules still apply to an encoder-based broadcast. A prerecorded loop also needs an editorial purpose and appropriate rights; automation does not exempt it from platform policies. Review YouTube’s current live-streaming requirements and policies before broadcasting. YouTube Help: live streaming.

Or let it run in the cloud

If you do not want to operate FFmpeg and an OCI instance, StreamNeo keeps an uploaded video or playlist live on YouTube from its cloud service: upload the recording, add your YouTube stream key, and go live. Nothing has to stay on at home, and the stream can continue with your computer off. It streams the upload as made, up to 4K 60fps, at one price per slot; it does not re-encode or use quality tiers. It also automatically recovers if YouTube drops the stream. The first day is free with no card; after that, the Monthly option is $9.99 per month. StreamNeo is for YouTube and uploaded videos, not live camera input. See StreamNeo, then start the free first day.

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

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
Crashes, No Sound, or Screen Glitches?Free driver 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.