Delay in pressing start on a video

simon.c.hendry's icon

hi there. I have a project where videos have to start as soon as the user triggers them. I'm currently experiencing maybe a third of a second between pressing start and the video starting. I have tried:
- playback using imovie obejct
- playback using jit.gl.movie
- loading into ram
- read and asyncread
- H264 and Prores video files
The video files themselves are tiny - 1.5mb for the H264 versions. Any ideas would be much appreciated.

Simon

Rob Ramirez's icon

if you want instantaneous playback you need to preload the videos. you can use jit.playlist or jit.(gl.)polymovie for this. otherwise you will always have a delay when reading the movie.

a good realtime codec like Hap will also improve things, but preloading improve things with most any codec. Using opengl and output_texture 1 will also improve responsiveness

simon.c.hendry's icon

Thanks Rob. I’ll try Hap and the texture attribute. I tried a playlist but with 96 files, I quickly got a beach ball which eventually crashed Max. It’s odd though cause even with jit.movie and the file loaded to ram using the loadtoram message, there is still a fair lag between pressing go and the video starting - a lag that is not there preloading the audio only into sfplay for example.