Choosing between 4 random videos
I'm a total newbie to max/msp and I am getting totally overwhelmed with all the information I don't even know where to start. I would like to make a patch that will select 1 video at random out of 4 different videos, then select another video once the first is played until all 4 videos have been played without any repeats.
I have tried to use the umenu to load my videos but it doesn't seem to work. I've linked the selector tool and random tool and when I attach a number box to it it shows me that it is in fact randomly selecting between 0-3 but how do i like my videos to these?
Any links to tutorials or suggestions would be extremely helpful. I can't seem to find anything on google and the forums are immense.
instead of [random] you should use [urn] as it will only generate random numbers within the range you give it without repeats..then plug that into a number box and that number box into the left of umenu..the videos should be switching
to connect umenu to your jit.qt.movie you'll need to make an object that just says [prepend read] and plug that into jit.qt.movie ..after that you should be business
off the top of my head I can't remember how to tell it to play the next video when one finishes, but i think it has to do with the 'loop' flag on jit.qt.movie that can decide when the movie ends..or you can do some fancy logic with telling it to select when the position of the movie equals the duration..maybe one of these nice guys will make a patch up for you
Thanks pilot. I'l give it a shot
To continue this conversation, can anyone tell me how to load the next random movie file from my umenu after a video has ended?
It doesn't work to have a [loopreport] send a bang to trigger up a new random video because it immediately sends a bang to trigger the next random video and bang again until the cursor is a spinning wheel and I have to force quit.
The way I did this was to load up four seperate jit.qt.movie objects and use gate to switch between videos. I did it this way because I had different proceessing going on with each video.
You can use each movies duration to bang the timing of the next URN playback.
Thanks for the response.
What if you have a [umenu] containing 60+ random videos? I am a beginner with Max/Jitter, but I still can't believe how difficult this simple task has been.
In theory, it would work perfectly if checking the [loopreport] box would only generate a bang at the end of a loop, not the start & end.
Anyone know how to play a new random video when one finishes?
Use "loopnotify" out of the jit.qt.movie object; send this bang to the "urn" object (which generates the random number), into the "coll" object, which you use to list all the videos you want to randomize (this can include as many videos as you want, just make sure the number in your "urn" object corresponds to the number of videos you have in your coll list). I've used this setup on numerous patches for random video playback.
Areac,
How do I list the files into my "coll" object? Do I type in "01.mov, 02.mov, 03.mov, etc." after "coll"? How does it know the file's path?
Do I send that bang straight to "prepend read"?
Thanks for your reply.
I played with the coll help file.
It appears that I open up and enter:
1, [file path];
2, [file path];
3, [file path];
...into the coll file itself to create the number index, as well as the data associated with that index. However, it can't seem to output any data other than numbers in order to reference a random video file.
I'm not sure to understand your problem, but maybe this quick exemple I've made will help you ?
All you have to do next is sending a bang to the urn object at the end of the video.
overjoi, i don't think your issue is with loading the movies. whether you use coll or umenu, you will have the same issue.
i think the issue was with getting double triggers when you use loopnotify.
post your original patch, and we can take a look at your technique and possibly offer suggestions.
Rob,
That is precisely my issue. I have random videos successfully playing, as well as swapping in/out when I hit the buttons. I just don't want to have to hit the buttons, I want the loopreport to trigger the new video when one video ends.
As you will see, if you turn on loopreport in the jit.qt.movie and hit the button at the top of the patch, it simultaneously triggers a new video as soon as a new one is triggered, thus loading a new videos at infinite speed and crashing Max.
Overjoi,
When I'm using the Loopreport fonction and route the signal, it's seems to work. See in the left part of your patch. Be sure to have a videofile to read (means, don't run the patch without your content).
Bart,
You just solved my problem. I left out this important little thing. Thanks so much for the patch.
Is it possible to store and load up the video files off of my ftp with umenu, as long as they are small files? The point in doing that is to share a video application without someone having to download 50+ GB of video files with it.
Many thanks, again.
You're welcome.
For playing video from FTP, I'm sure it's possible.
I know that you can play stream content with jit.qt.movie but I never used it, so I will not be very helpful on this part. But streaming content is a little bit different than just play a video from ftp, I guess. Maybe a solution woulb be the jit.uldl object; using this object, you can download files from a server.
It looks like ftp and http are umenu options for file paths.
I wonder if you can store the videos on a server and use a loadram command for an initial load? Even if it takes a few moments to start the app, is fine. Just don't want it to stutter after first video is launched.
What are the benefits for streaming vs. loading video? In this project, there is never a need to scrub, replay, pause or stop the video. I don't even want that to be an option.
Actually, umenu object is just a way to store elements in a list. You could do the same using coll object. So, the problem is not the url by itself. In FTP, you have to provide a username and a password, so you must look how to use it; maybe, but I'm not sure, something like that would do the trick ?
If you open the jit.qt.movie reference, for the read message, it is said
Reads a movie from a disk file, URL or the clipboard. If no argument is present, or if the symbol dialog is used for the src-name argument, a File dialog box will be presented to choose a file. If the argument scrap is used for the src-name argument, the object will attempt to load a movie from the clipboard. If the argument is parsable as an http://, ftp:///, file://, or rtsp:// URL, the object will attempt to load a movie from that location. Otherwise, an argument is assumed to be a local file name.
If autostart is enabled, the movie will begin playing at once.
So, I suppose it is possible. I never played a video from a server before, but maybe a quick search on the forum will help you ?