random video "chunk grabber" playback problems

Chris's icon

I know there is a constant problem with jittery video playback on Jitter and I hate to continue to swirl the waters, but I have not found anything specific on the forums that seem to be fixing this one, so I am guessing there is something I am missing...

I am working on a part of a patch that will be randomly playing “chunks” of video (300 frames per chunk) from videos randomly selected from a bank of 5 videos. The odd thing is that I have a patch that is playing 4 layered and effect laden videos with only minimal lag on this machine, but this simple one channel playback is lag and crash city. I started with h.264 and also am trying Apple pro res 422(LT) encoding for the videos but getting no love from this patch. Any suggestions on what I am missing?
Thank you for your help!

PS-the patch anticipates a bank of 5 videos in the root folder that are named 0-4.mov

Mac Pro 2 X 2.4 GHz 6-core Intel xeon
24 GB 1333 DDR3
ATI Radeon HD 5770 1024 MB

random-video-playback1.4.tester.maxpat
Max Patch
Chris's icon

taking the hint from vade I am trying to move to open GL...

this is my hack at that (a little out of my depth)

random-video-playback-tester-1.5.maxpat
Max Patch
mattyo's icon

From a quick glance, I'd suspect that your main problem is that you are loading the movie every time you want to play it. The best strategy is to preload all the movies (best in a poly~), and then access the chunks of the already open movies. Have a look at the Andrew Benson's invaluable vps demo patches to get the basic idea.

\M

Rob Ramirez's icon

search in the reference viewer for "Video and Graphics Tutorial 9: Building live video effects" to learn about the @output_texture attribute of jit.movie. things are much simpler now then when vade's tutorials were written.

Chris's icon

Thanks for the suggestions!
I will be digging deeper into these leads out today.
:)

took a quick look at poly~ and think it may be a boon for this project.
(mixing recorded video in realtime and as more people come to the event i take their video and add it to the mix)
but don't see that it works with video... does it?
it does seem to have a tremendous utility so I have not fully wrapped my head around it yet.

Chris's icon

https://cycling74.com/tutorials/the-video-processing-system-part-1
this is rocking my world!
But I don't know if I will have time to apply it to the patch I am working on right now (showtime is Friday)

Getting the "loadram is not available with AVF engine" message with the vps.mbank
though the videos still show up on the dropdown menu...

Rob, I found this comment from you on the forums about this issue:
"loadram is not supported with the AVF engine. for the answer why, direct the question towards your favorite apple engineer. in my experience, it is entirely unnecessary with the AVF engine. make sure you are using @output_texture 1 with a gl-context, and using a recommended codec (not h264 if you plan to utilize random seeking, rate changes, or reverse playback)."

does that mean I should just ignore it...?

I have found a new way of addressing the problem that is working, but I feel like it is pushing things a bit once I start throwing on the other videos and mixing things up.

using Apple ProRes 422 LT, 720x480 for the videos

need to learn more about moving processing to the GPU with this "slab" thing...

chunkplayer.maxpat
Max Patch
Rob Ramirez's icon

need to learn more about moving processing to the GPU with this "slab" thing…

search the reference browser for "Video and Graphics Tutorial 9: Building live video effects"

Chris's icon

Thanks Rob, I will check it out!
:)