Random Video Player from .srt subtitles file

Hi there,

I’m totally new to VVVV although I do have some familiarity with MaxMSP/Jitter.

What i’m trying to do is have a patch which reads a subtitles file, and when certain keywords come up in the text it will select a random video from a specific folder and send it to an output. The video is 4k but I have a pretty good graphics card (GeForce GTX 1080).

So basically a stream of data, something that checks to see if any of the words in that line match any of the keywords, if so then make random selection from matching folder, if not then continue to next video in current folder or something like that.

Hope that makes sense. I see there are some tutorials on video playback and selecting a random video index so that shouldn’t be too hard, but it would good if anyone has any ideas on how to read out the subtitles file and check for the matching words>send the trigger to select the video.

Any help very much appreciated,

yo hmihalis1,

Check the help patch of the SRTReader (File) node to read SRT files. Then you could use Sift (String) to search for your words and trigger your logic.


Yes I was looking at both of these objects whilst researching today so good to know I’m on the right track with that. What about random video selection from playlists could you point me to any examples of that?

Can’t think of a premade example somewhere but you could get a random video path at each bang with something like that

Great thanks for your help. I think I have all the components now just have to sit down and figure out how they fit together.

yep, don’t hesitate to post your patch if you get stuck somewhere!

fantastic thanks so much! i definitely will hopefully I can make some good progress today.

Hey so I managed to get the SRTReader and Sift string nodes working the way I need, just need to find a way to loop the SRTReader and set up the random video playlists - do you have any ideas on how to loop it?

sorry silly question about the loop a simple greater than to a bang of the reset button sorts it of course :)

here is the patch so far

I have a question now. When using the sift object from the srtreader I get bangs whenever a certain word is matched, but the value changes constantly throughout the time that the bang is on so the videos change really fast and the patch always crashes. Do you know a way to limit the bang to just one signal?

I imagine playback and preloading is going to be a big issue with this footage as its 4k…

edit: managed with a change node.

Do you have any reccomendations for dealing with 4K footage and transitions?

yep, using HAP Media Player :)

Concerning the bang limitation stuff, you could maybe use FlipFlop + Togedge so that you get only the first bang and then reset the flipflop node say when your video is over so you can trig a new one (didn’t have time to look at your patch so maybe I did not exactly get what you wanna do)

Cool thanks I went through many different codecs and players and did manage to finally get some decent results using FileStreamVlc2 (DX11.Texture Vlc), although once I added some more functionality back in its started crashing vvvv everytime I open it up so i’ll look into this HAP player.

For the bangs i’m just using a change node which seems to have done the trick. My next thing is to find a way to trigger a separate folder of videos for each keyword so I need some kind of multi-channel set up. Will post the patch in the next few days once I have the problem a bit more worked out.

Many thanks!

Hap player is great for performance but I can’t figure out how to make it switch between different random files - this is where i’m causing crashes with the other players too - would it be too much to ask for a simple setup of the hap player with a random playlist of videos from a directory?

Hi sebescudie,

I’m close to giving up on Hap player. It seems no matter what I try there is no way of changing the filepath to load a new video file. When I do it manually it works fine but any attempt to automate the process just stops playback or crashes the whole program.

I’m working on this project for a canadian artist, I wonder if you would be interested in doing some work on it setting up the basic logic and creating the player. If you are interested or could refer anyone else who might be perhaps you could send your day rate to harrymsanderson@gmail.com and we can begin a conversation.


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.