Movie playlist with XML

Danny_J's picture

First i have to say you guys are a big help and have answered everything i throw out here...

On that note, I'm working with a XML file that is a playlist playing about 13 .mov's. I've got my structure down so the movie is playing and displaying. However i feel like my setup for them to cycle the playlist is flaky and unstable. So does anyone have a method that will play movie "B" once movie "A" has finished and of course keep going to the last movie then repeat all over again. Challenge here is that all the movies very in duration so not all of them will be on screen for "x" seconds.

I also have another setup where the movie has a reflection. So both the movie and reflection have there own XML setup and there own sprite. Though they are both looking at the same exact XML file, just have there own patches and what not. My problem with this is that the reflection repeats the first movie. I didn't change anything, i pretty much did a copy and paste. I just flipped it and added a gradient. So i have no clue why it repeats a movie. Sometimes its not even the first movie. It'll play in sync for the first 3 movies then the reflection would repeat the 3rd movie while the normal view plays the 4th movie. Other times it'll fall behind just a few seconds. Which is better then repeating the whole movie i suppose, but still an issue!!

steve holmes's picture
Re: Movie playlist with XML

I have had this running fairly effectively. What you need to do is feed the movie duration and the movie position into a condition patch this then feeds a counter patch which moves the structure index up. The counter is reset by the structure count feed into a conditional patch so as the movies count up through a director structure when it equals the structure count it is reset.

I will try and dig out an example file sometime this week.

As for the reflection is the easiest way not to feed the reflection from the movie loader patch. So the movie loader feeds the main image and the reflection.

I hope this makes sense, it should do once a find and example file. Steve

gtoledo3's picture
Re: Movie playlist with XML

"The counter is reset by the structure count feed into a conditional patch so as the movies count up through a director structure when it equals the structure count it is reset."

Ah, but if you do that does it go into debug when it resets back to 0? (Anyone sensing that I was working on file directory scanner/loader methods all throughout last week and have a secret super duper setup for this situation right about now?) It seems like when a counter resets, and it's hooked up to a structure index, there can be a brief moment where no number is put out, so whatever renderer is attached doesn't get fed anything, so it goes into debug. At least in my crazy QC world.

It took me a good amount of time to get going as well as I have, rock solid, no debug mode, and I have a number of things that are using it... so I'm not putting it out there for free, at least not for a bit. If Steve gets one up here, that will be cool, but I can't bear to do it.

My advise is keep chipping away, step away from the computer for a bit!? Breakdown exactly what each step of the chain is doing..."visualize" :o) You should be able to at least get it working solid in debug, with no really bad visual side effects entailed from that.

Danny_J's picture
Re: Movie playlist with XML

Thanks guys! unfortunetly i won't be at my office till friday. So i won't be able to test any of this yet. I'm stuck taking Illustrator CS4 class today and tomorrow. Which is a real big bummer cuz quartz keeps knocking on the brain!! I'm trying to imagine how it would work and i feel like i understand without seeing it.

steve holmes's picture
Re: Movie playlist with XML

Have a look at this and see if it does what you need, I have now moved to using vade's movie plugin as it seems to work better, but the principal is there.

Also I don't seem to get any glitching when the structure jumps back to 0.

Have to say feels really nice to give the odd answer here even if it might not be the most efficient, nice to be giving something back.

Steve

PreviewAttachmentSize
playlist from folder.qtz4.3 KB

gtoledo3's picture
Re: Movie playlist with XML

No kidding! Hmm. I see now that the fact that the movie loader has the asynch keeps everything "firing" correctly, I believe. (My case example was for loading different types of files, and also used directory scanner blocking). Time to investigate a bit...

Danny_J's picture
Re: Movie playlist with XML

Thanks for that file Steve. It helped and made my comp look cleaner and less clutter. Still have a couple of bugs though, they happen randomly too. For instance sometimes the movie ends early (like 19.5 instead of 20) which i thought i would adjust the tolerance on the conditional patch. But when i make it 0, with the intention that it should be a exact equal (position=20, duration=20). It doesn't send a signal to the counter to make it change to the next movie. Other times i'll have the tolerance be 0.1 and the next movie to load would already be half way done playing (no exaggeration) a 40 second clip and it'll start at 20 or 23. Sometimes it is nice and it'll play perfectly. Sometimes on the 2nd or 3rd cycle, the same movie that started at 23 secs out of 40 might be at 10secs out of 40. Any suggestions? Would using a external time on the movie loader be more accurate?

gtoledo3's picture
Re: Movie playlist with XML

See if this helps out any... I guess I had enough coffee today.

Yes, this DOES have tolerance. It's one of those weird things... when you use these conditional setups and you have things going very quickly (like movie play position) you usually have to put in some tolerance, because the output port of the movie player may not actually "deliver" the exact value that you need to trigger the conditional.

However, I've experience no problems with things getting out of sync with this setup, and have used variations on it extensively.

If you use it commercially, a nod/credit please. For some things I just don't care so much, but I put in a crapload of time on this one.

PreviewAttachmentSize
movie player macro with autoplaylist GT.qtz7.94 KB

tobyspark's picture
Re: Movie playlist with XML

if it doesn't do already, vade's open-source video player patch should be made to give a signal on movie end. this would be the best way of handling it, and its one proverbial line of code in the plug-in. i could do that if need be, just not this weekend. also conditionals based on time like that are scary, at least use mathexp with a greater than.

Danny_J's picture
Re: Movie playlist with XML

I don't know maybe its my workstation. But when i was watching your conditional which had the movies position and duration going. It would start the next movie either a few seconds ahead of 0. Or the position would still keep going from the last movie and not reset until it has meet the current movies duration.

gtoledo3's picture
Re: Movie playlist with XML

My testing has shown that using math expression or javascript vs. conditional is effectively the same for this setup. I believe that if you go that route, it's better to set it up with javascript, and you still get the aforementioned side effect of having to build tolerance.

I don't know if agree, in a nutshell... I'll give some more thought to what you are saying though.

gtoledo3's picture
Re: Movie playlist with XML

Hmmm, are you hovering tooltips/nodes or something? That can make your compositions screw up occasionally, b/c of the way that QC environment is built and tied to the editor, but it wouldn't happen in the context of an app or in play mode. You may also note aberration if you go to fullscreen and back.

A better test would be to hook up the current time up to a string to image, and then to a sprite, and monitor like that.

Danny_J's picture
Re: Movie playlist with XML

I actually just used in the input parameter window to watch the numbers roll. Does anyone know where i can d/l vade's movie player beta v2. Its sounds amazing and wanted to see if it might help......NVM i found it.

Danny_J's picture
Re: Movie playlist with XML

So once again thank you guys for all the help. After using Vade's movie player v2 everything is working smoothly and perfectly. I was even able to add a reflection and it doesn't repeat any movies. Now i know i was using a XML loader but i decided to go with Kineme's own directory scanner. Couple that with vade's MP and Steve's useful instructions i was able to play all 14 movies in a row with various durations and a reflection. I'm sure everyone has seen a setup like this before. But if anyone is interested i can upload my qtz file on Monday. :-)

gtoledo3's picture
Re: Movie playlist with XML

Hmmm, curious about that, still can't get my qtz to mess up on my end... However, the other one (Steve's) doesn't work correctly for me.

Did you end up going with the string/replace setup?

gtoledo3's picture
Re: Movie playlist with XML

Also, how do you get it working with Vade's player, since it doesn't display a total duration time of a movie... seems unlikely? I will be interested to see that!

Danny_J's picture
Re: Movie playlist with XML

Sure. I'll try to recreate the file tonight/tomorrow. I'm not at work till monday but once i get back i'll post up. I suppose when someone d/l's my posted qtz they can just add there own directory path?

gtoledo3's picture
Re: Movie playlist with XML

Coolness... just trying to "grok" how this could be done without anything that outputs the total movie duration.

I'm also trying to figure out where/why mine would go awry on someone's system, b/c I've had a handful of people test it with no prob, and variations of said patch, using a variety of media.

To be clear about what I meant about tobyspark's comment about the math vs. conditional... something needs to deliver a true/false, so you end up having to write a javascript patch that takes the current position as an input, and the total duration as an input, does a calc, and then outputs a true or false... which is exactly what the conditional patch already does. I guess you could rig it with a straight ahead math patch to deliver a 0 or a 1 instead of a true or false, but I don't see the benefit. I'm certainly willing to take advice though if there is truly a more rock solid solution.... I'm always curious about other people's QC philosophy and Toby is extremely accomplished.

I don't think that javascript like that would "break" in a future OS, b/c it seems like that patch is fairly polished now... but it did break between Tiger and Leopard, so I defer to using the conditional patch. Maybe that's a bit silly it may need revision with Snow at some point anyway, given that I'm using the kineme directory blocking...

Danny_J's picture
Re: Movie playlist with XML

I guess its important to point out that i originally made the file on a standard 8-Core MacPro. Then made this recreated file on my friends standard MacBookPro. I'll let the file do most of the talking and i'm assuming that you'll only need to change the directory path on the Directory Scanner patch.

Notes I am using Kineme Directory Scanner (blocking) patch, Vade's Media Player v002

I hope it works on yours gtoledo3. When i get back to work i'll see if i can switch the movie loader patch to vades movie player on the file you provided earlier. I thought you had mention that you were using that on your workstation.

PreviewAttachmentSize
Xbox360 style w:Reflection.qtz9.21 KB

gtoledo3's picture
Re: Movie playlist with XML

This doesn't autoplay through all of the movies in the folder though... There's nothing to make it flip files, to my eyes at least, b/c the movie time indicator isn't hooked to anything. So it just sits on one movie file indefinitely.

FYI, for a totally different thing which doesn't progress to the next movie upon finish, but that allows you to "manually" trigger, you can just hook up a mouse to the movie counter, and use "clicking" to scroll through movies. I have attached an example.

Now, this is the weird thing, and it's part of why I use the "range" in my qtz...

Open up the qtz, click through... no "white" screen or lag when the "list" resets index. NOW, take away my range setup, and hook it up like you had it but keep the mouse as your trigger source... you get a flash of white when it flips from the last movie to the first.

With some setups, this makes the qtz go into debug at this very point. I believe that when a counter resets it gives null value for a split second that doesn't always "work" with an index input. The range effectively converts that null to a 0, which removes "white flash" or debug mode in situations where files are short and switch very quickly.

If you get this autoplaying w/ the v002 it would be a cool thing... as is though, def just sits on one file.

Danny_J's picture
Re: Movie playlist with XML

I haven't checked your file yet but will be very shortly. Just wanted to comment that unfortunately i don't have the luxury to have any control on when the next clip plays. My setup has to be more of an auto playlist. It's being deployed in different field locations to keep people entertained while waiting. So any kind of interaction controls are a no go for me....for now. Still wouldn't mind knowing for any future freelance jobs. I also just watched the same file i posted and every movie plays in the specified folder and it even loops. So weird...

gtoledo3's picture
Re: Movie playlist with XML

There isn't anything hooked up to the index that's "active" so it wouldn't_ever_change files. The increasing signal of your movie patch is hooked up to a conditional that has nothing feeding it. This wouldn't work under any_scenario.

eh.... don't know what's up on this one. Hope it works out, but qtz no workee.

Danny_J's picture
Re: Movie playlist with XML

So i took a screenshot of what i had. The conditional on the bottom, label "movie time indicator" has the values from the movie players position and duration. So when the condition is meet and they equal it sends the signal to the counter label "Movie Counter". which then sends its count to another conditional labeled "Reset". The "Resets" second value is from the structure count. So when that condition is meet it'll send a signal to the reset input on the "Movie Counter" patch. At the same time that counter output is also going to the index of the structure index patch labeled "Movie Clip". And i swear i'm not crazy and seeing things. It actually works for me lol, two times

PreviewAttachmentSize
Picture 1.png
Picture 1.png357.2 KB

gtoledo3's picture
Re: Movie playlist with XML

No you're NOT crazy, I am out of touch.

I guess there is a new build of the v002 movie player! Mine doesn't have movie duration and position outputs :o) Yeah, that looks like it would work like a charm, and is the same kind of signal flow theory I'm using with the standard movie patch. (Steve's is the same basic thing as well).

I wonder what it is about Vade's that is making it better? It looks like you are still having to add tolerance.

I'll have to check that out. All is well in QC land tonight.

gtoledo3's picture
Re: Movie playlist with XML

Yeah, this is how it opened up for me :o) Fun times.

PreviewAttachmentSize
editor.png
editor.png153.73 KB

Danny_J's picture
Re: Movie playlist with XML

I don't know what or how Vade did but it works like a charm. I was so excited that i did a little jigg at work. i'm using 0.1 tolerance, i thought about just messing around and trying different tolerance to see what happens. All is well indeed, sir! :-)

gtoledo3's picture
the bug Re: Movie playlist with XML

Yeah, and I'm checking out what you are saying about the start times... I'm able to replicate that, especially if I start hovering over the nodes. That is messed up.

The standard apple patch isn't always clearing it's value on the movie loader position, when it's fed a new string- it retains the old value... this actually came up with another apple patch recently in a different scenario, but it seems like the problem may be linked. I've hooked up sprites to movie position and movie duration and then hovered over, etc., to be able to monitor this more effectively.

So, basically, the standard patch doesn't reliably clear the movie position when you feed it a new movie.

I guess Vade's must. A setup like mine wouldn't work with the standard patch in asynch anyway, so it is nice that Vade has added the duration and position, so that these setups like this can be done... AND that his patch actually clears the position.

The orig macro that I've been using was based on loading audio via click, so this didn't come up.

lucy's picture
Re: the bug Re: Movie playlist with XML

so i'm trying to get this random folder playback of movies without the white flash when the counter resets. i built basically the same setup as steve's 'playlist from folder.qtz', before searching around on here and finding this thread. downloaded the other examples here to investigate, including gtoledos version with the range patch implemented but no joy :( any hints would be appreciated and save my head from hitting the wall too much more.. cheers.

lucy's picture
Re: the bug Re: Movie playlist with XML

ha - so after taking a break it occured to me if the bug was from the conditional patch i should just write a javascript patch that does the same thing but wont muck up the assignment of boolean/numbers or whatever was going on. seems to have done the trick. ps. Wish someone else had experienced the way the moment of truth climaxed perfectly with whatever is playing back in itunes right now.. it was edge of your seat stuff..;)

bernardo's picture
Re: the bug Re: Movie playlist with XML

mmm check the patch in here:

http://dl.dropbox.com/u/3545315/playlistPlayer.qtz

i solved it....