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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Shuffle the playlist before FFmpeg reads it: generate a randomized list of video paths, write those paths as file entries in an FFmpeg concat script, then give that script to the concat demuxer. FFmpeg plays the entries in the order listed; looping the script repeats that same order rather than shuffling again.

How the shuffle works

The FFmpeg concat demuxer reads a script containing one file directive per input video. It does not randomly reorder those entries. Randomize the paths first, then create the script in that order. The process is therefore: select files, shuffle their order, format the concat script, and pass it to FFmpeg.

FFmpeg documents the concat demuxer and its script format in the FFmpeg concat demuxer documentation.

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.

Create a shuffled concat list

  1. Choose the intended files. Keep the source videos in a directory such as ./videos. Check that the list includes only the videos you want in the broadcast and excludes unrelated files.
  2. Randomize the paths outside FFmpeg. On Linux, the shuf utility can randomize a list. A null-delimited intermediate list avoids treating spaces as path separators:
    find ./videos -type f -name '*.mp4' -print0 | shuf -z > /tmp/shuffled-paths
  3. Convert the shuffled paths into concat directives. The resulting /tmp/shuffled-paths is not itself a concat script. Convert each path into a file directive in list.txt, using FFmpeg concat-script quoting and escaping rules. Paths with spaces, apostrophes, backslashes, or newlines need correct escaping; do not insert raw filenames and assume they will parse correctly.
  4. Feed the script to FFmpeg. The basic input shape is -f concat -safe 0 -i list.txt. The option -safe 0 permits absolute paths and paths outside the default safe subset, so use it only with a list you trust.

A schematic command is:

ffmpeg -re -f concat -safe 0 -i list.txt [encoding options] -f flv "$YOUTUBE_RTMPS_URL"

This illustrates the input and output structure, not a universal, ready-to-run command. Replace the schematic encoding options with settings appropriate for your media and YouTube stream key. The environment, FFmpeg build, source formats, and filename quoting affect the exact command.

#1 Best Overall
Blackmagic Design Davinci Resolve Speed Editor, Bluetooth & USB-C Editing Keyboard Bundle with Davinci Resolve Studio Activation Card
  • Small and Portable with Built-In Battery
  • Built-In Search Dial
  • Keyboard Shortcuts Match Edit Functions
  • Bluetooth or USB Connectivity
  • Bundle Includes DaVinci Resolve 17 Studio (Activation Card)

Check compatibility before streaming

Concatenation works most reliably when the files have matching stream structures and compatible codecs and time bases. If files differ in codec, stream count, or relevant parameters, concat demuxing may fail or produce timestamp problems and artifacts. Normalize or re-encode incompatible files to a consistent set of streams and settings. Stream-copying is appropriate only when the inputs are compatible; re-encoding costs processing resources but can provide consistent output parameters.

Incorrect stored durations can also affect timestamps for later files. FFmpeg’s concat script supports a duration directive for cases where a file’s stored duration needs to be overridden. Validate the resulting timeline rather than assuming each file’s metadata is accurate.

Rank #2
Sale
XPPen Mini Keydial ACK05 Wireless Shortcut Keyboard Bluetooth Programmable Express Remote Control with Dial & Customized Express Keys for Drawing Tablet PC MacBook Windows Images Video Editing
  • Wireless Connection: ACK05 wireless shortcut keyboard supports bluetooth 5.0 connection directly, which is Good Design Award 2023 Winners, providing you a more flexible and clean workspace. You can also connect it via a Bluetooth dongle or USB cable. Total three ways connection bring you stable and fast transmission, also can meet your different work scenarios
  • Please Note: If you do not download the driver, it can only be used as a regular shortcut keyboard. However, if you wish to customize the keys or program it, you must download the driver and configure it accordingly. If your device is an iPad or runs on iOS, after receiving the product, you need to download the "Shortcut Remote" app on your device in order to properly set up and use this product properly
  • Compact Size with Large 1000 mAh Battery: The Wireless Shortcut Remote features a thin profile and weighs only 75 g, easy for one hand to hold. With built-in 1000 mAh battery ensures the continuous working for about 300 hours. Ready to speed up your creation whenever you grab it
  • Customize up to forty Shortcuts: The Wireless Shortcut Remote has ten keys. You are allowed to customize four sets through the driver -- up to forty shortcuts. To switch between the sets, you only need to press a single key. Its capability to work with different applications makes itself a powerful productivity tool not only for creation, but also for study, work, and gaming
  • Anti-Ghosting Performance: The Mini Keydial features a new technology of Anti-ghosting for all ten keys, you can control with multi-keys at the same time, which will give you more customizable possibilities

Send the playlist to YouTube Live

  1. In YouTube’s Live Control Room, obtain the stream URL and stream key for the broadcast. Treat the key like a password: do not publish it in a script, screenshot, or public example.
  2. Use YouTube’s recommended secure ingest protocol, RTMPS. YouTube Help says, “We recommend streaming to YouTube Live with RTMPS, a secure extension to the popular RTMP video protocol.” See YouTube’s encoder settings guidance and Google’s RTMPS ingestion guide.
  3. Match output settings to your chosen codec, resolution, frame rate, audio, and available upload bandwidth. YouTube lists H.264, H.265/HEVC, and AV1 video for RTMP/RTMPS, AAC or MP3 audio, CBR, and a recommended two-second keyframe interval, not over four seconds. Confirm that your FFmpeg build and selected stream configuration support the combination you use.
  4. Choose a video bitrate from YouTube’s recommended range for the intended resolution, frame rate, and codec on its encoder settings page. There is no single bitrate that is right for every output. Keep the configured bitrate sustainable for the connection’s real upload capacity.
  5. Test with representative video movement and audio, then watch YouTube’s stream health during the broadcast. Do not assume a command or input list that works with one set of files will work unchanged with another.

Will it reshuffle when the playlist loops?

No. If FFmpeg loops the concat input, it plays the same generated sequence again. To get a new permutation on every cycle, an external wrapper or playlist-generation process must create and switch to a newly ordered list. That adds orchestration complexity, and replacing the list may cause a pause or transition depending on how the process is implemented. If you need an identical order for repeatability, keep and reuse the same generated list.

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

Troubleshooting

  • FFmpeg cannot open a listed file: Check that the path is correct and accessible from the process’s working environment. Confirm the concat directive uses valid quoting and escaping, especially for spaces and special characters. Use -safe 0 only for a trusted list when absolute or otherwise non-default paths are needed.
  • The concat input fails or output has artifacts: Compare the files’ streams, codecs, and time bases. Normalize or re-encode inputs that do not have compatible structures.
  • Later files start at unexpected times: Check source duration metadata and timestamps. Where appropriate, use the concat script’s duration directive to supply a corrected duration, then test the resulting sequence.
  • The playlist repeats but does not change order: This is expected when looping one generated script. Regenerate and switch to a new list for each cycle if each pass must use a different order.
  • YouTube reports unstable stream health: Verify that bitrate is suitable for the selected resolution, frame rate, and codec and sustainable on the upload connection. Check the keyframe interval, codec compatibility, and audio settings against YouTube’s encoder guidance.
  • YouTube does not accept the stream: Confirm the active stream key and ingest URL in Live Control Room, use RTMPS where supported, and verify compatibility among the FFmpeg build, codec, and selected stream configuration.

Copyright and live-stream policy checks

Shuffling does not change whether you have the rights to broadcast a video. Before streaming, confirm that you own or are authorized to use every video and its audio, and review YouTube’s current rules for live content and monetization. A playlist of prerecorded videos is not automatically eligible for monetization; reused-content and copyright decisions depend on the content and channel, not on the shuffle method.

Rank #3
TourBox NEO - Editing Controller, Desktop Creative Multi-Control, Wired
  • A Better Way to Create. —Your creative workflow shouldn't be split between keyboard, mouse, and software panels. TourBox brings essential controls together, so fewer interruptions stand between your ideas and your work
  • Go Beyond Shortcuts. —TourBox gives every creative application its own control system. Press, turn, scroll, and navigate with dedicated controls instead of relying on a flat keyboard and mouse for every task
  • Streamline Every Workflow. —Whether you create in Lightroom, Premiere Pro, Photoshop or more, NEO gives you a complete way to start with TourBox, NEO gives you a complete way to start with TourBox. Elevate your experience across digital drawing, color grading, photo editing, and video editing
  • More Controls, More Possibilities. —With 14 dedicated controls included additional D-Pad, Dial, and buttons, NEO gives you the core TourBox experience, with more control than Lite
  • More Control. Less Space. —NEO brings frequently used control, ergonomic design, and intelligent creative software together in one compact system. More of the actions you use most stay within reach, while the same physical control logic adapts to different applications and creative tasks
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 goal is a continuously running YouTube channel rather than learning to operate FFmpeg, StreamNeo is a cloud option for uploaded videos and playlists. Upload the recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; it streams each upload as made, up to 4K 60fps, at one price per slot; it automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. Start at StreamNeo’s free trial.

Best Value
Sale
ActionRing Stream Controller Deck,Macro Keypad,Gaming Shortcut Keyboard
  • 【Freely customizable】You can assign single or multiple actions by dragging and dropping the desired operation onto the six customizable keys and setting the properties. The uses are endless, such as performing game combos, launching apps, controlling media, etc.In addition, you can add images and animations (JPG, PNG, GIF) to each LCD key to enhance button recognition and memorization. With three dials, you can easily adjust the volume, fast forward and rewind playback, etc.
  • 【Perform any operation with one click】The customizable macro keyboard allows you to work efficiently with one click. You can instantly perform any operation, such as launching macros, entering text, opening files and websites, controlling media, and switching OBS scenes, with one click. In addition, by utilizing the "Action Flow" function, you can perform multiple macro actions in a specific order and manage tasks freely.
  • 【Various Compatibility]】This shortcut keyboard is compatible with both Windows and macOS. It works seamlessly with popular software such as OBS, PowerPoint, YouTube, Twitter, Discord, Excel, Word, Photoshop, and Adobe Premiere Pro to make your work even smoother.
  • 【Multifunctional to meet your needs]】This shortcut keyboard's application space offers hundreds of plugins such as schedule reminders, clocks, stopwatches, weather, calendars, etc., making it not only a productivity tool but also a great desktop companion. In addition, 60 types of icon packs are available for you to download and use according to your needs.
  • 【Customer Support】 If you are still unsure of how to set up or operate the product after reading the Quick Start Guide that comes with the product, you can get support in the following ways: 1. Please scroll down the product detail page to watch the tutorial videos in the product videos section. 2. Please select the "Ask a Question" button to contact us.
Rank #4
Sale
Logitech MX Creative Console 9 Customizable Keys - Graphite
  • 3-months of Adobe Creative Cloud on us: Pair two of the world’s top creative tools. Buy one MX Creative Console and claim your free 3-month Adobe Creative Cloud membership
  • Speed Up Your Creative Workflow: The Logitech MX Creative Console lets you quickly access tools and actions on your favorite apps, allowing you to fully focus on your work
  • App Integrations: Adobe Photoshop, Premiere Pro, Illustrator, Lightroom and Lr Classic, Final Cut Pro, Figma, Davinci Resolve, Spotify, Zoom, and more; quick start with recommended profiles (1)
  • Tactile Analog Control: Make precise adjustments with the low-friction control dial, navigate with the roller, and access actions with the programmable keypad (stand included for flexible placement)
  • Customize for Any App: Assign tools and actions to up to 15 keypad pages by profile, dial, and roller, and upload your own icons to the customizable LCD display keys

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.