encode multiple frames at once