C# 在Azure Media Services v3中使用CopyAudio对mxf视频文件进行转码

C# 在Azure Media Services v3中使用CopyAudio对mxf视频文件进行转码,c#,audio,video-encoding,azure-media-services,C#,Audio,Video Encoding,Azure Media Services,我们正在使用Azure Media Services V3 API将各种输入格式的视频文件转换为mp4输出。如果我们有一个mxf输入文件,我们在尝试使用音频编解码器“CopyAudio”)转码视频时会收到以下异常:Azure Media ReEncode错误消息:发生错误。阶段:ApplyEncodeCommand。代码:0x00000001 这与此处提到的()问题相同,但适用于Azure Media Services的v2 API 这里给出的答案确实是Azure Media Services

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

这与此处提到的()问题相同,但适用于Azure Media Services的v2 API

这里给出的答案确实是Azure Media Services v2的解决方案。 不过,我很难将其移植到V3API。在代码中,我们正在创建StandardEncoderPreset(Microsoft.Azure.Management.Media.Models.StandardEncoderPreset)的实例,并尝试使用CopyAudio编解码器。目前我无法确定如何在那里指定MOV格式

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"
        }
    }
StandardEncoderPreset预设=新的StandardEncoderPreset(
编解码器:新列表()
{
新H264视频
{
KeyFrameInterval=TimeSpan.FromSeconds(2),
SceneChangeDetection=真,
//PreserveSolutionAfterrotation=真,
层=新[]
{
新H264层
{
Profile=H264VideoProfile.Auto,
Level=“自动”,
比特率=比特率,
MaxBitrate=比特率,
BufferWindow=TimeSpan.FromSeconds(5),
宽度=宽度。ToString(),
高度=高度。ToString(),
b帧=3,
参考框架=3,
FrameRate=“0/1”,
自适应帧=真
}
}
},新CopyAudio()
},
//指定输出文件的格式-一个用于视频+音频,另一个用于缩略图
格式:新列表()
{
新的Mp4Format()
{
FilenamePattern=“{Basename}}”+宽度+“x”+高度+“{Bitrate}.mp4”
}
}
通过这样配置预设,我得到了与原始帖子中提到的相同的错误。CopyAudio只有一个属性“Label”。
我们还一直在想,我们需要在“格式”列表中指定一个额外的格式,但我找不到MOVFormat(或PCMFormat)类。

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