Announcing Hap Video Engine

    Oct 21 2016 | 8:06 pm
    Hey folks, I’m happy to officially announce the new hap video engine package available with Max 7.3.1 via the Package Manager. Those of you with experience using the external already know the significant performance gains achievable when playing back HD and UHD files encoded with Vidvox’s excellent Hap codec.
    The hap video engine brings optimized Hap playback functionality to both Mac and Windows 32 and 64 bit platforms. The deprecated Quicktime library is no longer required. And since the hap package is installed as a video engine, seamless integration with is now possible. After installing the hap package from the Package Manager, you simply create a @engine hap @output_texture 1 and you’re off.
    There are some caveats and limitations: - jit.playlist not supported - output_texture 1 only, no matrix output - Mac: requires 10.10+ - Windows: no reverse playback
    Windows users must also convert their Hap files to AVI file format, the MOV file format is not supported on Windows. In order to encode Hap AVI files, you must install the DirectShow codec found here: After that you can use something like Adobe Media Encoder to create your Hap AVI files.
    Mac users can convert using the AVF Batch Converter app found here:

    • Oct 22 2016 | 3:43 am
      hi Rob,
      Thanks for this hap engine ! just 2 questions : 1 - it work fine with, what about (audio in MSP) ? 2 - is it better to use local @engine hap or to change it in the Max preferences ?
      thanks again fxw
    • Oct 22 2016 | 7:47 pm
      hi francois
      1 - is backed by the viddll engine, so it supports Hap playback, but through ffmpeg rather than through the native OS libraries of this hap engine. there are some improvements to Hap playback in viddll in a forthcoming update, however the hap engine is the most optimized way to play Hap files on either OS.
      2 - there is absolutely no functional difference. whatever's most convenient for you.
    • Oct 22 2016 | 9:22 pm
      Thanks Rob, It is very clear.
    • Oct 24 2016 | 1:19 pm
      This sounds great, but I'm still on 10.9, and probably not updating that until I get a new machine. I don't suppose there's any chance this could (ever) be backwards compatible, is there? I know, it's probably an annoying question..
    • Oct 24 2016 | 4:44 pm
      nope, sorry. requires OS features only available in 10.10+
      there will be some improvements to hap playback in viddll in a forthcoming update, but not as impressive as the native library versions in the hap engine. on 32 bit is still the best solution for
    • Oct 25 2016 | 12:26 pm
      Thanks for the reply Rob, and for the guidance as to the best solution until such time as I update..
    • Oct 27 2016 | 10:46 pm
      Amazing! Can't wait to test this, will make for a fantastic improvement to my jitter patches.
    • Oct 30 2016 | 4:55 pm
      Woow... this is great !!! ^^ I assume it's only for playing HAP videos but we never know; is this engine can be used to record HAP videos ?
    • Nov 02 2016 | 4:33 pm
      you can record Hap files on the Mac with [ jit.record @engine viddll @codec hap ]
      i wouldn't recommend it for realtime recording though.
    • Nov 04 2016 | 5:05 pm
      Hi Rob,
      Thank you for your answer !
      Your non recommendation of realtime recording on mac, is it for the codec hap or for the engine ?
    • Nov 06 2016 | 1:59 am
      Hi Rob,
      Thanks for the update !
      I am still on Max 6 but tested it in demo mode with Max 7. Noticed a few things that i would like to mention but all in all, seems like a great update !
      1) Now that we are using .AVI files i have noticed that when openinga new file the loading times can be a bit on the high side. When using .MOV files (even for HapQ encoded files) with the engine the load times felt almost instantaneous (sub 30ms) which was great for realtime video sampling. However with .AVI encoded files there is a larger load lag (varies on the file type and size but around 100-200ms). The same is also true for when using .AVI files with the engine.
      Is this something that can be improved or is this just inherent with the way .AVI files work ? I am guessing supporting .MOV is not so desirable these days but the loads speeds imo is a real game changer when it comes to real time video sampling.
      2) Setting volume to 0 (or any value for that matter) doesnt seem to work yet.
      i will keep on debugging and testing !
      all the best and thanks for all your hard work rob !
    • Nov 07 2016 | 4:19 pm
      i can look at supporting asyncread behavior for the windows hap engine in a future update, but load times are what they are.
      windows hap doesn't currently support playback of audio tracks. are you saying you have a file that has an audio track that you're playing with @engine hap and you're hearing the audio track play through the system?
    • Nov 07 2016 | 4:57 pm
      "i can look at supporting asyncread behavior for the windows hap engine in a future update, but load times are what they are"
      In regards to load times, are the longer load times of .AVI files over .MOV files just an inherent aspect of .AVI files or is this something that could be optimized within the engine ?
      "windows hap doesn’t currently support playback of audio tracks. are you saying you have a file that has an audio track that you’re playing with @engine hap and you’re hearing the audio track play through the system?"
      Yes, I am on win10 and when i load up a hap video file the audio just plays without the possibility of being able to adjust the volume. As i am using my own frame counter to play through the video i can just press stop on load which usually shuts it up.
      cheers rob !
    • Nov 07 2016 | 5:24 pm
      no idea about load times. hap on windows uses the system direct show libraries, so there's little control i have over those things.
      i'll take a look at the audio file playback on win 10.
    • Nov 08 2016 | 4:38 pm
      Ok thanks for your help !
      I will revert back to the object so i can take advantage of the higher loading speeds !
      cheers :)
    • Nov 10 2016 | 7:56 pm
      Hey Rob, Thanks so much for the package. My HD video playback is amazing smooth now!
      On question; For a little generative patch I'd like to randomly jump to different framepositions of a playing object. Pretty straightforward I thought. But unfortunately there's a noticeable "delay / gap" between each jump. (Not much, but it's still annoying).
      Now I'd like to try to have two video instances simultaneously running at the same time and crossfade between both instances to create smooth but fast "jumps" through the video. I guess switching one videos from for- to background and vice versa could do the job.
      Since it doesn't dump out a matrix I can't use the jit.xfade object. Do you have any idea how I could achieve this?
      Thanks again. Best, C.
    • Nov 11 2016 | 10:09 am
      EDIT: Found a solution. " @gen xfade" is doing the job!
      best, c.
    • Nov 13 2016 | 11:11 am
      Hi Rob,
      thanks again for this neat hap implementation. Did a good job.
      I've got one question Right now I'm switching between 4 full hd simultaniously. (All of them run at the same time). It works fine on my Macbook Pro Mid 2012 on a NVIDIA GeForce GT 650M 512 MB.
      Now I'd like to migrate my installation patch on my older Macbook Pro late 2008 NVIDIA GeFore 9600M GT 256 MB. It seems that this guy is only capable of playing one " @enginge hap" instance at the same time. Do you have an idea from what issue this limitation is caused?
      Thanks and best, Christian
    • Nov 13 2016 | 12:29 pm
      EDIT: I assume playing two 1080p instances simultaneously wouldn't work with the internal graphic card on a mac mini, as well. Am I right? Otherwise I would've bought a used mid-2012 mac mini machine..
      best, c.
    • Nov 15 2016 | 5:19 pm
      hi chrislos, i can't really answer any of these questions for you. you just have to try it and see. if you have a patch that you'd like some help with possible optimizations suggestions, feel free to post.
      it's possible the problem is with disk r/w speed rather than GPU, but that's just a guess.
    • Nov 15 2016 | 7:38 pm
      hey guys, I just pushed hap version 1.0.3 to the Package Manager which fixes the vol attribute on windows. windows hap avi files should now play files with audio tracks and behave appropriately when the vol attribute is adjusted.
    • Nov 20 2016 | 6:05 pm
      Sorry if this is a newb question, as i'm just exploring openGL and hap. I have a patch that mixes 4 videos using I want to add basic effects like jit.brcosa for each video separately. But I can't connect it anywhere in the chain, probably because jit.brcosa is not openGL. Any thoughts?
    • Nov 21 2016 | 5:02 pm
      type [ @gen brcosa ] into an object box.
      this tells the object to load the brcosa gen patcher, which is a factory gen patcher that performs brcosa operations and exposes corresponding attributes for adjustments.
      read through the Video and Graphics tutorials for more info.
    • Jan 17 2017 | 4:38 pm
      Do anybody know any other software than Adobe Media Encoder to create Hap AVI files on Windows?
    • Mar 14 2017 | 7:19 pm
      Hi Rob,
      Last semester I created a really successful audio driven visual patch which I used in live performance. I encoded all my videos to hap_alpha which really helped the performance. I'm doing something similar this semester but am not working with videos with audio. I have noticed that when I compress to hap using VVBatchExporter the audio suffers even when I change the settings to no compression for audio. I really want to use the hap engine but not if audio isn't supported.
    • Mar 20 2017 | 4:07 pm
      Hi Rob, guys, any chance for jit.playlist at some point? I can basically also continue to use some with an abstraction layer loading things dynamically, but that would be nice to have that support in jit.playlist.
    • Mar 20 2017 | 6:48 pm
      [edit - remembered this isn't working ]
      there's no way to generate the thumbnail images needed for jit.playlist interface, so this probably won't be supported anytime soon.
    • Mar 20 2017 | 6:55 pm
      Thanks Rob. Actually, I "just" need to figure out how to build a small based system for doing exactly the same things. Was just thinking about jit.playlist at the beginning.
    • Apr 09 2017 | 10:17 am
      Doesn't seem to work if you put it in a subpatcher.
    • Apr 10 2017 | 8:30 pm
      should work fine in a subpatcher. possibly just needs a patch restart, possibly needs you to explicitly set @drawto to your gl context name.
    • May 16 2017 | 9:37 am
      Any batch converter for windows ?
    • May 16 2017 | 5:05 pm
      i believe adobe media encoder will batch process
    • Jun 11 2017 | 6:39 pm
      Hey guys,
      sorry for the stupid question - how do I get the current frame dump out information in a number box instead of just a print popup? Or do I have to get a metro object counting the frames for me on the side? Thanks.
    • Jun 12 2017 | 4:10 pm
      for historical reasons, "frame" is a message rather than an attribute. to get the current frame simply use getposition and multiply that with the framecount:
    • Jun 12 2017 | 9:05 pm
      Thanks! I found also the way by "route framereport" which worked out well.
    • Aug 18 2017 | 4:44 am
      Getting this error: hap video engine not supported - using default viddll video engine
      the hap engine can't even be found in the preferences.
      Max 7.3.4 x64, Hap 1.0.4, Windows 10
    • Nov 17 2017 | 7:19 am
      Sorry guys, just a silly question: HAP on MAC optimizes the performance on both AMD and Nvidia cards? (I'd like to know that because my Macbook has AMD, while my hackintosh has Nvidia.) Thanks
    • Nov 17 2017 | 6:10 pm
      HAP performs fine on either GPU
    • Nov 17 2017 | 6:24 pm
      Thanks Rob!
    • Dec 06 2018 | 9:01 pm
      I was curious to know the proper way to use the frame $1 message to playback a movie with a counter. With the native Hap external, i was able to use my own custom counters for reading back a movie , however with this implementation i am not having so much luck, such method seems to grind Max to a halt when i approach a reasonable frame rate, meaning i need restart.
      Here is an example of what would work with the Hap object :
    • Dec 07 2018 | 4:34 pm
      get rid of the pwindow and replace it with a vizzie viewer module if on Max 8, or a preview shared context if on Max 7.