Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check 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
Mountain View desk5 min

FFmpeg Command to Loop Several Videos in Sequence for YouTube Live

Use FFmpeg’s concat demuxer to play videos in order and loop the full playlist to YouTube Live, with settings and compatibility checks to make the stream more reliable.

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.

Use FFmpeg’s concat demuxer to play a playlist in order, and place -stream_loop -1 before that playlist input to repeat the sequence. The files need compatible streams, codecs, and time bases for this approach; if they do not, normalize them or use the concat filter with re-encoding. Then send the output to the RTMPS ingest URL and stream key from your own YouTube Live setup.

Build a playlist in the order you want

Create a plain-text file named playlist.ffconcat beside the video files. The first line must be exactly ffconcat version 1.0 for automatic format recognition. List one file per line, in playback order:

As an Amazon Associate I earn from qualifying purchases.

ffconcat version 1.0
file 'video-01.mp4'
file 'video-02.mp4'
file 'video-03.mp4'

Use paths relative to the playlist when possible. FFmpeg’s concat demuxer reads the entries sequentially and adjusts timestamps so each file follows the preceding one. For the no-re-encode route, the inputs must have compatible streams, codecs, and time bases; mismatches can cause errors or visible or audible artifacts. See the FFmpeg concat demuxer documentation.

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

Run the sequence repeatedly and send it to YouTube

This command is a starting template, not a verified command for every FFmpeg build or media set. Replace the RTMPS destination with the URL and stream name/key shown by your YouTube Live setup:

#1 Best Overall
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.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.ffconcat 
  -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k 
  -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 
  -f flv 'rtmps://YOUR_INGEST_HOST/YOUR_STREAM_KEY'
  • -stream_loop -1 repeats the playlist input indefinitely. It appears before -i playlist.ffconcat because it applies to that input.
  • -re paces file input for live output. Confirm the option and syntax on your installed version with ffmpeg -h full.
  • -f concat selects the concat demuxer. -safe 0 allows broader playlist paths; use it only with a playlist you control. Prefer simple relative paths and the default safe mode when those work.
  • -c:v libx264 and -c:a aac encode video and audio. The bitrate and GOP values shown are examples in a template, not universal YouTube recommendations.
  • -f flv packages the outgoing stream for RTMP-family ingest. Use the actual ingest URL and stream name/key supplied in YouTube Studio or your live setup; never share the key.

Some encoder interfaces request the server URL and stream name separately; others accept them as STREAM_URL/STREAM_NAME. YouTube’s Live Streaming API documentation describes the primary RTMPS ingest address and these URL/key arrangements. Get the values from your account rather than copying an example destination.

Choose output settings for the stream you intend to send

The sample uses H.264 video and AAC audio, but resolution, frame rate, bitrate, and keyframe interval must match your chosen output mode and available upload capacity. YouTube’s current guidance supports RTMP/RTMPS ingest; lists H.264, H.265, and AV1 video and AAC or MP3 audio; and calls for CBR encoding, frame rates up to 60 fps, and a recommended 2-second keyframe interval that should not exceed 4 seconds. YouTube recommends RTMPS for encrypted transport (encoder settings and guidelines).

Rank #2
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

As one specific example—not a universal target—YouTube’s current settings table recommends 10 Mbps for H.264 at 1080p and 30 fps. Its recommendations differ by resolution and frame rate, so check the row for your actual output mode before setting a bitrate (YouTube’s bitrate table).

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

The template’s -g 60 -keyint_min 60 requests a 60-frame GOP. That corresponds to a 2-second interval at 30 fps, but not at every frame rate. Adjust the GOP/keyframe values to the output frame rate so the interval matches YouTube’s guidance. Set a resolution and frame rate explicitly if the source files do not already produce the output mode you want; verify the resulting stream rather than assuming the files’ properties are suitable.

Rank #3
4K HDMI Capture Card for Streaming, Full HD 1080P 60FPS USB 3.0 Cam Link Game Audio Video Capture Card, Work with Camera/Switch/Xbox/PS4/PS5/PC/OBS (Black)
  • 【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.
  • 【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】Kedok 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

When the concat demuxer is not suitable

If the listed files differ in streams, codecs, or time bases, the concat demuxer may fail or produce bad transitions. Probe each file and compare its video and audio streams before relying on a direct sequence. If inputs are not compatible, normalize them to a common format first or use FFmpeg’s concat filter, which re-encodes as needed. The FFmpeg FAQ on joining video files distinguishes the demuxer route, which can avoid re-encoding with suitable inputs, from the filter route for cases requiring re-encoding.

Test before relying on a live broadcast

  1. Check your installed FFmpeg version and available options with ffmpeg -version and ffmpeg -h full. In particular, verify -stream_loop support and syntax for that build.
  2. Probe every playlist file and confirm the streams are compatible for the demuxer workflow. If not, normalize the files or switch to a concat-filter workflow.
  3. Run a private or otherwise appropriate test stream using the real output settings. Check that all files play in order, the playlist returns to its beginning, and audio and video remain synchronized across transitions.
  4. Test audio and motion similar to the planned stream, then monitor YouTube stream health while testing. YouTube recommends testing before going live and monitoring stream health (YouTube encoder guidance).
  5. Keep the stream key private. If it is exposed, replace it in YouTube rather than continuing to use a compromised key.

Troubleshooting common failures

  • FFmpeg rejects the playlist header: Confirm ffconcat version 1.0 is the exact first line, with no blank line or other text before it.
  • A file cannot be opened: Check the spelling and working directory, then confirm the path is correct relative to the playlist. If you need broader path handling, -safe 0 permits it, but use that option only with a playlist you control.
  • The sequence fails at a file boundary: Compare the files’ streams, codecs, and time bases. Normalize mismatched inputs or use the concat filter with re-encoding.
  • The stream is rejected or does not connect: Recheck the ingest URL and stream name/key in your YouTube live setup, use RTMPS where available, and confirm the selected video and audio encoders are supported by YouTube.
  • Video quality, buffering, or stream health is poor: Match the bitrate to the chosen resolution and frame rate and to your available upload capacity. Check that encoding uses CBR and that the keyframe interval meets YouTube’s guidance for the selected frame rate.
  • The loop option fails: Check the installed FFmpeg build’s help output for -stream_loop syntax and availability. The command is a template and has not been verified against your specific build and files.

Or let it run in the cloud

If your goal is an always-on YouTube stream rather than managing an FFmpeg process yourself, StreamNeo runs uploaded videos or playlists from the cloud. Upload the video or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; the stream keeps running with your computer off. Every slot streams the uploaded quality up to 4K 60fps at one flat price per slot, and StreamNeo automatically recovers if YouTube drops the stream. The first day is free with no card required; it is one free day per account. Monthly pricing is $9.99 per month. StreamNeo is YouTube-only and plays uploaded videos; it does not stream from a camera. See StreamNeo or its plans. Start your free first day with StreamNeo.

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.

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.