Announcing jit.BC.QTKit , OSX-only QTKit-based jit.qt.movie replacement

Oct 18, 2011 at 5:56am

Announcing jit.BC.QTKit , OSX-only QTKit-based jit.qt.movie replacement

jit.BC.QTKit is designed to render videos as smoothly as possible, as it renders from QTKit and copies it to an internal jit.gl.texture using FBO copy. It sends out bangs (like a metro) when new frames are available, which you could use to trigger a jit.gl.render (this isn’t always appropriate, but sometimes it helps!) It also sends bangs when a video ends, and several notifications on a successful video load.

This is a beta version, completed in just a few days, so I’d love to hear about your issues/suggestions/etc.
Infact, nobody besides me and my computer has tested this, so it may be 100% broken for you! Feedback would be great.
Special thanks to Anton Marini, Rob Ramirez, James George for helping make this possible!

to try it out, visit:
https://github.com/brianchasalow/jit.BC.QTKit
click downloads, click ‘download as zip’
The src is in development and may have stray comments that don’t make any sense/debug code/etc, but feel free to poke around.

copy jit.BC.QTKit.mxo to somewhere that Max will find it, and launch jit.BC.QTKit.maxhelp
email me at brian@chasalow.com for suggestions/issues/fixes/etc

TODO: Find a way to tell a jit.gl.texture to use the texture ID of a CVOpenGLTextureRef so i don’t have to do an FBO copy to the jit.gl.texture, if anyone has suggestions on how to do this

#59391
Oct 18, 2011 at 6:56am

Very exciting! Haven’t tried it out yet, but it sounds like a great option for OSX Jitter users.

#213654
Oct 18, 2011 at 7:09am

Yes! Thanks for sharing, Brian!

Nice to see you at the expo…

Btw, making the copy from FBO should be fine. We don’t have a way to simply build a texture from an existing texture ID, and neither does QT have the ability to render to an externally created texture ID. I don’t think the gpu copy will be much of an issue however.

-Joshua

#213655
Oct 18, 2011 at 9:31am

Hello Brian,

Thank you very much for this.
Since years we can not manage projects with max, where we have to play
HD videos at its normal rate without stuttering.

One thing, which attract my attention at the jit.BC.QTKit external is,
that it does not loop smooth.
I think i would be great to add a loop attribute.

Lee

#213656
Oct 18, 2011 at 9:55am

Great work!!
But I do have an issue with speed, if I change the speed it reverts back to normal speed when the clip starts over.

/mattias

#213657
Oct 18, 2011 at 12:42pm

Lee: I had removed loop mode because QTKit wasn’t triggering videoEnded notifications reliably if I had loop mode internally set to LOOP, something I needed for a particular installation. I will add it in later today.

Mattias: That is also something I added for a particular installation, but can make it more general purpose and remove that ‘feature’

JKC: good to meet you too! good to know about the FBO thing.

Thanks for the feedback!

#213658
Oct 18, 2011 at 1:48pm

Lee/Mattias: fixed those two issues, i think. try the latest commit and see the updated .maxhelp, and let me know if you have any more issues.

#213659
Oct 18, 2011 at 3:36pm

Thanks for this Brian, looks great!

#213660
Oct 22, 2011 at 6:04am

fixed a bug that was preventing multiple instances from loading simultaneously properly. was using a static global for something that should’ve been an instance variable. oops.

#213661
Nov 3, 2011 at 5:19pm

I committed a new version today that has UYVY matrix output with simultaneous texture output- It is slightly less efficient than just outputting a texture alone, but sometimes you want a pixel buffer too. In the future I will make the texture/jitter matrix/both as a selectable attribute.

I fixed some major bugs with regards to texture output (needed to be automatic 0 on the internal texture so that I wasn’t trying to bind a texture faster than it was writing to it), and feel pretty good about this version’s playback performance. Infact, I will be using it for a live performance in a week from now- the real test!

TODO:
1) Rename some of the methods to be more in-line with jit.qt.movie
2) Fix the getters/setters to be more ‘Max-like’
3) colormode as an attribute
4) Texture/Pixels/Both as attribute

#213662
Nov 4, 2011 at 11:56am

hello brian,

thank you for updating this great object !
it would be great, if you could add a smooth loop function to the TODO list.

it here is a smal hickup if you play the movie in a loop.

best,
lee

#213663
Nov 4, 2011 at 2:50pm

lee: i fixed that 2 weeks ago right after you mentioned it, i think? try downloading the new version and setting “loopstate 1″

#213664
Nov 4, 2011 at 3:31pm

hello brian,

i have downloaded he last version.
there is still a hickup with “loopstate 1″ , if the movie jumps from the end to
the begining.

you can check this easy, if you play the movie with the standard jit.qt.movie object. it stutters while playing, but the loop is smooth …

best,
lee

#213665
Nov 4, 2011 at 4:08pm

i don’t experience this. with loopstate 1, videoEnded presumably never gets triggered, and it is just looping internally using QTKit’s looping attribute.

‘loopstate 1′ basically sets this: [_movie setAttribute:[NSNumber numberWithBool:loops]
forKey:QTMovieLoopsAttribute];
and the movie just does its thing and loops without involvement from Max, so if there is any stuttering, I imagine it would be QTKit vs. GWorld based.

If you could create an example patch to compare the two objects it’d be much appreciated!
What kind of system are you on? i did notice when i was using an external audio interface that used CoreAudio I had issues with QTKit.

#213666
Nov 7, 2011 at 1:50pm

hello brian,

here is a smal example, which demonstrate the problem.
the red video stutter, if the bar inside the movie is in the middle position.
the other movie is played with the standard jit.qt.movie object.
my system is:
MAX 5.1.9
Mac OSX 10.6.8.
MacBookPro8,2
Intel Core i7
2,2 GHz

best,
lee

Attachments:
  1. looptest.zip
#213667
Nov 7, 2011 at 4:42pm

thank you for the example, Lee- I now see what you are referring to. I am not sure of the cause of the issue- but I again suspect it relates to internal QTKit vs. GWorld differences. I’m not sure if it persists with different codecs / resolutions. I will try a few things and see if i can improve it at all.

#213668
Nov 7, 2011 at 10:38pm

Hello Brian,

sounds very exciting…but I can’t get it to work:

I get this error in both Max5 and Max6 (MBpro OSX 10.5.8) when loading the external:


jit.BC.QTKit: unable to load object bundle executable
2011-11-07 23:30:05.723 MaxMSP[1749:20b] Error loading /Applications/Max5/Cycling '74/jitter-externals/jit.BC.QTKit.mxo/Contents/MacOS/jit.BC.QTKit: dlopen(/Applications/Max5/Cycling '74/jitter-externals/jit.BC.QTKit.mxo/Contents/MacOS/jit.BC.QTKit, 262)
: no suitable image found. Did find:
/Applications/Max5/Cycling '74/jitter-externals/jit.BC.QTKit.mxo/Contents/MacOS/jit.BC.QTKit: unknown required load command 0x80000022

Says something to anybody?

Tnx
Vinze

#213669
Nov 7, 2011 at 11:10pm

Vincent: it probably has some OSX 10.6-required dependencies.

#213670

You must be logged in to reply to this topic.