Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk7 min

How to Loop Pre-Recorded Videos on YouTube Live Using FFmpeg on a DigitalOcean Droplet

Use FFmpeg’s real-time input and infinite loop options to stream a prerecorded video from a DigitalOcean Droplet to a YouTube Live event.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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 DigitalOcean Droplet, create a YouTube live event, then run FFmpeg on the Droplet with -re to pace playback in real time and -stream_loop -1 to repeat the input indefinitely. Send the output to the event’s current YouTube RTMPS address and stream key. The command can keep sending a loop, but it does not itself start a scheduled YouTube event, recover every failure, or guarantee an indefinite YouTube archive.

What you need before you start

  • A YouTube channel with access to live streaming, and a live event created or scheduled in YouTube Studio.
  • A Linux DigitalOcean Droplet with FFmpeg installed and enough CPU capacity for the chosen encoding settings.
  • A prerecorded video available on the Droplet, with audio and video you are entitled to stream.
  • The event-specific YouTube ingestion address and stream key. Treat the key like a password: anyone who has it may be able to send video to that event.

A Droplet is the Linux virtual machine that runs FFmpeg; it is not a special YouTube relay server. DigitalOcean also offers a separate SRS Marketplace image with streaming-server and FFmpeg features, but that additional stack is not required for direct file-to-YouTube streaming. See DigitalOcean Droplets and the SRS Marketplace listing; the listing’s software details should not be assumed current without checking.

As an Amazon Associate I earn from qualifying purchases.

Create the YouTube Live event and get its connection details

  1. In YouTube Studio, select Create → Go Live.
  2. Choose the Stream tab for a new event, or use Manage to schedule one.
  3. Copy the server URL and stream key shown for that event. Do not use a sample key or assume an address copied from another event is still valid.
  4. Keep the event open in Live Control Room. After FFmpeg connects, check its preview and stream health. For a scheduled event, YouTube may require you to select Go live in Live Control Room; an encoder connection alone does not necessarily start the public event.

YouTube recommends RTMPS. Use the exact current URL YouTube provides, including its hostname and path, and use the matching event key. YouTube’s live streaming setup instructions describe creating streams and connecting an encoder; its ingestion protocol guide specifies RTMPS requirements, including port 443 and the correct hostname for TLS SNI.

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

Check the video and choose output settings

Before a long broadcast, test the input and output with a short private or unlisted event. YouTube recommends a test that includes movement and audio representative of the real stream. Confirm the resolution, frame rate, bitrate, codecs, and keyframe interval against its current encoder settings.

#1 Best Overall
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS | Capture Card for Streaming, Compatible with iPad Mac OS Windows, Quest 3, OBS, PS5/4, Switch2/1, Xbox, Camera (Silver)
  • 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
  • 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
  • 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
  • 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
  • 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0
  • Video codec: YouTube lists H.264, H.265/HEVC, and AV1 among supported codecs. The example below re-encodes to H.264 for a broadly controllable starting point.
  • Frame rate: YouTube’s guide lists support up to 60 fps. Match the source and the bitrate guidance for the chosen resolution and frame rate.
  • Bitrate: Use the value recommended by YouTube for your selected resolution and frame rate. Do not copy a bitrate without checking that table; the Droplet must also have sufficient CPU and outbound network capacity.
  • Rate control: YouTube recommends constant bitrate (CBR).
  • Keyframes: YouTube recommends a two-second keyframe interval and says not to exceed four seconds. For a two-second GOP, set the GOP frame count to twice the frame rate—for example, 60 frames at 30 fps.
  • Audio: AAC or MP3 is supported for RTMP/RTMPS. The command uses AAC at 128 kb/s.

These are YouTube’s ingest recommendations, not a promise that a particular Droplet size can encode a particular workload. No minimum Droplet size is established here; test the chosen resolution, frame rate, and encoding load on your actual server.

Run FFmpeg in a real-time infinite loop

Install FFmpeg using a method appropriate to the Droplet’s Linux distribution, and verify the installed build supports the codecs and RTMPS protocol you plan to use. DigitalOcean’s tutorial documents the loop option -stream_loop -1; FFmpeg’s own documentation explains its protocol support and options. The loop option belongs before the input it applies to.

Rank #2
Audio Express AXHDCAP 4K HDMI Video Capture Card, Cam Link Card Game Audio Adapter HDMI to USB 2.0 Record Capture Device for Streaming, Live Broadcasting, Video Conference, Teaching, Gaming
  • [Enhanced 4K-1080P Video Capture Experience] Capture the Magic: Elevate your video recordings to new heights with our upgraded anti-static 1080P Video Capture Card. Immerse yourself in stunning visuals, supporting HDMI input at 4K 60FPS and USB output for capturing in 1080P, complete with rich stereo sound. Enjoy crystal-clear video recordings, dynamic gaming live streams, and professional conference broadcasts. Note: HDMI resolution: Max input can be 3840×2160@30Hz / Video output resolution: Max output can be 1920×1080@30Hz
  • [Seamless Real-Time Preview] Stay in the Moment: Our advanced ultra-low latency technology ensures seamless real-time transmission of video streams. Experience instant, lag-free previews, allowing you to capture every detail precisely. Effortlessly record video directly to your hard disk, all without compromising on quality or introducing any delays.
  • [Versatility and Broad Compatibility] Your Creative Hub: Connect your DSLR, camcorder, or action camera to a wide range of operating systems, including Windows, MacOS, and Linux. Unlock a world of possibilities with real-time streaming to popular platforms like Twitch, Youtube, OBS, Zoom, Potplayer, and VLC, giving you the tools to share your content effortlessly.
  • [Effortless Plug and Play] Simplicity Redefined: Say goodbye to complex installations. Our plug-and-play design eliminates the need for drivers or external power supplies. Seamlessly integrate high-definition acquisition into various scenarios, whether it's educational recordings, immersive gaming, precise medical imaging, captivating live streams, or professional broadcasting.
  • [Seize Every Detail with Precision] Unleash your creativity and attention to detail with our video capture card. Capture every nuance, every color, and every moment with precision, thanks to the enhanced capabilities of our technology. Whether you're a content creator, a gamer, or a professional, our capture card empowers you to seize the finest elements and bring them to life in your recordings and live streams.
ffmpeg -re -stream_loop -1 -i "/path/to/video.mp4" \
  -c:v libx264 -preset veryfast -b:v VIDEO_BITRATE -maxrate VIDEO_BITRATE -bufsize BUFFER_SIZE \
  -g GOP_FRAMES -c:a aac -b:a 128k \
  -f flv "rtmps://YOUTUBE_INGEST_HOST/YOUTUBE_PATH/STREAM_KEY"

This is a command template, not a tested command. Replace every uppercase placeholder with the values for your event: set VIDEO_BITRATE and BUFFER_SIZE according to the selected YouTube settings, GOP_FRAMES to the two-second interval for your frame rate, and the RTMPS URL and key to the current values from Live Control Room. Keep the key private, including in shell history and logs. The -re option reads the file at its native rate rather than sending it as fast as storage permits; -stream_loop -1 repeats the input without a fixed loop count.

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

Re-encoding with libx264 and AAC gives you control over output settings but consumes Droplet CPU. If the source already uses compatible codecs and timestamps, stream-copying may reduce encoding work, but it can be less predictable across source files and ingest conditions. Test that approach rather than relying on it for a long broadcast.

Rank #3
Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P60FPS HDMI Capture Card for Streaming, Gaming, Video Recording Compatible with Switch, Xbox, PS4/5, OBS,iPad Mac OS Windows,Camera, Zoom(Silver)
  • 【4K HDMI Input, 2K@30Hz Recording】Powered by a true USB 3.0 high-speed interface, the capture card supports up to 4K@30Hz HDMI input and records at 2K@30Hz or 1080P@60Hz. Perfect for gamers, streamers, and professionals who need crisp, smooth video for live streaming, gameplay recording, or online meetings.
  • 【Ultra Low Latency Screen Sharing】Built with a premium aluminum alloy shell and advanced chipset for stable heat dissipation, ensuring ultra-low latency transmission. Capture high-quality video and dual-channel audio in real time—no lag, no frame drop—ideal for Twitch, YouTube, or OBS streaming.
  • 【Easy Plug and Play, Compact & Portable】No driver or external power required—just plug and play via USB 3.0 or Type-C connection to your Windows or macOS computer. Lightweight and compact design makes it easy to carry for outdoor streaming, live shows, or mobile recording setups.
  • 【Wide Compatibility & Multi-Device Support】Compatible with Windows 7 8 10 11, macOS, Linux,Android and supports most popular software such as OBS, Zoom, VLC, Twitch Studio, and more. Works seamlessly with PS4, PS5, Xbox, Switch, DSLR cameras, TV boxes, and other HDMI-output devices for streaming to YouTube, Twitch, etc.
  • 【What You Get】Includes: HDMI Capture Card, USB 3.0 to USB-C Adapter, User Manual. Tips: Make sure your tablet’s OTG function is enabled before connecting. Test your HDMI device with a monitor first to confirm video and audio output, then connect to the Video Capture Card for recording.

See the DigitalOcean FFmpeg looping tutorial for the documented loop pattern, and the FFmpeg protocol documentation for RTMPS terminology. YouTube’s ingestion guide takes precedence if an older example conflicts with the current event details.

Start the stream and monitor it

  1. Run the command in a terminal on the Droplet. Watch FFmpeg output for connection failures, timestamp errors, encoder overload, or a nonzero exit.
  2. In YouTube Live Control Room, wait for the preview and check stream health and encoder warnings.
  3. If the event is scheduled and the interface prompts you, select Go live to start the event.
  4. Observe the video and audio at the file boundary. Repeating a file does not remove a hard cut, fix a silent gap, or create a seamless audio transition.
  5. Keep monitoring the Droplet and Live Control Room. A running FFmpeg process is not proof that YouTube is receiving a healthy stream.

YouTube says streams under 12 hours are automatically archived. That statement does not establish an unlimited event duration or guarantee an archive for a longer broadcast. For a planned run beyond that window, check YouTube’s current behavior and design a session restart strategy rather than assuming one event will continue and archive indefinitely.

Rank #4
Sale
Capture Card, 4K HDMI Video Capture Card, Game Capture Card, 1080P 60FPS Video Capture Device, HDMI to USB 3.0 Capture Card for Streaming, Work with Camera/Xbox/PS4/PS5/PC/OBS
  • 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
  • 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
  • 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
  • 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
  • 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

Symptom Likely cause What to check or do
FFmpeg cannot connect Wrong or stale ingestion URL/key, incorrect RTMPS path, or network/TLS issue. Copy the current event URL and key again from Live Control Room; confirm the RTMPS hostname and path are intact and outbound port 443 is available.
FFmpeg connects, but no public live event appears The event may be scheduled and awaiting a manual start. Check the preview and event status in Live Control Room, then select Go live if the interface requires it.
Stream health reports warnings or video stutters Bitrate, frame rate, or resolution may not match YouTube guidance; the encoder may be overloaded; or the Droplet’s network path may be inadequate. Compare the output to YouTube’s current settings table, inspect FFmpeg logs and CPU load, and run a representative test at the intended settings.
Audio or video fails to play correctly The source codec, timestamps, or stream settings may be incompatible or malformed. Inspect the source and test a short event; when compatibility is uncertain, use a controlled H.264/AAC re-encode and verify preview and sound.
The process stops or the stream drops FFmpeg exited, the Droplet or network interrupted, or YouTube ended/dropped the ingest. Check the process exit status, server and network logs, and Live Control Room. Restarting FFmpeg may require reconnecting to the event; do not assume the command automatically recovers every interruption.
The loop has an audible or visible jump The source file’s start and end do not form a seamless transition. Edit or choose a file with a more suitable boundary, then test the transition. -stream_loop repeats content; it does not crossfade it.

Or let it run in the cloud

If you want prerecorded YouTube video running without maintaining a Droplet and FFmpeg process, StreamNeo is a cloud service: upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded video from the cloud; it does not broadcast from a camera. Your computer and home connection do not need to stay on.

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.
  • One flat price per slot for any uploaded quality up to 4K 60fps, with no re-encode or quality tiers.
  • Automatic recovery if YouTube drops the stream.
  • The first day is free with no card required (one free day per account).
  • Each slot includes one always-on stream, 10 GB storage per slot pooled across active slots, looping and playlists, and support from the StreamNeo team. The product is the same on every plan; only the billing period changes.

Monthly: $9.99 per month. Visit StreamNeo or start the free first day.

Best Value
Capture Card, USB Video Capture Card Device, Audio Video Converter Grabber for RCA to USB-Convert VHS Mini DV VCR Hi8 DVD to Digital, for PC TV Tape Player Camcorder, MAC Windows Vista Compatible
  • AV TO USB Converter: Capture videos and audios from VHS, VCR, Hi8, DV tapes to a PC, with the help of our USB Video Converter. Save room while digitizing your favorite old memories
  • Quality Capture Card: Our USB Video Capture Card converting anolog RCA composite input into HD 720P USB output and capturing audio without any sound card. Advanced signal processing technology provides you with great precision, colors, resolutions, and details.
  • Plug and Play: Automatically install the driver once you hook up this RCA to USB Converter to a PC. No external power is needed. User-friendly and easy to operate
  • Wide Compatibility: The Video Capture Card can work with video devices with RCA connector or S-Video connector, such as VHS, VCR, Hi8, camcorder, compatible with Windows and Mac OS. Support video formats like NTSC, PAL, and support brightness, contrast, hue, and saturation control
  • Note: The Video Converter is used with acquisition software. We recommend OBS Studio or PotPlayer for Windows, and QuickTime Player for Mac. They can be downloaded for free online. Please operate according to the steps in User Manual or contact us if you have any questions

Copyright and YouTube policy still apply

Looping a file does not grant permission to broadcast it. Use video and audio you own or have permission to stream, and review YouTube’s copyright and monetization policies before running a repetitive or extended broadcast. A stream that is technically valid can still receive a claim, restriction, or other platform action based on its content or rights. Check YouTube’s current rules for your channel and content rather than treating an FFmpeg command as policy approval.

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 Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
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.