Page 1 of 1

Is random really random?

Posted: 08 Jul 2022 03:33
by tsreyb
I've used both the random button from the gui as well as the command line -Z switch. Neither seems to generate a playlist that seems remotely random. Is it true? I'm just curious if there's any known issues.

Examples ...

I have 4,200+ video files evenly distributed in 200+ directories.

(1) I cd into the root folder of all these video files and enter "vlc -Z ." Result: THREE of the first five video selections were the SAME FILE!!!

(2) I repeated the previous test. I got one video repeated within the first eight selections (much better, but still unlikely)

(3) I launch "vlc ." from the same directory. In the gui, I click on the 'random' icon in the onscreen display. I confirm the icon is selected. I then click on 'next media in the playlist' button repeatedly and keep track of repeats. Within the first 20 selections two of the videos were repeated. From a pool size of 4,200+ videos, the odds of this occurring from a pseudo random number generator are rather low. Similarly, three of the selected videos came from the same directory. From a pool of 200+ directories, selecting from the same directory three times within the first 20 selections does not appear to be consistent with a pseudo random number generator.

(4) I repeated the previous test. This time four videos from the same directory were selected within the first 22 selections. Again, the number of directories is 200+. If I roll a 200 sided die 22 times, the chances of having the same number appear four times is pretty slim.

I understand that random number generators can validly select the same number within close proximity. But over time the likelihood of this occurring becomes quite low. With 4200+ videos evenly distributed among 200+ directories, I am observing repetitions that occur time and time again.

Re: Is random really random?

Posted: 08 Jul 2022 10:11
by Lotesdelere
Pure randomness doesn't exist on computers:
https://en.wikipedia.org/wiki/Pseudorandomness

Re: Is random really random?

Posted: 08 Jul 2022 14:18
by Rémi Denis-Courmont
VLC cannot modify the playlist tree structure, only randomise the order of sibling nodes. So make sure the playlist is flat.

Re: Is random really random?

Posted: 15 Jul 2022 16:41
by c627627
When you say "playlist is flat" - how do we make the playlist flat!? What do we actually do?

Re: Is random really random?

Posted: 16 Jul 2022 09:44
by Rémi Denis-Courmont
I mean only top-level items, no hierarchy in the playlist structure.

Re: Is random really random?

Posted: 18 Jul 2022 06:25
by c627627
I understand that to mean that we cannot add a folder with subfolders to the Playlist.
So we have to manually click on every subfolder in the Playlist to open the folders inside the Playlist, and only then will those files play randomly?

Is there a .bat file or a function that could automatically do that? It sounds like if there was, the Random Play would be possible.


Theoretically when you look at other old inactive players like Winamp - they never added a folder to a Playlist.
They only add the contents of each folder to the Playlist. *Files, not folders.*

What would it take to make VLC do that as well, making Random Play possible for a folder with subfolders?


I mean you have a PC. And on that PC, there is a music folder. *And inside it are music folders for each album.*
And VLC cannot Random Play these folders because instead of adding songs from each of these subolders - it adds the actual folders (!)

If other players can add files, surely we can have the option, just the option, of adding files from subfolders into VLC - not add folders, just add their contents, just the files...

Re: Is random really random?

Posted: 18 Jul 2022 19:55
by Rémi Denis-Courmont
VLC 4.0 reverted back to an always flat playlist already. This is not a black and white problem though. Some people did like the hierarchical layout and don't care about randomisation.

Re: Is random really random?

Posted: 20 Jul 2022 06:52
by c627627
Why one or the other?
Why not simply have a button and you CHOOSE which you want and it solves the problem for people who do like true SHUFFLE play without bothering people who do not like it.

Why no choice?

Otherwise we have to wait until v4 is out, when will that be?

Re: Is random really random?

Posted: 20 Jul 2022 20:06
by Rémi Denis-Courmont
1) Because it is too much work to have both.
2) When it is ready.

Re: Is random really random?

Posted: 30 Sep 2022 16:09
by hesnotthemessiah
Why one or the other?
Why not simply have a button and you CHOOSE which you want and it solves the problem for people who do like true SHUFFLE play without bothering people who do not like it.

Why no choice?

Otherwise we have to wait until v4 is out, when will that be?
Looking for this as well. Can't really understand how this is not possible when not having it can really put limitations on how VLC media player can be used or can make using it much more long winded. "Include Subfolders" option would be great and it seems strange to me that this was not kept as an option. With the "Include Subfolders" option, you could just select a folder, then choose the option "Include Subfolders", and then have all that folders subfolders searched for files (of your chosen formats).

The current drag and drop option can definitely help speed up loading from multiple subfolders though.

Re: Is random really random?

Posted: 30 Sep 2022 16:40
by Rémi Denis-Courmont
As far as I understand graph theory, it is in fact logically not possible, so I rather don't understand how you can't understand it.

But maybe I just don't understand graphs. Patches are welcome as always.

Re: Is random really random?

Posted: 30 Sep 2022 23:14
by hesnotthemessiah
As far as I understand graph theory, it is in fact logically not possible, so I rather don't understand how you can't understand it.

But maybe I just don't understand graphs. Patches are welcome as always.
Hi Rémi Denis-Courmont. I had never heard of graph theory before, so had a read up on it. I think I can see now, that there could be conflicts with interconnecting folder paths causing endless loops for some users. Is that what you are referring to here?

Re: Is random really random?

Posted: 26 May 2023 23:38
by haydent
does random play everything once before something is played twice ?