getframecount bug?

Sophia's icon

I'm having a lot of trouble with the getframecount message for jit.qt.movie. It at best causes the movie to stop playing, and at worst freezes Max. Has anyone else experienced this? Maybe I'm not doing something correctly?

Sophia's icon

Apparently this is unavoidable with large movies. Has anyone experimented with workarounds to make it count the frames faster? Would it work to just have the "finished" bang trigger a gettime message?

video_coder's icon

just an idea for a workaround:
perhaps you could do the framecount by hand using a fixed bitrate for compressing and analyse the filesize.
the filesize schould be linear to the length of movie.

best,
videomasta

Zachary Seldess's icon

Hi Zach,

Why not just have it get the framecount when first loading - you only need to do it once for each movie?

You could also deduce framecount if you knew the timescale, total time of the movie (in msecs), as well as the framerate:

(1000./timescale) * duration = total time in msecs
ans/1000. = total time in seconds
(total time in seconds * fps) + 1 = total number of frames

This method shows no latency.

Here are examples:

best,
Zachary

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

Zachary Seldess's icon

What I meant to write as the comment on the right was that it is necessary to add 1 at the end to get the same framecount as the getframecount message. You can see that in the patch.

Zachary

Sophia's icon

Thanks, Zachary! I would have never considered calculating framecount from duration, timescale and fps. It does work seamlessly and I'm now using it in my patch. Hope you're doing well.

-Zach