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

To loop a video on YouTube Live from a DigitalOcean Droplet, create a YouTube live event, copy its current ingest URL and stream key, then run FFmpeg with -re and -stream_loop -1 before the input file. FFmpeg sends the file repeatedly at real-time speed; YouTube still controls whether and when the event goes live, and looping does not guarantee an indefinitely running event or archive.

What you need before you start

  • A YouTube channel with access to YouTube Live and a live event created or scheduled in YouTube Studio.
  • A Linux DigitalOcean Droplet with FFmpeg installed, enough CPU for the chosen encoding settings, and a stable network connection.
  • A video file available on the Droplet, with audio if needed. Test the file and intended output settings before relying on a long broadcast.
  • The current server URL and stream key shown for that specific YouTube event. Keep the key private: someone who obtains it may be able to send video to your event.

A Droplet is the Linux virtual machine that runs FFmpeg. For direct file-to-YouTube streaming, you do not need a separate streaming server. DigitalOcean also offers an SRS Marketplace image with streaming-server and FFmpeg features, but that is an optional, different setup: DigitalOcean SRS Marketplace image.

Create the YouTube Live event and get its ingest details

  1. In YouTube Studio, select Create → Go Live.
  2. Choose the Stream tab to set up a new event, or use Manage to schedule one.
  3. Copy the server URL and stream key for the event. Use the current values YouTube displays; do not assume a sample or previously used endpoint is correct.
  4. Keep the key private. Do not paste it into a public command log, screenshot, or script repository.

YouTube recommends RTMPS, its secure extension to RTMP. Use the event’s provided secure ingest address where available. YouTube’s ingest guidance specifies the rtmps scheme and port 443, and the hostname must be correct for TLS SNI. See YouTube’s encoder settings and bitrates, YouTube ingestion protocols, and YouTube RTMPS ingestion.

Prepare the Droplet and video

Install and verify FFmpeg

Install FFmpeg using the package source appropriate to your Linux distribution, then check that the installed build includes the codecs and RTMPS support you intend to use. Package names and available codec support differ by distribution and build, so verify the actual binary rather than assuming a particular command will work everywhere. FFmpeg’s protocol documentation describes RTMPS as RTMP over a secure SSL connection: FFmpeg RTMPS protocol documentation.

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.
#1 Best Overall
Guermok Video Capture Card, 4K USB3.0 HDMI to USB C, 1080P 60FPS & 2K 30FPS
  • 【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

Put the file somewhere the process can read it

Use an absolute path to a local file where possible, and ensure the account running FFmpeg can read it. If the file is remote, confirm that the Droplet can reach it reliably for the whole broadcast. Before going live, inspect the file and run a short test with representative movement and audio. YouTube recommends testing stream health before a broadcast.

Choose YouTube-compatible output settings

YouTube’s current encoder guide lists H.264, H.265/HEVC, and AV1 video; frame rates up to 60 fps; constant bitrate (CBR); and a recommended two-second keyframe interval that should not exceed four seconds. AAC or MP3 audio is supported for RTMP/RTMPS. Choose resolution and bitrate from the current YouTube table rather than copying a bitrate from an unrelated example. The Droplet must have enough CPU and network capacity for the selected output; no universal Droplet size or performance figure is established here.

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.
  • Resolution and frame rate: match the intended presentation and choose a bitrate from YouTube’s current encoder guide.
  • Bitrate: use CBR and set the video bitrate and rate-control buffer deliberately. A larger resolution or frame rate generally requires a higher bitrate, but the correct value depends on YouTube’s current table and the Droplet’s tested capacity.
  • Keyframes: target a two-second interval and do not exceed four seconds. With a fixed frame rate, the GOP length in frames is approximately twice the frames per second for a two-second interval; for example, 30 fps uses 60 frames.
  • Audio: AAC is a practical choice for the example below. Set a bitrate appropriate to the content and verify that audio is present in the YouTube preview.

These requirements and recommendations can change; check YouTube’s encoder settings when configuring a new stream.

Run FFmpeg with an indefinite input loop

Use the following as a command template, not a tested, universal command. Replace every uppercase placeholder with the event’s actual ingest components and values suitable for your media, frame rate, and current YouTube guidance:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
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"

The input options -re and -stream_loop -1 appear before -i, which is the input they apply to. -re reads the file at its natural, real-time pace instead of sending it as fast as the Droplet can process it. -stream_loop -1 repeats the input indefinitely. The output options encode H.264 video and AAC audio, then send the stream in FLV format to the RTMPS address.

Set GOP_FRAMES to produce a two-second keyframe interval at your chosen frame rate. For 30 fps, that is 60 frames; use a different value for other frame rates. Replace the URL components with the exact event address and key supplied by YouTube. Do not include the literal placeholders in a live command.

Rank #4
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.

DigitalOcean’s tutorial documents the -stream_loop -1 pattern and -re pacing; see DigitalOcean’s FFmpeg live-streaming tutorial. FFmpeg option placement matters: input options belong before the relevant -i. Confirm syntax and capabilities against your installed FFmpeg build; FFmpeg’s documentation is at FFmpeg command-line documentation.

When stream-copying may be appropriate

If the file already has compatible codecs, timestamps, and characteristics for YouTube ingest, stream-copying may reduce Droplet encoding load. It is not established as suitable for every file or ingest condition. Test it with the actual source and event before depending on it. Re-encoding offers more control over output settings but consumes CPU.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Start FFmpeg, verify the preview, and start the event

  1. Run the command in a session that will remain active on the Droplet. For a long stream, arrange process supervision and server monitoring so that you notice an exit or resource problem; an FFmpeg loop by itself does not restart a failed process.
  2. Watch FFmpeg’s output for connection failures, timestamp errors, encoder overload, and a nonzero exit status.
  3. Open the event in YouTube Live Control Room and verify the preview, audio, and stream health.
  4. For scheduled-stream workflows, follow YouTube’s event controls: a connected encoder may only make the preview available, and you may still need to select Go live in Live Control Room.
  5. Check the file boundary. The loop repeats the video, but it does not smooth a hard visual cut or guarantee seamless audio at the join.

YouTube recommends a test using movement and audio representative of the real stream, and monitoring stream health and encoder warnings while live. Its live-stream instructions say streams under 12 hours are automatically archived; this is not a promise that one event can run indefinitely or that longer sessions will be archived. Plan a session and restart strategy around YouTube’s current behavior: YouTube live-stream instructions.

Troubleshoot common failures

Symptom Likely cause What to check or do
YouTube does not receive a signal Wrong event URL or key, an incorrect RTMPS address, network blockage, or unsupported RTMPS in the FFmpeg build. Copy the current event URL and key again, check the rtmps scheme and port 443, confirm the hostname and path, and verify FFmpeg’s protocol support.
FFmpeg connects, but the event is not publicly live The event may be scheduled and waiting for the creator to start it. Check the preview and health in Live Control Room, then use its event controls if YouTube asks you to select Go live.
Video is rejected or stream health warns about settings Output codec, frame rate, bitrate, keyframe interval, or audio format may not match YouTube’s current guidance. Compare actual output with YouTube’s encoder guide; verify H.264/HEVC/AV1, a supported frame rate up to 60 fps, CBR, keyframe interval, and supported audio.
Video stutters or FFmpeg reports encoding overload The Droplet may not be able to encode the chosen settings in real time. Check CPU load and FFmpeg logs. Test a lower resolution/frame rate or a less demanding encoding configuration, or use stream-copying only if the source is compatible and has been tested.
The stream stops after running successfully FFmpeg exited, the Droplet or network had an interruption, or YouTube ended the event. Check the process exit status and server/network logs, restart the encoder and event as needed, and verify current YouTube duration behavior. The input loop does not itself reconnect or relaunch FFmpeg.
A noticeable click or jump occurs at each repeat The file’s start and end are not seamless. Edit or prepare a version with a clean join, then test the transition in a private or unlisted event before using it for a public broadcast.

Copyright and YouTube policy still apply

Using FFmpeg to loop a file does not grant permission to stream its music, footage, artwork, or other protected material. Use content you own or have permission to broadcast, and check YouTube’s applicable copyright and monetization rules. Repeated playback also does not by itself establish eligibility for monetization; assess the channel and content against YouTube’s current policies. Keep the stream key private and review the event’s visibility and audience settings before starting.

Or let it run in the cloud

If you want a YouTube-only way to keep uploaded videos playing without maintaining a Droplet and FFmpeg process, StreamNeo runs the loop from the cloud. Upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay powered on at home; videos stream as uploaded, up to 4K 60fps, at one flat price per slot. StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card, one free day per account. The Monthly price is $9.99 per month. Start the free day at StreamNeo registration.

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.