loading audio from a video into a buffer?

Danny de Graan's icon

Is there a way to load the audio from a video immediately into a buffer? I had a look at spigot but I see no way to access the cached file. I could just separate the audio from the video and load them at the same time but thats a lot of work when you want to experiment just with some files.

Any ideas / tips on the subject?

justin's icon

just to be clear, what you are asking for is a method for loading the audio track in a QT file into a [buffer~] object?
sorry but i'm not aware of any solutions for this, think u might have to go with the separation of audio / video files. but maybe someone else knows...

Danny de Graan's icon

Yes, loading a QT movie with audio into max and the audio automatically transfered to a buffer. I searched the forum but no clue's how to do this. I read that spigot stores the audio in a cache file but I have no idea how to access this file and if thats possible at all.

Rob Ramirez's icon

try the "import" message to buffer~.

you will have to possibly first read the movie into qt.movie, query the length, resize the buffer~ based on that length, and then import the movie into the buffer~

Danny de Graan's icon

Yes, import message works great. Great tip. Thanx a million!!!

Julio's icon

Hi there!

This post is from a while back, but I wanted to ask how you guys worked around reading a movie file in ~buffer. I tried what Rob suggested, loading the file into the qt.movie, querying the length and then resizing the buffer to finally try to read the movie file, but ~buffer just will not let me load any video files! A super short tip or example would be most appreciated!

Thanks a bunch!

Julio

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

this should work. ?

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

[buffer~] is one of the victima of c74's recent 'update mania'. Several features broke in Max 6.0
Import the audio portion of a .mov file works again with Max 6.1, no need to query length.

Julio's icon

Wow! Thank you both for the quick response! Im going use CTRLZJONES method as it sheds light on a couple of other important importing factors! Thanks for the support!

Doug MeatLoaf's icon

Hello.
I have some patches that I builded some time ago that use to work fine when I needed to load the audio of video file into a [buffer~].
I can't understand why, none of them are working today.
In troubleshooting the cause, I have use the simple patch posted above by DAGGY which uses the message " import blading.mov 0 -1 " into a buffer and it does not work.
I always get this message ---> buffer~: blading.mov: can't open
I have tried copying the " blading.mov " file into the same folder as my patch as well as making sure , in the file preferences ... , that the folder containining these files was effectively in the path's list.
Nothing works yet.
Has someone has an idea of something else I could try to find the problems?
Thanks a lot for your help.

Rob Ramirez's icon

i believe this feature only works in 32 bit mode

Danny de Graan's icon

I just tried it and it still works (64bit). Maybe you need to restart your computer?! Sometimes I have this strange behaviour in Max that something which normally works suddenly doesn't. A restart always fix it.

Doug MeatLoaf's icon

Thank you both for your reply.
On my side, even when I restart Max, it is not working.
If I switch Max to 32bit mode then it works fine.

Ultimately, my goal with having the [buffer~] load the audio of a video file is to build a video player which use the [groove~] to drive [jit.movie].
It's nice to only have to read the video file and have the import done automatically on the audio side.
Is there another way to read a video file in [jit.move] and have a [buffer~] extract and load the audio?
Or the only method is to extract the audio from the video file prior to importing them and then import them separately into Max?
Thanks again for your help on this.

Danny de Graan's icon

Hi Doug, Sorry but I made a mistake. in 64bit mode it doesn't work on my system either. I was under the impression I always was running in 64bit mode. Turns out I wasn't :-\

Maybe you can address this with cycling 74 since it looks like a bug. I see no reason why this could not work in 64bit mode.

The only workaround I can think of is indeed strip the audio beforehand and import it later.

Goog luck!

Doug MeatLoaf's icon

Thanks Danny for your reply confirming it wasn't working on your side either.
Just so you know, I wrote to Cycling 74 support to ask about this issue.
Here is the answer they gave me, just so you know :

" I believe that it requires the QT backend, an operation which is not supported in the 64-bit version. The preferred way of working with audio from a movie file now is using the jit.movie~ object. "

Cheers.

Matteo Marson's icon

Hi everyone!

I'm facing the same problem, looking for an easy way to automatically load a video in jit.movie and its audio into a buffer~ without having to split the two before (in 64bit mode). Since i'm dealing with many videos sent by mobile phones in real time, this feature is crucial!

The only solution i thought about is to open two istances of Max, one in 32bit the other in 64bit mode, do the split in the first one, save the content of the buffer via "write" message and then trigger via UDP the loading of the separated video and audio in the 64bit istance of Max.

It should work but seems convoluted and unelegant!

Did you find any workaround?

Thanks!

Rob Ramirez's icon

your solution sounds like a good one.

an alternative is a command line utility such as ffmpeg, and the shell object.

Tugrul Akyuz's icon

Hi,
I want to find audio transient points of an audio in a video(mov). But import message (buffer~) does not work.
How I can load or extract audio channel(stream) from a video to the buffer~ object?

Thanks in advance
Tuğrul