call stop when encode finished normally