How would you route and sync the audio of video playback in Max 7 (avf)?

    Feb 05 2015 | 7:44 pm
    Hi, I used to use spigot~ to sync and route (to specific outputs) the audio of video playback in Max 6, but now I'm planning to do differently to benefit from avf engine (and 64 bit Jitter).
    My current basic idea is: 1. Set engine to qt and create an audio file separately by using spigot~ and locate it under "spigot-cache" folder 2. Set engine back to avf 3. Play the audio file with sfplay~ and sync by sending "gettime" message to and routing the 'time' data to sfplay~
    I appreciate your idea, Masa

    • Feb 05 2015 | 9:41 pm
      depending on the size of the movie file, i would use the import message to buffer~, and use groove~ to control playback, and sync using the groove~ sync-out with the new @position attribute.
      unfortunately, this only works in 32 bit mode. if you must use 64 bit mode, or if your movie files are too large to fit into memory, then i would simply export your movie audio to a separate audio track using quicktime or mpeg streamclip. the syncing can be done the same way, or you can sync using sfplay~ instead of buffer~ and groove~. in that case you need to tell sfplay~ to create a third outlet that outputs the current playback time. check out the "more features" tab of the sfplay~ help file for info. the playback time is in milliseconds, so simply divide by 1000.0 and send to the new @time_secs attribute.
    • Feb 07 2015 | 3:47 pm
      Thank you very much for the great example patch and the explanation. I can learn a lot from them! Thank you for the alternative idea for 64 bit mode as well. By the way, it's kind of a sub-topic and out of curiosity, but 'spigot_cache' message for spigot~ has been discontinued?
    • Aug 26 2015 | 2:54 pm
      After done some testing I expected much less impact to route the audio to another channel. Testing is done with Max 7.0.5, OSX 10.10.5, mbp retina 2014 Gefore GT 750M. H264 and ProRess are identical, res is 1080P. Frame rates were all good unless noted. H264 6% CPU sfplay~: H264 90% groove~: H264 30~40% ProRess 100% spigot~: H264 100% (10fps avg) ProRess 100% (60fps avg) (vade optimatizations): H264 40%
      In the end I want to play three 1080P files on a new top of the line yet to buy Mac Mini with each file having a headphone for itself. I was very positive after building the first part with only Now I'm not so sure if the Mac Mini is capable of doing the groove~ option. Any ideas on this?
    • Aug 26 2015 | 4:12 pm
      3 simultaneous 1080p movies with synced audio tracks should be possible with a new-ish mac mini, as long as you have @output_texture enabled and keeping the default avf engine as the backend (which means no spigot~ functionality).
      if you only need playback, and won't require random time seeking, or backwards playback, you might be better off with h264, which will keep the file size down. if you need random seeking, then you should use prores or photo-jpeg.
    • Aug 26 2015 | 5:37 pm
      No random seeking is needed, just playback. I'll go with the buffer~/groove~ option. Will try to post here if I got some test results.Thanks!
      Any clue when more normal audio outputs from are coming?
    • Nov 21 2015 | 7:32 pm
      It seems that 3 simultaneous 1080p movies is the absolute maximum on my mac pro 2ghz intel core i7, with Intel Iris Pro 1536 MB.
      When inserting another (4th) audio synced video player, this one starts to freeze, while the other players stay fluid, when reading the frame rate all the four players are running on 24 fps. So what's the hidden clue here?
    • Nov 23 2015 | 5:13 pm
      you might have more luck with the external (32 bit only), and encoding your movies with the HAP encoder. search above to find the external in the toolbox, with links to the codec.
    • Nov 24 2015 | 6:48 am
      We ended up encoding the right channel output in the PhotoJPG encoded Quicktime movie after exporting from Final Cut Pro. You can set the channel in Quicktime Pro 7 by pressing cmd+j, select the audio track and the choose the right channel.
      We messed up this project mainly because we found out that the external audio card (Hercules DEEJAAY 4+6) has a delay compared to the HDMI output from the Mac Mini + TripleHead2Go. In the final version we exported the movie with an audio delay so it would be in sync again.
    • Nov 24 2015 | 10:12 pm
      @Rob Hap increases the performance significantly. It runs five instances of audio synced video at a 45FPS on my on my mac pro 2ghz intel core i7, with Intel Iris Pro 1536 MB.
      But since hap encoding produces pretty large files I'll need a proper external ssd for the amount of material I'm going to process. Do you think the LACIE RUGGED THUNDERBOLT SSD 250 GB is fast enough for this?
    • Dec 03 2015 | 1:11 am
      The external ssd drive is definitely fast enough. My project runs like a charm. 5 screens on high definition simultaneously alternating different video's and different audio sources perfectly in sync. I think I can even scale the project up to a few more displays.