getframecount bug?

Jan 28, 2009 at 1:12am

getframecount bug?

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?

#41967
Jan 29, 2009 at 8:43pm

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?

#149895
Jan 29, 2009 at 11:17pm

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

#149896
Jan 30, 2009 at 3:48pm

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

– Pasted Max Patch, click to expand. –
#149897
Jan 30, 2009 at 9:39pm

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

#149898
Feb 8, 2009 at 12:03am

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

#149899

You must be logged in to reply to this topic.