It is VLC Lua Extension that generates samples of playlist items of desired duration. Now you can create a music collage, automatically preview your film collection, skip intro and credits in series, shuffle tracks, ...
sampler.lua - The extension works in VLC-2.0.x. VLC archive: http://download.videolan.org/vlc/
It plays samples of playlist items of desired duration.
With this extension you can automatically preview your film collection or play interesting sound collage from your music files.
Automatic DOWNLOAD & INSTALLATION of the extension is now (VLC-2.2) available through the Addons Manager in VLC menu (Tools > Plugins and extensions).
Manual DOWNLOAD & INSTALLATION:
DOWNLOA

- click the download button below
- save the .zip file
INSTALLATION:
- extract (unzip) the .lua file and put it in the VLC subdir /lua/extensions, by default:
* Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\extensions\
* Windows (current user): %APPDATA%\VLC\lua\extensions\
* Linux (all users): /usr/lib/vlc/lua/extensions/
* Linux (current user): ~/.local/share/vlc/lua/extensions/
(create directories if they don't exist)
- restart the VLC.
USAGE:
Then you simply start the extension by going to the "View" menu or "Vlc > Extensions" on Mac OS X.
Ratings & Comments
36 Comments
8 Almost perfect addon! But I am missing something. Let's say someone is watching the samplers and there is a great music video in it. Now the one who wants to watch this one music video in full length. He presses any key, the sampler mode is exited, the music video is played in full length. After That the samplers continue, until another great song comes up which you want to see in full length. Can you improve that as feature?
The Sampler (PG) is already a compromise/workaround solution. The extension generates a static playlist. Lua scripting is quite limited in VLC. There is only pause/play (Space key) event available in extensions. Then it is possible to add and play a full length item in the playlist. Some cumbersome solution is really possible.
I've been using this little gem for a long time. Only one of its kind.Any plans to update or have you worked on something similar? I keep thinking how nice something like this would fair with potplayer or mpc.
I will check whether the extension works in new VLC 4 and it will be a good opportunity to improve something, too. What do you expect from update of this VLC Extension?
I was actually just seeing if you were still active on this or had forked off to something else. Its not your plugin its VLC's lack of hardware acceleration and plugins that make other media players so much better. There are only minor things i run into with Sampler that may or may not be my setup. Things like videos always starting at the same spot ( usually in a playlist ). Seeking causes the plugin to stop and play rest of video. But i've been looking for years for something similair for other media players and the best i can find are things like a bookmark jumper or playlist shufflers , so props for the unique plugin.
When I try to load the plugin by going to the "View" menu or "Vlc > Extensions", I get the error-messag: lua info: [Sampler] duration > 308.928215 lua info: [Sampler] samples_number > 1 lua info: [Sampler] skipper > 0 lua info: [Sampler] set_position #1 > 0 lua info: [Sampler] samples_positions > 1 lua info: [Sampler] actual_sample > #1 lua info: [Sampler] new position > 0 lua warning: Error while running script C:\Program Files\VideoLAN\VLC\lua\extensions\sampler.lua, function activate(): ...rogram Files\VideoLAN\VLC\lua\extensions\sampler.lua:76: attempt to call field 'add_callback' (a nil value) lua error: Could not activate extension! main warning: playback too early (-62246): down-sampling main error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1000 ms)
Use "Sampler (PG).lua" instead of "sampler.lua" (for old VLC 2) in current VLC version (3.0.11). Read the description here.
Ive been using this software for some time and it works great, but on some videos if I try to randomly sample very small pieces of the video (for example 1 second or less) it does not work as intended, playing for several seconds instead of only 1 second before changing sample. Like I said, this only happens to some videos, and I would like to know if i can do something to those videos to make them work properly with this addon.
It is out of control of this extension. You can either avoid formats that do not work well with very short durations or better do not use such short times. Try following setting in VLC preferences: Tools > Preferences > Show settings=All > Input/Codecs: Fast seek
woa, actually disabling the fast seek option works perfectlly, thanks you so much
10 10 the best
thanks mederi for developing such a useful add-on. I have a question, is it possible to shuffle the items when "Samples per item" is more than 1. say I have 10 files/tracks and I have "Samples per item" as 5 this would create 50 items currently the 5 items in every file/track/sample are next to each other I want items within the sample to be shuffled as well in the same way you shuffle the tracks/files is this possible?
There is the "Random position" option. Do you want something like "Shuffle samples" when not in random position? |---S1---S2---S3---S4---| => S3, S1,S4,S2
With shuffle tracks ON and random position ON, 3 tracks and 3 samples per track, the playlist would be like this, T3(S1-S2-S3)-T1(S1-S2-S3)-T2(S1-S2-S3) I am after T3S1-T1S3-T2S2-T3S3-T1S1-T2S3-T3S2..........
O.K. I have already written the "Mix playlists" script you can find around. The algorithm can be reused in Sampler(PG). Todo: - The option could be called "Mix samples" placed next to the "Shuffle tracks". - Another new option "Shuffle samples" could be placed next to the "Random position". - Skipper [s] (vs Samples per item). - rework, improve and polish the messy code.
thanks mederi, It would be great to have those features built into the plug-in. Could you please let me know where I can find this "Mix playlists" and how to integrate this into this plug-in to get this working? I have tried a serach but could not find "Mix playlists".
https://addons.videolan.org/p/1167844/ I do not tell you how-to now. I remember the code is a bit messy - a rework with minimal effort, a prototype. Probably it requires more work to implement the feature. I will check it later.
I mean the Sampler PG is messy.
thanks mederi. I could not get it to work. I would be happy to test it if you ever get a moment to do a prototype. Let me know.
10 10 the best
9 +100
Would love to have this available for Android Samsung tablet? Was trying to download on my Android is this possible? Can't figure it out or is it only available on PC? If so can it be available on Android Samsung tablet?
VLC Extension Lua scripts are not supported in VLC for Android. You could try whether it is possible to run VLC for PC on Android (I have Googled a bit: Wine for Android?). You should try the extension in VLC on PC. The Sampler (PG) generates a playlist with playlist items containing star-time/stop-time advanced VLC options. Then you can save such a playlist with relative paths (VLC 3+) if you save it in the same local folder. Then you could try to run such a playlist with the same folder of media files in VLC for Android. You could let me know, whether VLC for Android supports playlists with advanced VLC options.
Thank You Mederi for reply so quickly! I am computer savvy, but not as savvy as to know what Wine for Android is or what it could do? Also, I am fine with using this script on my PC, but do not use my PC as much as my mobile Android Tablet device. Would be very cool and nice for it to be made into an Google Play App for Android device (Pleeeeease!?) I've looked EVERYWHERE and cannot find any similar app to play portions of random videos anywhere, seems very rare. Is frustrating because i would love to do this since i host multiple events and have work and house party events, which i would love to play my music and multiple video portions along with this. Can this be accomplished somehow one way or another? Even if it's a separate piece of software or integrated? I am not "programming language" literate, only computer savvy and very literate when it comes to integration, research, etc. This type of software is just NOT out there and available for anything. The only thing that comes close is "styxar video randomizer" which is both outdated and confusing to use. Could you check this piece of software out and replicate it or make something similar to use with Android and VLC devices etc? Thanks for the input, i will definitely try what you recommended and let you know what happens. I'm very much appreciated for your prompt and generous and informational reply. This is a wonderful piece of software you have developed and just needs research and developing. Heck, i'd pay for it. I'm sure others would too if so was elaborated, made for multiple devices, and simplified. Thanks & Cheers
PS. Plus the Styxar Video Randomizer software is both outdated and the developer is no longer available to purchase or contact for software key updates etc.