processing video in a sorted order