custom encode task