Lag related to jit.record

Antoine Briot's icon

Hi there !

I created a basic video sampler that grabs video from various inputs (essentially cameras) in 1080p and allows me to play later the recorded samples. In parallel, there is always video monitoring of the camera and i can crossfade between my samples and my live monitoring.

Although it works quite well, i've noticed whenever I press the stop button of the recorder (which means, i guess, max writes the movie file), I get a lag in my video output, like a stutter.
It seems to affect the whole rendering process.

Do you know if it's a normal thing linked to the way max treats video recording itself, or do I need to set specific parameters to avoid that ?

Thank you a lot for that,

Rob Ramirez's icon

probably unavoidable. My suggestion would be to run a separate process (meaning separate instance of Max) for the recording. you can use syphon or spout to pass frames, and udpsend/receive to communicate between the instances. basic example below:

SENDER patch

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

RECEIVER patch

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

Antoine Briot's icon

Thank you for the suggestion Rob !

I'll try to sort this out asap and I'll get back to you.

Antoine Briot's icon

Hi again Rob !

I checked with a new instance of max and it does not work. However, i discovered it's not jit.record that causes the stutter when it writes data, it's jit.movie at the moment it reads a file (because my patch reads the file straight after it's been recorded, i did not figured it out).

I then checked if the operation is not done simultaneously and the stutter still persists.

Rob Ramirez's icon

use asyncread

Antoine Briot's icon

Wonderful ! it works ! Thanks a lot, no sure why though (the technical reason i mean).