Rapidly changing the playback rate of jit.movie

Marika Carstensen's icon

Hey all,

I have been building a relatively barebones patch that changes the rate of a jit.movie object and jumps 10 frames each time a beat in a signal is detected using the bonk~ external. This patch works very smoothly with one specific mp4 file. When using another file the jit.movie playback will jump back to the start of the video seemingly at random upon receiving a rate message (I have tried without the jump message and got the same result). Its clear that this has something to do with the files themselves, but I am at a loss as how to fix this.

Is it possible that changing the rate less frequently or jumping less frequently would help?

UPDATE:
It appears that the issue only manifests when switching suddenly between a positive and negative rate. This is useful but still doesn't explain why this only happens with some files. Both the file A (the one that works smoothly with positive and negative rates) and file B (the one that jumps to the start of the video when switching between + and - rates quickly) are H26 encoded MP4s, both are the same resolution and framerate, and both are the same resolution.

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

Rob Ramirez's icon

it looks like you are using viddll engine (cache_size attribute) which is much more forgiving of rate changing then avf engine. it may be simply enough to remove either the qmetro or the playbar attached to your jit.movie. both these objects send out bangs at different rates, and that may be causing some issues. you only need one or the other.

another easy change is to increase your cache_size significantly, or additionally use loadram to load the entire file into memory cache (depending on your RAM resources available and the length and image dims of the file).

lastly, you willl likely have better performance for these kinds of operations if you convert your movie file to hap (or some other non-temporal compression like prores 422).

Marika Carstensen's icon

ahh that makes sense! Thank you

Roman Thilenius's icon


safe way to play frames under any condition: