jit.gl.hap

jit.gl.hap provides native support for the Hap quicktime codec. Images are decoded and rendered directly to an OpenGL texture. Non-hap quicktime files are also supported. To play Hap optimized files, the quicktime codec must be installed, found here. For general information about Hap, see the Hap project.

Currently only supported on 32 bit Macs, OS 10.6 and later and 32 bit Windows. Requires Max 6 and later.

jit.gl_.hap-package.zip
zip
Anthony Palomba's icon

You are the man Rob! Thanks!

Ricardo's icon

Hello, are there any possibility that this can be made for Max 6.0.8 as well?

joshualeeginsburg's icon

hi Rob. thank you for this tool. its very exciting. however, it isnt working on my side at all. I have downloaded the necessary hap files to run the codec on my machine, installed them, and converted some files to HAP and HAP-Q using mpeg streamclip. However, when attempting to play in Max, it either it doesnt play the clip at all, or the fps meter is running but no image. Can you advise? (Macbook Pro 2.8GHz, Intel Core i7 + Max 6.1.3)

simon.ben@free.fr's icon

Same problem as Joshua. It worked (and still working on MacBookPro Retina OS 10.8.2 + Max 6.1.3), but not on brand new Macminis bought this week (it worked on some that I bought last May).
It's really urgent, can you help us?

Thanks.

Benoit.

Rob Ramirez's icon

hey guys, not sure what the issue could be.
would you mind posting this to the forum? it will be much easier for me to track and respond.

Arvid Tomayko's icon

This is awesome! Wish I had seen it out a few months ago before building a big VJ patch. The decrease in CPU usage as compared with playing 720p ProResLT movies is pretty incredible. I'm going to change my patch and video library over to Hap!

Any chance of having a mode where when rate is increased it only reads frames from disk that are needed to fulfill a certain frame rate (like 30 fps) an skips those in between - this would mean you could play movies at, say 8x without using 8x the disk bandwidth. I hacked together a way to do this using frame commands with a metro and a counter, but having it in the object would be cool. This would make it much more plausible to stream a pair of 720p Hap movies from a Firewire800 drive.

Rob Ramirez's icon

yeah, the best way to play with speed changes is to stop the movie, and control using the frame message. otherwise, quicktime takes over playback, and there's no way to prevent that from happening.

sounds like you came up with a good solution though.

Rob Ramirez's icon

jit.gl.hap has just been updated to fix the following issues:
- weird cropping in some instances when going fullscreen
- causing non-automatic objects to change their dimensions
- loopreport will now report when a file reaches the end even is looping is turned off

happy hap-ing!

Matt Romein's icon

Thanks Rob!

yaniki's icon

Thanks, cool!

ctrlzjones's icon

& with 'loadram' ...

great.

vichug's icon

Hey Rob, is the version through Package Downloader up-to-date ?

vichug's icon

so apparently Max Package DOwnloader directly grabs latest disstrib from Github repos, so teh answer should logically be yes :)

Nat's icon

Rob just updated the package-info.json file so you should see the update in max package downloader although since it pulls master you'll always be up to date if you press download.

yaniki's icon

Friends

This is probably stupid question... How to install HAP codec on Windows (or: where to download it?). Typically I'm using Rob's [jit.gl.hap] external on Mac, but I want to (oh, actually I don't want to, but I have to) move one of my projects into Win.

vichug's icon

Thanks Nat

(@Yaniki : it says "Currently only supported on 32 bit Macs, OS 10.6 and later" so... you have to do something else)

yaniki's icon

Thanks... this is something I thought...

Rob Ramirez's icon

hey guys, i'm excited to announce that vidvox has just released the Hap codec on windows:
http://vdmx.vidvox.net/blog/hap-windows

i have updated the hap package to version 1.0.3. this includes a windows external that gives similar performance as the mac version.

additionally, the update fixes an issue with loading audio-only files, and allows for changing the name of the output-texture.

yaniki's icon

Yes, I know! This is a "news of the day" for me ;-)

yaniki's icon

After upgrade to Yosemite and Max 6.1.9 I’m experiencing very low performance, when I’m working with [jit.gl.hap]. I reinstalled hap codec and the [jit.gl.hap] (latest versions), but without any positive change.

I made some simple tests: first: I connected fpsgui to the [jit.gl.hap] and - and this is strange - the framerate is not falling, but if - for example - I'm using [jit.gl.videoplane] receiving video data from [jit.gl.hap] I see, the content of the [jit.gl.videoplane] is refreshed only once per few seconds. From the other hand: soundtrack attached to the video file is played without any drops - seems something is wrong when [jit.gl.hap] is decoding o transferring data into other objects?

I’m working on MacBook Pro 17inch (i7, 16GB RAM). On the same hardware configuration, but with Max 6.1.8 and Mavericks, hap was working perfectly.

Does anyone of you encountered this problem?

matteopennese's icon

Hi Yaniki,
Do you mean your video plays some seconds, freezes and then restarts and so on?

I'm using jit.gl.hap without any issue with Yosemite and Max 6.1.9 (MacBook Pro 15', 16GB RAM, Late 2013).

matteo

yaniki's icon

I experimented with the problem bit. The results are rather positive. Previously, I used hi-res video files (3840x1080px). It worked great under Mavericks, but not under Yosemite. But typical HD files (1920x1080px) coded with HAP are still played perfectly on my computer with [jit.gl.hap] - so (even if I experienced a drop in performance) for most applications [jit.gl.hap] is still the best and highly efficient solution.

jbl's icon

I'm on win7. I'm experiencing a similar issue as Yaniki.

I'm only getting started with jit.gl.hap so I'm not sure what causes the issue. I have a a 75 seconds long 1920x1080 hapQ file at 24fps. I want to play it in a loop. It runs fine a couple of times but then it stops. Pressing play again will resume the playback where it should have been if it did not stop, play for about 2 seconds then stops again. Of course there is no issue with the jit.gl.render since it's still rendering the videoplane at 60fps without any problems.

I will test with a smaller file but in theory my computer should run it. The same HapQ file runs well in TouchDesigner.

yaniki's icon

Strange. Seems it's rather connected to Max, not to OS.

jbl's icon

Yeah I think it's tied to the object or Max. Definitely not the OS. I use HapQ just fine in other contexts.

Edit:

I tested with the same file but encoded with the Hap codec. So it's about half the bit rate. I get the same issue. But I also noticed when I get the issue:

Suppose a new jit.gl.hap object that wasn't used before. I read a file and send a play message to it. Doing this I get no issue. But as soon as I send other messages while the video is playing, then it will play for roughly 2 seconds and stop until I press play again, where it will play for another 2 seconds.

Tiny Orbit's icon

Great work !

Curious to know, if non-Hap codec files are loaded in, are they then automatically re-encoded into the correct codec format ? If so I am guessing the benefit of encoding all my files to Hap first is to save some CPU that would need to take place during the encoding process.

django's icon

I have the same problem that jit.gl.hap stops playing, when sending another message to it after "start". When I send "start" again it plays roughly for 2 secs and then stops again. This only happens on Windows on OSX Mavericks it runs fine. Is there any solution or workaround to this? Is it ok performance wise to send "start" every frame?

jbl's icon

Oh. I did not know it was on windows only. I had the issue and the way around it is quite simple. add @autostart 0 (or is it autoplay?) so the object doesn't use its internal playback system. Then just create an external player using a counter object banged by a metro object. That way, everything is handled with basic max object and you can do anything you want. It's much cleaner.

django's icon

Thanks JBL, I figured it out myself and am happily running 8 HD videos with 60fps now :) The only limit at the moment is that it only uses 1 thread. I get maxed out at 12% load with an i7. But I guess for that there is no simple solution...

Arvid Tomayko's icon

@Django - i was having a similar problem with videos only playing for 2 seconds then stopping on OS X 10.9 and Max 7. It only happened when I loaded the videos with Overdrive on. I found that if I always load the video file into jit.gl.hap in the main thread (not the scheduler) by using eg deferlow, it worked fine even when overdrive was on. It didn't matter what thread the video was banged or started/stopped in, just what thread it was initially loaded in.

yaniki's icon

HAP codec is now available under AVF: http://vdmx.vidvox.net/blog/hap-in-64-bit-avfoundation

Maybe this is a time for 64bit [jit.gl.hap]? Or [jit.movie] is good enough now?

Stephane Morisse's icon

@Yaniki : does that mean you can only use this version with max 64-bits ? or does it work with the 32-bits version ? I already have the problem i described on the forum in the thread entitled 'media problem with jit.gl.hap' o I don't want to screw up things more and uninstall a wrong version of the codec without more informations.

yaniki's icon

[jit.gl.hap] is 32bit only ;-) (you have to run Max in 32bit mode). The codec is now both 32/64bit - so, theoretically there is a change for 64bit version of [jit.gl.hap] in future.

Of course "hap mode" for build-in Max [jit.movie] will be even better...

Stephane Morisse's icon

@Yaniki
Of course "hap mode" for build-in Max [jit.movie] will be even better…

I also hope this will happen in the near future as I'm now stuck with the current version.

phiol's icon

+1 on th gl.hap in 64 bit request :-) !
HAP codec is now available under AVF: http://vdmx.vidvox.net/blog/hap-in-64-bit-avfoundation
Maybe this is a time for 64bit [jit.gl.hap]? Or [jit.movie] is good enough now?

alfonso santimone's icon

could we poor win64 users get a little hope to see some video in Max7? ;-)

alain's icon

One thing that I like with jit.movie and that I don't find with jit.gl.hap is the 'clear' message.
But I'm a beginner, so maybe there's a known workaround...

JMC's icon

@ALFONSO SANTIMONE

I've seen that the hap codec is now available for DirectShow for Windows in 32 bits and 64 bits.
http://www.renderheads.com/portfolio/HapDirectShow/

I've install it, but it doesn't seems to work with jit.movie, perhaps because output_texture is not supported on windows 64bits.

Maybe there is some stuff to do for Cycing'74 to make it work, but I think it (and I hope) it could work, as it work within Unity3D 64bits.

Jean-Michel

marieke's icon

hi Rob
First of all thank you for this !
Quick question:
Is a compatible hap version for Max 7 in the works?

phiol's icon

Hi MarieKe

jit.gl.hap is compatible with Max7 in 32bit mode. you meant 64 bit right?

marieke's icon

yes sorry i mean 64 bit

mr.l's icon

Hi,

coming back to ALAINs question: "One thing that I like with jit.movie and that I don’t find with jit.gl.hap is the ‘clear’ message" - I asked something similar quite some time ago.

I still don't know, how to "delete" the hap-content.
I mix several hap-objects and send them to a cornerpin or videoplane object. Even if I dispose one hap-object and meanwhile have another hap-object running content, I see the last frame of the first one, when I load a new file into it.
Really annoying. What is the way to really clear it?

thanks!

Rob Ramirez's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Tiny Orbit's icon

Hello,

Thanks very much for the Hap port, its been a game changer for me ! ! !

One issue i am having is that when i switch videos between Hap encoded files and Mov files(like the stock media video clips) i get a frozen blue screen. In order to get it working again i need delete the hap object and load the video again. Both formats seem to play independently, i just cant quickly switch videos if the format differs.

Any advice on how i can resolve this ???

once thanks for all your great work !

Tiny Orbit's icon

UPDATE :

The issue only seems to occur when playing back with Hap Q encoded content. What i notice is that when i swap from a Hap Q encoded file to say .mov file the screen freezes blue BUT you can hear the audio of the new file playing in the background.

My work around is to do then delete the hap object and reload the video Hap Q content. Anybody know of a command to hard reset a module, so i can do it programmaticly when swapping video files ?

Tiny Orbit's icon

UPDATE 2 :

I think the issue resides with jit.gl.hap supporting mp4 files. I have found that if i load two different mp4 files quickly the whole system crashes. I found that any two different mp4 files loaded within a 500 ms window can cause a crash. I tried also using the dispose message between loading to see if that helped, but found that again this could cause crashes.

Shame i cant use jit.gl.hap for both Mp4 & Hap files, but it seems very stable with Hap encoded files!

Anybody else experience such issues ?

Dalmazzo's icon

Hello
I have an issue with this object. First when i read a video it works well, but when I click ones "start" it start to jump and stop. The way to fix it is to send start with metro bangs. Not really elegant the solution. And also playing many videos at the same time it also couse this jumping problem in some cases and then i need to add metros all around the jit.gl.hap
how to resolve this jumps? or dropframes?
Thanks

Dalmazzo's icon

Hello
Other question, how to know jit.gl.hap has ended the video, I just need a bang when is finished each video.

Dalmazzo's icon

Any help on this bug???

Dalmazzo's icon

Hello
I have a serious problem with an installation that has to run on many iterations. After 7 rounds it gives an memory capacity error on hap object, how to clean this memory each time it reads a video?
Thanks for the help
David

ctrlzjones's icon

doesn't the "dispose" message dust the movie loaded?

Rob Ramirez's icon

hey guys, just a heads up, i'm not planning any future updates to the jit.gl.hap object.

the object relies on the Quicktime framework, which is deprecated in Mac (and will possibly be removed in a future OS) and no longer safe to install on Windows.

we will be releasing a Hap player for both Mac and Windows that doesn't rely on Quicktime, in the very near future.

the jit.gl.hap external remains open source, so anyone is welcome to fork and continue the project if desired.

Rob Ramirez's icon

as mentioned above, see here for the modern way to play Hap files in Max:
https://cycling74.com/forums/announcing-hap-video-engine

Published

Creative Commons License

Author