extract out loop for videoarray