Max7: AVF vs Quicktime = AVF wins, but no spigot functionality?

awepittance's icon

Hello, i'm finally getting in depth with Maxmsp and was really happy to see a new method of video playback in Max7. A patch i've been working on for a few years on and off never properly stayed on tempo before, it uses midi triggered video playback with processed sound coming out of spigot. The patch was always too choppy/off sync to count on for a live performance, but now when I switch to AVF the patch plays extremely smoothly. Still not perfectly but good enough to use for a live show. Anyways I'm wondering if there is a new way or a work around to use spigot or something else to pull audio from the video and process it in real time? The spigot object doesn't work with the AVF mode, at least as far as i can tell.
Any ideas?

system: Macbook pro
2.8 ghz i7
16gb 1600mhz ddr3 ram
ssd startup drive
OSX 10.8.4

Screen-Shot-2014-11-13-at-5.08.25-PM.png
png
Rob Ramirez's icon

export the audio track as a separate file, load with sfplay~ (or other buffer based player), and sync the jit.movie playback with the sync out of sfplay.

Ben Bracken's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I never use spigot~ and instead do what Rob suggests. Here is a version using groove~ I had laying around, but you could easily patch together an sfplay~ version as well:

awepittance's icon

thanks! i'll give that a try

awepittance's icon

i tried making a frankenstein patch with what Ben posted but every video I've tried to load gives me a 'buffer~ ___.mov can't open' error in the max window. tried a few different videos with different codecs, no luck

awepittance's icon

I totally missed the first part of the what the original poster said above. So without spigot~, there is no way in with jitter/maxmsp to use the audio attached to an existing video file? My idea is still workable this way, I'll just have to export audio from all my video files.

edit: I'm having trouble figuring out where to load the audio file that corresponds to the video file in this groove~ example patch

Rob Ramirez's icon

in ben's example patch, you don't actually need to separate the audio file from the video file. it instead uses the read notification from jit.movie to get the movie file properties, and properly format an "import" message to buffer~ to import the audio from the movie file. this works great if your audio file can fit in to memory.

awepittance's icon

hm ok, makes a little bit more sense now. What's strange is that I exported several of the movies to the exact same type as 'blading.mov' in the media folder. Photo JPEG with uncompressed audio, and the first time I loaded one of them instead of 'blading.move' in Ben's example patch it worked great, but every subsequent time i've tried to load any of my own videos it says "buffer~ cannot load" and lists the name of my movie file. Any ideas? Maybe it has something to do with a setting on the codec I can't see in the 'get info' tab on the mac finder. I guess i'm stumped on why it would work at first but even after restarting my computer none of my own videos work anymore. So what happens now is the 'blading.mov' sound track stays in the buffer, but my new video will actually play (just not my audio).

update: ok I was testing this patch out on Max 6.1 (stupid me), now testing it on Max7. Works on my video files now and plays back my audio. thanks guys! Now i just have to figure out how to incorporate this whole sync/feedback setup with my original patch which lets me skip to predetermined points in the video timeline with midi
is there a guideline or faq about which video codecs work in AVF?

Rob Ramirez's icon

the recommended codecs for AVF are H264, Photo-Jpeg, Prores 422, and Prores 4444

Federico Llach's icon

Hi,

I'm also very interested in getting this working but couldn't get the patch Ben posted above to work. I get the same error message as Awepittance:

buffer~: blading.mov: can't open

I opened Max 7 in 32 bit and it worked, but the goal of this thread is to be able to do it in 64 bit—which is what I also need!
My current Max version is 7.0.3, the latest available is 7.0.4.
I looked at the release notes for all 7 versions (0.1-0.4) and all four say "Import features for buffer~ are limited" under 64 bit limitations.

However, it looks like it worked for some of you guys, which version were you using?

Any other ideas?

Help appreciated!
Thanks!

Federico

Federico Llach's icon

Hi,

Oh, I see that indeed it is 32 bit only: https://cycling74.com/forums/how-would-you-route-and-sync-the-audio-of-video-playback-in-max-7-avf/
No other methods than exporting the audio file then? This would be very cumbersome for my project as I am combining preloaded video clips with live camera / audio recordings; so I'd need to have two complete different routings of signal instead of just one.

Thanks,

Federico

phiol's icon

Hi Federico

Use Quicktime 7 if you want to export an audio file.
If not, the lazy quick version is to use [importreplace] message with [buffer~] , loading any codecs Rob mentioned.
ProRes 422 etc. The soundfile will load no problem.

Also , now jit.movie has [position $1] , so send the right outlet from groove~ to it and voilà :-)
no more quicktime time units conversion etc... yay!!

phiol

Federico Llach's icon

Hi Phiol,

Thanks for the message!
This is similar to what Rob suggested in the other post: https://cycling74.com/forums/how-would-you-route-and-sync-the-audio-of-video-playback-in-max-7-avf/
My problem with this is it's 32-bit only and I was looking for 64-bit since it's for a Max for Live project and all of my Live installation is 64-bit—maybe I made the wrong choice then since I am finding a lot of problems with the 64 bit!

Federico

phiol's icon

jit.movie in @engine avf is perfectly fine in 64 bit :-) !

phiol

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

for 64 bit, you must export the audio file as an aif or wav file. you can easily use something like mpegstreamclip to batch process multiple files, and then load the corresponding audio or video file by replacing the extension in the file name (e.g. wav to mov).

Felon's icon

Hi guys,
Still not a solution for this problem in 2018 ?? I have the same exact problem with a PC installation where MAX is 64bit, and well spigot doesn't work ! It was the only simple (and great) way to route the video files as I needed.

I'll separate the audio files from the videos and then load each duo together at the same time with a toggle button (jit.movie + splay), but I would like it to be 100% safe and in sync.

Good enough ?

Thanks !

Felon's icon

PS: in any case, is there a problem if I use a MAX 32-bit version on the PC in order to use spigot ? 0r it is not recommended to use 32-bit app in a 64-bit PC ? $
(the patches were made on my MACbook pro in 64)

VJ Fader's icon