To add to what IanB is telling you, note that a line such as round(c) effectively does nothing - the result is calculated and then thrown away. You have to assign the result to something: c = round(c) Also, frames are numbered from 0, so the last frame is framecount-1, not framecount. That's why it's more convenient to use trim(..., 0) to select up to the end of a clip.