Transcoding mxf video file with CopyAudio in Azure Media Services v3

3

We are using Azure Media Services V3 API to transcode video files of various input formats into mp4 output. In case we have a mxf input file we receive the following exception when trying to transcode video with audio codec 'CopyAudio'): Azure Media ReEncode error message: An error has occurred. Stage: ApplyEncodeCommand. Code: 0x00000001.

This is the same issue as mentioned here (Copy audio codec throws exception when transcoding mxf video file), but for the v2 API of Azure Media Services

The answer given there is indeed the solution for Azure Media Services v2. I'm having trouble to port it to the v3 API though. In code we are creating an instance of StandardEncoderPreset (Microsoft.Azure.Management.Media.Models.StandardEncoderPreset) and try to use the CopyAudio codec. Currently I am unable to figure out how to specify the MOVFormat there.

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"
        }
    }

With the preset configured like that I get the same error as mentioned in the original post. CopyAudio only has a property 'Label'. Also been thinking we need to specify an extra format in the list of 'Formats' but I can't find a MOVFormat (or PCMFormat) class.

c#
audio
video-encoding
azure-media-services
asked on Stack Overflow Jan 23, 2020 by Joeri

1 Answer

1

Our v3 APIs do not yet support writing to MOV output file format. You would need to go with v2 APIs for such Jobs.

answered on Stack Overflow Jan 23, 2020 by Anil Murching

User contributions licensed under CC BY-SA 3.0