/// <summary>
        /// Method used to get the codecs for the transform.
        /// </summary>
        /// <returns>Array of Azure Media Services V3 Codec.</returns>
        private static Codec[] GetCodecs()
        {
            // Common settings
            /// <summary>
            /// Explicitly set to 0: we don't want b-frames which, May-20-2020, were causing non-zero timestamps.
            /// </summary>
            int?     bframes          = 0;
            TimeSpan?keyFrameInterval = TimeSpan.FromSeconds(2);

            List <Codec> codecs = new List <Codec>
            {
                // Add audio codecs
                new CopyAudio()
            };

            // Add video codecs
            H264Layer[] h264Layers = new H264Layer[]
            {
                GetH264Layer(profile: H264VideoProfile.High, bitrate: 4900000, bframes: bframes, width: "1920", height: "1080", label: "1920x1080"),
                GetH264Layer(profile: H264VideoProfile.High, bitrate: 2500000, bframes: bframes, width: "1920", height: "1080", label: "1920x1080"),
                GetH264Layer(profile: H264VideoProfile.Main, bitrate: 1600000, bframes: bframes, width: "1280", height: "720", label: "1280x720"),
                GetH264Layer(profile: H264VideoProfile.Main, bitrate: 800000, bframes: bframes, width: "960", height: "540", label: "960x540"),
                GetH264Layer(profile: H264VideoProfile.Baseline, bitrate: 400000, bframes: null, width: "640", height: "360", label: "640x360")
            };
            codecs.Add(new H264Video(keyFrameInterval: keyFrameInterval, layers: h264Layers));

            return(codecs.ToArray());
        }
コード例 #2
0
        /// <summary>
        /// Method used to get the codecs for the transform.
        /// </summary>
        /// <returns>Array of Azure Media Services V3 Codec.</returns>
        private static Codec[] GetCodecs()
        {
            // Common settings
            int?     bframes          = 3;
            TimeSpan?keyFrameInterval = TimeSpan.FromSeconds(2);

            List <Codec> codecs = new List <Codec>
            {
                // Add audio codecs
                new CopyAudio()
            };

            // Add video codecs
            H264Layer[] h264Layers = new H264Layer[]
            {
                GetH264Layer(profile: H264VideoProfile.High, bitrate: 4900000, bframes: bframes, width: "1920", height: "1080", label: "1920x1080"),
                GetH264Layer(profile: H264VideoProfile.High, bitrate: 2500000, bframes: bframes, width: "1920", height: "1080", label: "1920x1080"),
                GetH264Layer(profile: H264VideoProfile.Main, bitrate: 1600000, bframes: bframes, width: "1280", height: "720", label: "1280x720"),
                GetH264Layer(profile: H264VideoProfile.Main, bitrate: 800000, bframes: bframes, width: "960", height: "540", label: "960x540"),
                GetH264Layer(profile: H264VideoProfile.Baseline, bitrate: 400000, bframes: null, width: "640", height: "360", label: "640x360")
            };
            codecs.Add(new H264Video(keyFrameInterval: keyFrameInterval, layers: h264Layers));

            return(codecs.ToArray());
        }