How to get the length of the movie file in

Hello,

How does one get the video length of the “Movie File In” operator?
I would need to access this in a Python expression (in my script).

Is there something along the lines of op(‘mov_in_1’).duration ?

I searched the documentation but failed to find any references. The closest I found was that I could get the count of frames of the movie.

Thank you!

create an infoCHOP and drag the moviefileinTOP onto it. Then connect a mathCHOP to the output of the infoCHOP. On the common page of the mathCHOP change the scope to include only LENGTH and SAMPLE_RATE (you can select these from the drop down). On the OP page change the COMBINE CHANNELS to divide. result is the number of seconds duration.

add a second mathCHOP and divide by 60 to get minutes/seconds.

2 Likes

Thank you!

This worked perfectly!

op(‘mov_in_1’).numSeconds will give you length in seconds. There are other python members for different properties of the movie as defined here:

derivative.ca/wiki099/index. … nTOP_Class

The info CHOP method berryctr describes of course works as well, and allows you to keep an updated length efficiently if you were changing the file or the trims dynamically.