TOOL (GPU xfade videoplayer)

phiol's icon

Hi all,
I would like to share a nice little tool with y'all.
It's a brand new Max7 poly~ videosampler with xfade capabilities.
Do to the fact that we can now name textures directly in [jit.movie] ,
making a poly~ jitter videoplayer was possible :-).
Each poly voice and texture name are automatically created and preloaded when you drop the folder :-)
I did this one quite a few months ago and thought it was time to share with you.
I find it practical for many types of projects
It even works well with 4k HD videos @60fps etc...
Runs well in Max 64 bit mode.
It's presently set for you to simply drop a folder filled with mp4 & .mov types files.

Hope you envoy.
Let me know if anything goes wrong

phiol

gpuplayer_xfade_tool.zip
zip
Rob Ramirez's icon

phiol, this is really beautiful. you probably know what i'm going to say... submit it to the Toolbox!

phiol's icon

Thanks so much Rob! Will do.

I do have one question before I do so. If you tried it with the default c74 media folder,
you'll notice even though all the jit.movie have @vol 0, for some weird reason , we can hear the
on initial load. Then all is okay. Can't figure out why ?

thanks for the nice comment

phiol

Andro's icon

Hi Phiol,

That is super slick. Plus super sick. Nice work !

phiol's icon

thanks a lot Andro .
Did this one back in April, should uploaded it sooner :-)

2K's icon

thanks for sharing this mon ami, it works really smoothly. I can confirm the bug with the c74 media folder, same behaviour you mentioned. Works perfecto with other media folders I have anyway.

Rob Ramirez's icon

i can confirm the audio problems. i'll see if anything's to be done.

pry's icon

Thanks for sharing Phiol,

Indeed it's a very usefull patch.
Here is an alternative without jit.gl.node (only main patch is modified).

regards,

Pry

gpuplayer_xfade_tool-modyrp.zip
zip
phiol's icon

oooh very nice! I didn't you could do that ! :-)
I didn't know you could simply add a [prepend jit_gl_texture] with the texture name.
So if I get this correctly, your [jit.gl.pix @gen xfade] will act like a jit.gl.videoplane and know what to draw ,
simply by sending it a jit_gl_texture texname_bla

very good to know

thanks pry :-)

phiol

phiol's icon

Also, another good tweak will be to make it , param-tweakable-friendly.
-stuff like play / stop / pos $1 / and a little bit more work but , sound sync'ed drivin by groove~ to pos $1.
Enable surround sound and panning capabilities etc... etc..

Max Patch
Copy patch and select New From Clipboard in Max.

something like this patch below I recently did to help someone out in this thread
https://cycling74.com/forums/video-and-audio/

TConnors's icon

I recently implemented the GPU xfade videoplayer into an audiovisual installation that played at a number of conferences in Australia. It worked great for the most part. I have a folder of 40 high definition videos, each a gig or more in size, randomly triggered every 60 seconds. I did try playing with randomizing the length of fade as well as the length of time before each video was triggered. The patch got quite cranky with these alterations so I settled on fix trigger times as well as a fix fade time. I would, however, like to press forward and see if these elements could be implemented. Also would like to configure the patch so it remembers the folder instead of having to drop it in everytime.

daddymax's icon

Thanks Phiol - this looks brilliant.

phiol's icon

@tconnors :
replacing the dropfolder should be very , very easy, just replace that part with a thispatcher and path message on startup :-)
maybe you'll need a [combine path contentfoldername ] combine will output this with no spaces and as a symbol.
In this setup , just make sure you contentfoldername is @ the same level as you patch in the path.

As for the random xfade time

phiol

TConnors's icon

I’d be interested as well to configure a series of these players into one patch.
Has anyone given that a go?

phiol's icon

I'm not sure what you mean by this.
Isn't this a single patch ?

phiol

TConnors's icon

Multi-screens in one patch. If one were to build say a nine screen installation randomly accessing 90 videos a robust method is needed not to bog the system down. I though if I renamed the polyjitter.maxpat and had a serious of these that it might be a good method.

Polyjitter.png
png
phiol's icon

so it works correct ?

if you have 9 physical screens , make sure to create a single context that you stretch through out your nine screens .
check out my reply here

TConnors's icon

Unfortunatly, it does not work—yet!

There is embedded coding that crosses over commands from one poly to another. For example if I change the video in the first poly, videos in the second poly stop. They are not operating independently of one another.

Thanks for the other link. I will have a look

Best,
Teresa

TConnors's icon

I should clarify that all nine jit.gl.videoplanes are rendered on a single jit.world—and using one projector.

phiol's icon

here is V2 with multiple xfader players.

In the attachment, I included the new polys and put everything you have to change when doing a new instance
of the xfade player module. If I ever have time (I have a nine month old baby) ,
I'll quickly turn it into an abstraction or bpatcher like you requested, but in the mean time everything is there for you to make
9 instances.
I tested it with 2 and 4k videos and I get a solid 60fps. If you have tons of videos, I would suggest you stay @ 1080p maximum or even 720p.
Also, make sure you 're running in 64 bit mode of you'll only get 2 gigs of ram space for your videos.

anyways hope this helps.

gpuplayer_xfadeV2_multiple.zip
zip
phiol's icon

Actually, here is a slightly better version where the patch doesn't use jit.gl.node and thus extra gl.videoplanes.

phiol

gpuplayer_xfadeV2.1multiple.zip
zip
TConnors's icon

Thanks for that Phiol! I greatly appreciate it! Just comparing the patches to see what you adjusted. Yes I see. That would have taken me awile to work out. So thanks again! Have fun with the nine month old!

phiol's icon

thanks a lot , he said his first word today , which was Batman ! ha !

But on the topic, will try to get to it (make a packaged abstraction type version ) , because I think it's a good idea.
I will also add the thispatcher path

I hope sooner than later.

TConnors's icon

Batman. That's cute!

And yes, your patch solves a lot of issues with multi-video installation works. I've been negotiating this topic for awhile in my creative practice and found Pry and your patch to have the most potential. I second Rob's comment above—it's beautiful coding! Best Teresa

TConnors's icon

It's almost working. I have nine screens going and for the most part all good. There is a weird thing happening, however, inside two
poly~ polyjitter. It seems there is a misfire for sending the texture_name to the jit.movie. In the poly~polyjitter that are working the texture_name attribute indicates so with the corresponding name. In the two that are not working reads as you can see in the photo.

If you are interested to see what is happening I could email the folder as it's too big for this site.

The texture_name should read texH11.

Screen-Shot-2016-08-17-at-11.19.23-AM.png
png
drorfeiler's icon

Hi looks great. Please let me check it. Mail to dror.feiler@gmail.com

Thanks

Dror

phiol's icon

Hi Tconnors, I would not have time in the next few days, but maybe try with a deferlow before the sprintf.
Or after. This is just a guess though.

phiol

TConnors's icon

@ Phiol — derferlow worked before sprintf.

Thanks
Teresa

phiol's icon

educated guess ;-)

phiol

Olle Alm's icon

Hi! My first post here :)

Great patch, just wondering if there is an easy way to make the videos start from the beginning each time?
Added a frame message to the jit.movie but that made the video start over both before and after the fade.

Best,
Olle

phiol's icon

Thanks for the comment.

Try [pos $1] , but that will still start the video @ the same time as the xfade, meaning by the time you see the video you will not be @ the beginning of your video. which is normal , otherwise you would see your video as a still image as you xfade.

maybe this is obvious and I am misunderstanding your question

phiol

TConnors's icon

Hi Olle,

Not sure if this is what you are after, but I added a bang and the message time 0 out of the p xfadeA to have the video start from the beginning with each new video.

Bang.png
png
Olle Alm's icon

Great!

Had a go with the [pos $1] witch works fine for resetting but didn't know where to put it to get the reset automatically.
Your solution works perfect with both pos $1 and time 0. And now I understand the patch a bit better as well :)

Thanks both of you!