Just play a video efficient!

Brantiko's icon

Hi!

I have a video which is played on three beamers using a tripple head. I rendered a video which is 3840 × 720 in Dimensions. I just want to play it on a jit.window object and then put it into the right place that it is shown on the three beamers! What is the most efficient way to do that? Has someone an easy jit.GL example?

Thanks and advance!

Brantiko

yaniki's icon

Use [jit.movie] with @output_texture 1 and [jit.gl.videoplane]. On mac try switch off displaylink attribute.

Andro's icon

Plenty of examples, the most important thing is your hardware.
I use a matrox triplehead to go.
Render into one jit.window with the correct resolution. Press escape for fullscreen mode. (make sure your film go's to a jit.gl.videoplane @transform reset 2 )
Done.

yaniki's icon

And use @adapt 1 attribute for [jit.movie] ;-)

Brantiko's icon

What is the advantage of jit.gl.slab?

Brantiko

Andro's icon

It's normally used for video effects. Plus its on the gpu.
Check the examples folder for slab.

Brantiko's icon

I don't get it! A Video that can be played with VLC easily forces MAX to go down at ~5FPS. It is 30min long and 1,5GB big. The Format is 4096*768
The CODEC is H264. I am using a 15" Macbook-Retina machine.

Any Ideas? JPEG Motion Codec emerges huge files...

Andro's icon

Post a patch. It could be anything slowing it all down.

Brantiko's icon
Max Patch
Copy patch and select New From Clipboard in Max.

OK acutally I want to play TWO Videos but even ONE is making trouble:

abs11's icon

Hi Brantiko,

Loading a compressed 1,5GB into RAM (with loadram) needs an enormous amount of RAM.
It is not necessary, if you are playing your clips from a fast ssd.
In my experiance a single window containing the 2 videos has a much better than 2 windows and 2 jit.gl.renders.
(even if you use the shared attribute)

Hope this helps you,
abs

madjax's icon

You seem to have two renderers and two windows. This would certainly decrease performance, especially to the window that is not active. Why not render both videos with one renderer to one double or triple wide window? Make the jit.window that same resolution as the output raster of your TripleHead2Go (e.g. 3 x (1024x768) = 3072 x 768). Set the position of each jit.gl.videoplane so they line up on a different output of your TripleHead2Go. The only thing you seem to be doing with jit.gl.slab is converting a matrix to a texture. Are you using Max 7? You can do this directly from jit.qt.movie object....actually its now just called the jit.movie object. Set the attribute @output_texture 1. If you don't have Max 7 you can use a jit.gl.texture object to convert it.

Rob Ramirez's icon

as mentioned in the second reply, jit.movie @output_texture 1 is what you want.

Andro's icon

Like madjax said you only ever need one jit.gl.render and one jit.window object if your hardware is dividing the screen into multiple screens.
GPU is your friend here. Processing a video file of that size asks for very "efficient" max patching.
It might be an idea to go and do a few jitter tutorials to learn how to get the hang of the basics of Open gl.
Video is an incredibly complex thing to control as theres so many variables involved, and with your case it starts with source material + hard drive speed. SSD drives make a lot of these problems obsolete.
Convert your video to a few codecs (which is a science in itself) , 25 fps, 30 fps, different resolutions. Try them out.
Discover what your computer can handle before you push it to a limit. Then work within that.

so 2 videos. 1.5 gig of RAM each, thats 3 in total, how much RAM do you have ? 4 8 2 ?
You'll need at least 8 to do this as 3 + your OS will come close to 4 and leave you no overhead.
Processor ? i7 ? i5 ?
Operating system 32 or 64 bit ?
Like I said a lot of variables, these are things that true software developers hit every minute of the day.
You want to build heavy Max patches then get used to doing optimisation tests along every step of the way.

Don't compare VLC to max, its made to do one thing very well and its designed by people that really know their stuff.
Max patches are something you build yourself, if you make a mistake it won't work efficiently. And it seems you still have a lot to learn (like me and everyone else).
I wouldn't even be doing what I do with Max today if everyone on these forums wasn't so helpful, so when you get stuck accept its part of the process, break the problem down, and ask for help (nicely).
And start with a pasted patch, makes it way easier for people to help you with the little time they have.
Good luck with it all.

Brantiko's icon

Hi

Thanks for all your help!
I think I cannot use just one jit.window object. I need at least one for the Tripplehead output and another for the second disyplay which is a single beamer. What I learned so far is that it is not possible to stretch one jit.window over several displays. So I need two! The video itself consist of three single videos and its format is already shaped to the Tripplehead. This is not an issue.

To load the video into ram was just an approach to see if this makes things better. I have 16GB RAM. Still the same problem.

I know that Video stuff can be annoying in MAX. Thats the reason why I normally prefer other solutions, especially when it is for playing a video only. But in this case I want to use max because I need to detect black screens in the video to close shutters via DMX. (Which works very nice!)

jit.qt.movie @output_texture 1 means what? There is no hint in the reference and on max 6 it is not working at all.

Andro's icon

Textures all reside on the GPU (which is faster than CPU) so this means the movie is output as a texture file, this means you don't have to output it to a jit.gl.texture file which saves system resources.
Try splitting your movies and windows over two patches BUT only have one qmetro driving the jit.gl.render (not sure if jit.window can access a jit.gl.render from another patch ). Use send and receive objects to transmit the bangs.

Rob Ramirez's icon

the @output_texture attribute was introduced to jit.movie in max 7.
your best option on max 6 is the jit.gl.hap external (search to find the download link).

mark2e's icon

"What I learned so far is that it is not possible to stretch one jit.window over several displays. So I need two! The video itself consist of three single videos and its format is already shaped to the Tripplehead. This is not an issue."

Sure you can: System Preferences --> Mission Controll --> Change the setting at "Displays have separate Spaces".
Et voila one window stretched across multiple screens (just dont use the built in fullscreen $ message, but tell the window "manually" which position/size and border off).

gerardo.pellicer's icon

You can try the HAP codec with the hap object. It'r really efficient.