【问题标题】:Bad input: the source video has an avg_frame_rate of NaN fps and r_frame_rate of 90000 fps in Azure Media Service错误输入:源视频在 Azure 媒体服务中具有 NaN fps 的 avg_frame_rate 和 90000 fps 的 r_frame_rate
【发布时间】:2016-04-14 16:51:21
【问题描述】:

我尝试将歌曲 (.mp4) 文件格式上传到媒体服务。它已成功上传,但是当我尝试创建编码作业时,我收到了下面提到的错误。对于少数文件,我收到以下错误,而对于少数文件,则不是。无法确定错误是什么以及如何解决此问题?

错误消息:

    Encoding task
ErrorProcessingTask : An error has occurred. Stage: ApplyEncodeCommand. Code: System.IO.InvalidDataException.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.IO.InvalidDataException: Bad input: the source video has an avg_frame_rate of NaN fps and r_frame_rate of 90000 fps.

代码:使用“H264 Multiple Bitrate 720p”编码

static public IAsset CreateEncodingJob(IAsset asset, string preset,string fileName)
        {           
            IJob job = _context.Jobs.Create(preset + " encoding job");
            var mediaProcessors =
                  _context.MediaProcessors.Where(p => p.Name.Contains("Media Encoder Standard")).ToList();
            var latestMediaProcessor =
                mediaProcessors.OrderBy(mp => new Version(mp.Version)).LastOrDefault();
            ITask task = job.Tasks.AddNew(preset + " encoding task",
                latestMediaProcessor,
                preset, 
                Microsoft.WindowsAzure.MediaServices.Client.TaskOptions.ProtectedConfiguration);            
         task.InputAssets.Add(asset);
         task.OutputAssets.AddNew(fileName + " " + preset,
                AssetCreationOptions.None);
         job.StateChanged += new
                    EventHandler<JobStateChangedEventArgs>(StateChanged);

            job.Submit();


            LogJobDetails(job.Id);

            Task progressJobTask = job.GetExecutionProgressTask(CancellationToken.None);
            progressJobTask.Wait();

            if (job.State == JobState.Error)
            {
                throw new Exception("\nExiting method due to job error.");
            }

            return job.OutputMediaAssets[0];
        }

谁能帮我解决这个问题?

【问题讨论】:

    标签: azure-media-services


    【解决方案1】:

    找到解决方案:Click here

    重新发表评论:

    您的编码任务失败,因为输入视频报告的标称帧速率太高或太低。您必须覆盖编码预设中的输出帧速率设置。假设您知道输入视频已经以 30 帧/秒的速度录制,那么:

    1. https://msdn.microsoft.com/en-us/library/azure/mt269953.aspx获取“H264 多比特率 720p”的 JSON

    2. 编辑/替换每个“FrameRate”:“0/1”条目为“FrameRate”:“30/1”。请注意,有多个条目要替换。

    3. 保存生成的 JSON

    4. 提交编码任务时,在 CreateEncodingTask 中,将字符串“preset”替换为整个 JSON(使用 System.IO.File.ReadAllText("song.Json"))


    问候, 迪利普。

    【讨论】:

      猜你喜欢
      • 2021-12-31
      • 2013-06-02
      • 2023-03-19
      • 2022-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-02
      • 1970-01-01
      相关资源
      最近更新 更多