Log in

View Full Version : Cutlist -> Frame Ranges for Loop/Trim


Kim Brandstetter
1st June 2013, 04:05
How do I convert a cutlist of

start: hours:minutes:seconds:milliseconds
end: hours:minutes:seconds:milliseconds

start1: hours:minutes:seconds:milliseconds
end1: hours:minutes:seconds:milliseconds

...

into frames ranges for Loop(0,start,end) or Trim?

I tried ((milliseconds/100)+seconds+(minutes * 60)+(hours*3600))*framerate but this cuts at the wrong position.

Gavino
1st June 2013, 09:52
The divisor for milliseconds should be 1000, not 100, and the division has to be a floating point one, so you need to use milliseconds/1000.0.

Another point to think about is what happens when the time does not correspond to an exact frame boundary. Depending on the context, you might want to round the calculated frame number to the nearest integer (using the round() function), round down using floor() or round up using ceil().

Also bear in mind when interpreting the end time that Trim(a, b) includes frame b and Loop(0, a, b) deletes frame b.

Kim Brandstetter
2nd June 2013, 06:11
Yeah I found that out in the meantime, works better.