jit.movie~ is not accurate !

all's icon

Hello,

I need to launch very short videos from [jit.movie~].

I need to use the stereo sound of the movie and that why I need to use [jit.movie~] instead [jit.movie].

My problem is that the playing of the movie, the first time only, is not accurate !

NB : I don’t have the problem with [jit.movie] but I don’t have any control on the sound of the videos with this object.

I have attached a very small patch to illustrate my problem.

In this patch, after selecting a video in the [umenu], just press [start] and check the playing of the video :

- The first time you press start to play the video, the video player doesnt' work perfeclty (jump, cut end…).

- All the next times (from the 2nd one) you press start to play the video again (same video), the video player work perfectly

I need to have the playing of the video accurate from the first time.

If the problem persist (bug for example), is someone have a solution to control the sound output of the [jit.movie] object ?

Thank you a lot !

Max_Video.zip
zip 4.39 MB

all's icon

Sorry because I made a mistake in my patch : I add only 2 videofiles (Drums_01.mov, Rhodes_02.mov).
So, don't look for Rhodes_01.mov.

The problem is easily to check with Rhodes_02.mov.
Thank you !

Jean-Francois Charles's icon

On my system (Mac), using 'loadram' fixes the issue. Would that work for you?

Max Patch
Copy patch and select New From Clipboard in Max.

all's icon

Thank you a lot Jean-François.
I tried loadram and it seems to work.

In your patch, you use "duration" to get the second argument for loadram (end-time-seconds). However, I don't understand what is exactly "duration" : we can also get the movie duration in seconds (with the message getseconds) or in milliseconds (with the message getmilliseconds) and these durations are different of what give the message getduration.

For example, I have a movie with :
- getmilliseconds : 2960 (ms)
- getseconds : 2,960 (s)
- getduration : 1776 (what is exactly ?)

In this case, do you think is it better to use getseconds to get the second argument for loadram ?

Best regards,
Alex

Jean-Francois Charles's icon

Interesting, you are right.
Indeed, getduration is NOT the message to use. It gives you the duration in "Quicktime Units".
What you want is either milliseconds or seconds: it looks like the loadram message can work with milliseconds if you use ints, seconds if you use floats (in the Reference, it says it should be seconds in floats).
So, that would be better:

Max Patch
Copy patch and select New From Clipboard in Max.

Rob Ramirez's icon

Additionally, if loadram isn't sufficient as a solution you should convert the movie clips from h264 to a more realtime performant codec like Hap. You can batch convert using ffmpeg or (if on Mac) this - https://docs.vidvox.net/freebies_avf_batch_exporter.html

all's icon

Hello,
I will check both solution.
Thank you a lot.
Happy new year !

Wil's icon

I really want a computer that has that much ram! loadram x duration!