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

FFmpeg’s concat demuxer plays files in the order they appear in its input list; it has no built-in shuffle or multi-episode cooldown setting. Shuffle the episode list before passing it to FFmpeg. That gives each file one play per pass, while a longer no-repeat window across playlist loops requires an external scheduler that tracks recent episodes.

Shuffle a folder into one randomized pass

The example below uses Python to build a randomized FFmpeg concat list. It assumes the script runs from the directory containing a videos folder, and that the MP4 filenames use portable characters without spaces or special characters.

  1. Put the videos in videos/. Keep one file per episode if you want file-level repeat control.
  2. Save this as make_playlist.py beside that folder and run it with Python:
from pathlib import Path
import random

files = sorted(Path("videos").glob("*.mp4"))
if len(files) < 2:
    raise SystemExit("Put at least two episode files in videos/")

random.shuffle(files)

# Avoid an immediate repeat where a loop joins the last item to the first.
while files[-1] == files[0]:
    random.shuffle(files)

with open("playlist.ffconcat", "w", encoding="ascii") as playlist:
    playlist.write("ffconcat version 1.0n")
    for path in files:
        playlist.write(f"file {path.as_posix()}n")

Python’s random.shuffle changes the list in place. Because this list contains each matching file once, every file appears once in the generated pass. Python also provides random.sample(files, k=len(files)) to return a shuffled selection without replacement. See the Python 3.11 random documentation.

Create a single output file

Run this from the same parent directory:

ffmpeg -f concat -safe 1 -i playlist.ffconcat -c copy shuffled.mp4

-c copy copies the streams rather than re-encoding them, provided the files meet the concat demuxer’s compatibility requirements. This command produces one file in the shuffled order; it does not independently reshuffle the list while running.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
New Remote Control for Media Players
  • Infrared, distance: 7m
  • Angle: 30 degree
  • Work with our AGPTEK/MYPIN media players only
  • Work with AAA battery, not included
  • 1 * Remote control , nothing else

Loop the randomized playlist

To repeat the entire listed sequence indefinitely while producing an output, put the input option -stream_loop -1 before the input:

ffmpeg -stream_loop -1 -f concat -safe 1 -i playlist.ffconcat -c copy output.mp4

FFmpeg defines -1 as infinite input looping and 0 as no looping. Each pass follows the same concat list in the same order. The script’s first/last check prevents the last file from immediately meeting itself at the cycle boundary, but it does not create a longer cooldown. See the FFmpeg manual’s main options and concat demuxer documentation.

Rank #2
ACEMAX 4K Media Player Optional Remote Control Replacement Remote Control Compatible with MICCA G4 G3 Media Player
  • Optional Remote Control for ACEMAX 4K HDD Media Player
  • Replacement Remote Control for MICCA G3, MICCA G4 Media Player
  • Optional Remote Control for JLZNLZ 4K HDD Media Player

Set a real multi-episode cooldown

A shuffled pass without replacement guarantees no repeated file within that pass. After the pass ends, a loop starts the same sequence again. To require, for example, several different episodes between plays of the same episode across pass boundaries, use a scheduler outside FFmpeg that records recent episode identities and only selects eligible episodes.

  • Choose what counts as an episode. If two files are alternate encodes or duplicate copies of the same episode, treat them as one identity in the scheduler. A filename shuffle cannot detect that they tell the same story.
  • Make the library large enough. A cooldown cannot be satisfied if too few distinct episode identities are available. Define behavior for the case where none are eligible, such as waiting, relaxing the cooldown deliberately, or reporting that the library is too small.
  • Persist history. Store recent identities somewhere that survives a restart. A freshly shuffled list alone forgets what played in previous runs.
  • Regenerate the next selection when needed. The simple -stream_loop -1 command replays a fixed sequence; it does not ask an external scheduler for a new episode after each pass.

Check file compatibility and paths

When stream copy works

The concat demuxer expects the files to have the same streams, codecs, and time bases. If they match, stream copy can avoid a generation-loss re-encode. The FFmpeg concat documentation also warns that inaccurate file durations can cause artifacts because durations help position the next file’s timestamps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
MOVHEIYL Replacement Remote Control for Neumi Atom Digital Media Player
  • Compatible with Neumi Atom 4K Lite Ultra-HD Digital Media Player
  • 【Advanced Infrared Technology】:Strongest and stable signal by Infrared technology, Long transmission distance, 0.2s fast response, Multi-angle & long-distance control and without obstruction.
  • 【High Quality】:Made of High Quality ABS material, which is resistant to falling and has no peculiar smell, Built to Last for Long Lasting Use, and also keeps you and your children away from harm.
  • 【Easy to use】:No programming or setting up required. Just insert batteries (Not included) to replace your original remote control perfectly.
  • 【Premium After-sale】:We provide a 1 year warranty return service. If you have any questions about your order, please feel free to contact us directly and we will get back to you within 12 hours.

When the episodes do not match

If stream layouts or encoding parameters differ, do not assume -c copy will make them compatible. Normalize the inputs or use a concat-filter workflow with an appropriate re-encode. The FFmpeg FAQ explains the distinction between the concat demuxer and concat filter.

Filenames with spaces or special characters

The sample uses -safe 1, which accepts relative paths made from portable characters and disallows unsafe path forms. For filenames containing whitespace or special characters, follow FFmpeg’s concat-script quoting and escaping rules; shell quoting alone is not a substitute. -safe 0 permits any filename, but use it only when the paths are trusted local files and it is genuinely necessary. The relevant rules and examples are in the FFmpeg concat documentation.

Rank #4
Mars Fox BT Multimedia Music Player Remote Control for Play Pause Next Prevtrack Volume Up/Down Mute Fit for iOS iPhone ipad Android System Smartphone Tablet Devices Sony FiiO Player ect
  • You don’t need to change the Music with your fingers. This bluetooth remote control can scroll the pause/play Music APP. Next Prevtrack,Volume yp or down,mute etc. Of course, it is a good helper for you to take selfie or videos.
  • capture stunning photos&video remotely with easy - Say goodbye to blurry photos. Eliminate camera shake for razor crisp photos every time. Snap photos and Start/Stop video recording with the click of a button.
  • 【!!!You must read it if your device is Iphone or Ipad etc. IOS system devices】!!! TThe" Home "button not fit for Ios System like iphone ipad itouch.
  • It is follow ergonomic. Comfortable hand feeling. Pleasant sound of silicone keypad built-in light strength pot piece .High grade acrylic panel. Standby time more than one year
  • There is a call answer and end button

Troubleshoot common repeat and concat problems

  • An episode appears twice in one pass: Check whether the folder contains multiple copies or alternate encodes, or whether the playlist-generation process added an entry more than once. File-level shuffling cannot deduplicate by story identity.
  • The same episode returns at the next loop: That is expected when the fixed playlist loops. The boundary check prevents only an immediate last-to-first repeat; use persistent scheduling state for a longer cooldown.
  • FFmpeg rejects a path: Check that the script is running from the expected directory and that each path is relative and safe for -safe 1. Escape or quote special characters using concat-script syntax, or use -safe 0 only for trusted local paths when needed.
  • Concat fails or the output has artifacts at transitions: Compare the files’ stream layouts, codecs, time bases, and durations. Normalize mismatched inputs or use a filter-based concat workflow with re-encoding where necessary.
  • Your locally installed FFmpeg behaves differently from online guidance: FFmpeg says its online documentation is regenerated nightly for the newest revision; consult documentation installed with an older local build. See the FFmpeg documentation index.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If your end goal is a YouTube channel that plays uploaded episodes continuously, the FFmpeg method keeps the work on your own machine and depends on the playlist and process you configure. StreamNeo is a separate cloud option for looping uploaded videos to YouTube: upload a recording or build a playlist, add your YouTube stream key once, and go live.

  • Nothing has to stay on at home: the stream runs from the cloud, so your computer can be off.
  • Videos stream as uploaded, up to 4K 60fps, at one flat price per slot rather than quality tiers.
  • StreamNeo automatically recovers if YouTube drops the stream.
  • The first day is free, with no card required.

Monthly pricing: $9.99 per month. See StreamNeo, then start your free day.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
SJUIF Replacement Remote Control for AGPTEK HD Media Players Mini 1080p
  • Compatible Models:This New Replacement Remote Control Compatible with HD Media Players Mini 1080p
  • 【NOTE】Not compatible with other brands or types. Before ordering, please ensure your original remote control matches the buttons and appearance shown in the illustration. Otherwise, it may not function properly
  • Easy to Use: Features an upgraded chip with built-in infrared technology. No programming or pairing required—just requires two standard AAA batteries
  • Durable & Comfortable: Featuring high-quality ABS material and a newly upgraded smart chip, it delivers instant button response with precise control up to 8 meters/26 feet. Soft silicone buttons protect fingertips, while the ergonomic curved design ensures comfortable, fatigue-free use during extended daily operation
  • Package included & After-Sales Service:1 * Remote Control ( Battery & Instruction Not Included.) If you have any questions, please contact us through AMZ tools and we will help you within 12 hours

Sources and version context

FFmpeg’s online manual corresponds to its newest revision and is regenerated nightly; for older installed versions, consult the documentation that came with that build. The Python example follows the Python 3.11 random-library API.

Quick Recap

Bestseller No. 1
New Remote Control for Media Players
New Remote Control for Media Players
Infrared, distance: 7m; Angle: 30 degree; Work with our AGPTEK/MYPIN media players only; Work with AAA battery, not included
$9.99
Bestseller No. 2
ACEMAX 4K Media Player Optional Remote Control Replacement Remote Control Compatible with MICCA G4 G3 Media Player
ACEMAX 4K Media Player Optional Remote Control Replacement Remote Control Compatible with MICCA G4 G3 Media Player
Optional Remote Control for ACEMAX 4K HDD Media Player; Replacement Remote Control for MICCA G3, MICCA G4 Media Player
$9.99
Bestseller No. 3
MOVHEIYL Replacement Remote Control for Neumi Atom Digital Media Player
MOVHEIYL Replacement Remote Control for Neumi Atom Digital Media Player
Compatible with Neumi Atom 4K Lite Ultra-HD Digital Media Player
$12.99
Bestseller No. 4

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.