October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk6 min

How to Loop a Video Playlist to YouTube Live with FFmpeg on a VPS

Use FFmpeg’s concat demuxer and -stream_loop -1 to repeat a playlist to YouTube Live, with guidance on ingest settings, testing, and VPS limits.

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.

Use FFmpeg’s concat demuxer to read a playlist file, then apply -stream_loop -1 to that input to repeat it indefinitely. Send the output to the YouTube Live ingest URL with the stream key from Live Control Room, preferably over RTMPS. The example below re-encodes for a broadly adaptable output; check your media, VPS capacity, and YouTube preview before relying on it.

What you need before starting

  • A VPS with FFmpeg installed and enough sustained upload capacity for your chosen stream profile. Transcoding also consumes CPU or GPU resources; no provider-specific VPS size or guaranteed workload capacity is established here, so measure your actual workload and check the provider’s bandwidth and egress limits.
  • Video files you have the right to broadcast. Technical compatibility does not establish copyright permission, monetization eligibility, or whether a playlist complies with YouTube policies.
  • A YouTube channel with live streaming available, and access to its Live Control Room.
  • A secure way to store the stream key. YouTube describes stream keys as “your YouTube stream’s password and address” (YouTube Help: Manage live stream settings); do not place a real key in a public script, repository, or log.

1. Prepare the playlist and inspect the media

Create a concat-demuxer list

Make a plain-text file such as playlist.txt, with one file entry per line and the order you want clips to play:

file '/path/to/clip-one.mp4'
file '/path/to/clip-two.mp4'

The concat demuxer sequences packet sources; it does not make dissimilar files uniform. Before running the stream, inspect the files and confirm the intended audio and video streams, codecs, and time bases are compatible. FFmpeg notes that inaccurate durations can cause artifacts. See the FFmpeg concat demuxer documentation.

Handle paths carefully

The sample command uses -safe 0 so that ordinary absolute paths can be used in the list. That relaxes concat’s path safety checks: use it only with a playlist you control, never with an arbitrary list supplied by someone else. Alternatively, keep paths within the allowed safe format and omit the override. Consult the demuxer documentation for the syntax and restrictions that apply to your FFmpeg build.

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

Choose copy or re-encoding

Approach When it fits Trade-off
Stream copy (-c copy) Use when all files have compatible streams, codecs, and time bases, and the resulting streams are suitable for YouTube ingest. Uses less encoding work, but does not normalize mismatched sources; incompatible files or inaccurate durations may cause failures or visible/audio artifacts.
Re-encode Use when you need a consistent output or source streams are not suitable as-is. Can normalize output, but requires suitable encoding settings and more VPS CPU/GPU capacity. Inspect transitions and measure the real workload.

2. Create or select the YouTube live stream

  1. Open YouTube Studio and go to Live Control Room.
  2. Create or select the stream, then set the title, privacy, and other metadata you want viewers to see.
  3. Copy the ingest URL and stream key shown for the stream. Use the URL shown in Live Control Room rather than guessing an ingest address.
  4. Keep the key private. If it is exposed, reset it in Live Control Room and update the FFmpeg configuration.

YouTube documents encoder setup and the server URL/key workflow in Create a YouTube live stream with an encoder, and explains encrypted ingest at Encrypt your stream using RTMPS.

3. Start FFmpeg with a looping playlist

Example using H.264 and AAC re-encoding

Replace the paths, encoding options, ingest URL, and key with values appropriate for your files and account. This is an illustrative command, not a tested VPS recipe or a universal bitrate recommendation:

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -c:v libx264 -preset veryfast -b:v 4000k -maxrate 4000k -bufsize 8000k 
  -pix_fmt yuv420p -g 60 -c:a aac -b:a 128k 
  -f flv 'rtmps://INGEST_URL/STREAM_KEY'

-stream_loop -1 is an input option: keep it before the corresponding -i. It tells FFmpeg to repeat that input indefinitely. -re reads the media at its native rate rather than sending it as fast as the machine can process it. The example uses H.264 video, AAC audio, a two-second GOP only when the output is 30 fps, and a sample video rate of 4,000 kb/s; those values are not appropriate for every resolution, frame rate, codec, or VPS. If you use a different frame rate, adjust the GOP to preserve the intended keyframe interval.

YouTube’s published encoder guidance lists RTMP/RTMPS ingest; H.264, H.265, or AV1 video; AAC or MP3 audio; up to 60 fps; constant-bitrate encoding; and a recommended two-second keyframe interval, not over four seconds. Exact bitrate guidance varies with codec, resolution, and frame rate. Choose a profile using YouTube’s encoder settings, bitrates, and resolutions, then confirm the VPS can sustain the upload rate. YouTube recommends RTMPS when supported; verify your FFmpeg build accepts the protocol and use the URL Live Control Room supplies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
HP MicroServer Gen10 Plus Mini Tower Server, Intel Xeon E-2224 3.4GHz, 32GB RAM, 16TB Storage, RAID, Windows Server 2019
  • HP MicroServer Gen10 Plus Tower Server for Business with Microsoft Windows Server 2019 OS!
  • Intel Xeon E-2224 Quad-Core 3.4GHz 8MB CPU, Up To 4.6GHz Turbo
  • 32GB (2 x 16GB) DDR4 PC4-21300 2666MHz Unbuffered Memory
  • 16TB (4 x 4TB) 7.2K 6Gb/s SATA 3.5" HDDs in RAID
  • Hard drives and memory upgrades included separately NOT installed, installation required.

Using stream copy instead

If the playlist’s streams are compatible and already meet the ingest requirements, replace the video/audio encoder options with -c copy. Do not assume this will work for any arbitrary combination of MP4 files: test the exact playlist and inspect the output, especially at file boundaries. If copy produces errors or discontinuities, normalize the media or re-encode it with settings suitable for the source and target stream.

Protect the key in operation

For a one-off test, a shell command with a private key may be convenient, but command history and process output can expose credentials. For ongoing operation, restrict access to the script or configuration that contains the key, avoid publishing it, and do not paste it into logs or support messages. If compromised, reset it in Live Control Room.

4. Preview the stream and verify the loop

  1. Start the FFmpeg process and open the stream preview in Live Control Room.
  2. Check that both audio and video arrive, the aspect ratio is correct, and motion and sound are representative of the actual playlist.
  3. Watch at least one transition between files. Confirm that video, audio, and timing continue as intended.
  4. Review Live Control Room’s stream-health status and messages; investigate dropped frames or connection warnings before leaving the process unattended.

YouTube recommends a test before going live and advises checking the preview and stream health. See YouTube streaming tips.

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

5. Plan for interruption and archiving

A looping input does not guarantee that the FFmpeg process, VPS, network connection, or YouTube ingest will remain uninterrupted. Plan how you will notice and recover from a stopped process or dropped connection, and consider how a restart will affect viewers. This setup does not establish provider-specific reliability or promise that a single process will run forever.

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

YouTube Help says, “All streams under 12 hours will be automatically archived.” That is an archive condition, not a guarantee that every stream will archive successfully; do not assume an arbitrarily long continuous broadcast will be fully archived. Plan your session length and verify the current behavior in Live Control Room. See YouTube’s encoder setup guidance.

Common problems and fixes

Symptom Likely cause What to check
FFmpeg rejects the playlist or cannot open a file Malformed concat entry, inaccessible path, or path rejected by concat’s safety rules. Check each file line, file permissions, and path. Use -safe 0 only for a list you control.
The stream fails at a clip boundary or shows glitches Files have incompatible stream properties or duration/timestamp irregularities. Inspect codecs, stream structure, time bases, and durations. Normalize or re-encode the sources, then preview transitions again.
YouTube does not receive the stream Wrong ingest URL/key, key mismatch, unsupported protocol in the FFmpeg build, or a connection problem. Copy the current URL and key from Live Control Room, confirm RTMPS support, and check FFmpeg output and Live Control Room messages. Reset an exposed key.
Stream health reports dropped frames or the VPS struggles Upload capacity may be insufficient or the VPS may not keep up with transcoding. Check sustained upload and provider limits; reduce the selected output profile if needed, or use compatible stream copy. Measure the actual workload rather than assuming a VPS size.
Audio is missing or transitions are abrupt One or more clips may lack audio, have a different audio format, or have problematic timing. Inspect each file’s audio stream and test the list end to end. Normalize the audio tracks where required.

Or let it run in the cloud

If you do not want a VPS and FFmpeg process to manage, StreamNeo keeps an uploaded-video YouTube stream running from the cloud: upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; it streams the uploaded quality up to 4K 60fps at one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card. Monthly is $9.99 per month. StreamNeo streams to YouTube only, and plays uploaded videos rather than broadcasting a camera feed.

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.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
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.