我正在使用azure媒体服务.net SDK。我上传了视频并尝试对其进行编码。我希望编码进度百分比。以下代码我使用。
string message = "Encoding percentage complete";
double progress = 0;
// encode status
var job = _context.Jobs.Where(j => j.Name == jobName).FirstOrDefault();
if (job != null)
{
var task = job.Tasks.FirstOrDefault();
if (task != null && task.State != JobState.Error && task.State != JobState.Canceled && task.State != JobState.Canceling)
{
message = "Encoding video";
progress = task.Progress;
}
else
{
message = task.State.ToString();
}
}
else
{
message = "NotFound";
}
return new Tuple<string, double>(message, progress);
当执行上面的代码时,每次0返回。有没有办法以百分比形式获得编码状态?