【问题标题】:Transcoding mxf video file with CopyAudio in Azure Media Services v3在 Azure 媒体服务 v3 中使用 CopyAudio 对 mxf 视频文件进行转码
【发布时间】:2020-01-23 12:44:33
【问题描述】:

我们正在使用 Azure Media Services V3 API 将各种输入格式的视频文件转码为 mp4 输出。如果我们有一个 mxf 输入文件,我们在尝试使用音频编解码器“CopyAudio”对视频进行转码时收到以下异常):Azure Media ReEncode 错误消息:发生错误。阶段:ApplyEncodeCommand。代码:0x00000001。

这与此处提到的相同问题 (Copy audio codec throws exception when transcoding mxf video file),但针对 Azure 媒体服务的 v2 API

那里给出的答案确实是 Azure 媒体服务 v2 的解决方案。 不过,我在将其移植到 v3 API 时遇到了麻烦。在代码中,我们正在创建一个 StandardEncoderPreset (Microsoft.Azure.Management.Media.Models.StandardEncoderPreset) 实例并尝试使用 CopyAudio 编解码器。目前我无法弄清楚如何在那里指定 MOVFormat。

StandardEncoderPreset preset = new StandardEncoderPreset(
    codecs: new List<Codec>()
    {
        new H264Video
        {
            KeyFrameInterval = TimeSpan.FromSeconds(2),
            SceneChangeDetection = true,
            //PreserveResolutionAfterRotation = true,
            Layers = new[]
            {
                new H264Layer
                {
                    Profile = H264VideoProfile.Auto,
                    Level = "Auto",
                    Bitrate = bitrate,
                    MaxBitrate = bitrate,
                    BufferWindow = TimeSpan.FromSeconds(5),
                    Width = width.ToString(),
                    Height = height.ToString(),
                    BFrames = 3,
                    ReferenceFrames = 3,
                    FrameRate = "0/1",
                    AdaptiveBFrame = true
                }
            }
        }, new CopyAudio()

    },
    // Specify the format for the output files - one for video+audio, and another for the thumbnails
    formats: new List<Format>()
    {
        new Mp4Format()
        {
            FilenamePattern = "{Basename}_" + width + "x" + height +"_{Bitrate}.mp4"
        }
    }

使用这样配置的预设,我得到了与原始帖子中提到的相同的错误。 CopyAudio 只有一个属性“标签”。 也一直在想我们需要在“格式”列表中指定一个额外的格式,但我找不到 MOVFormat(或 PCMFormat)类。

【问题讨论】:

    标签: c# audio video-encoding azure-media-services


    【解决方案1】:

    我们的 v3 API 尚不支持写入 MOV 输出文件格式。对于此类作业,您需要使用 v2 API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-22
      • 1970-01-01
      • 1970-01-01
      • 2023-01-25
      相关资源
      最近更新 更多