/// <summary>
        /// Creates a MP4 muxing.
        ///
        /// API endpoint:
        /// https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsMuxingsMp4ByEncodingId
        /// </summary>
        /// <param name="encoding">The encoding to add the MP4 muxing to</param>
        /// <param name="output">The output that should be used for the muxing to write the segments to</param>
        /// <param name="outputPath">The output path where the fragments will be written to</param>
        /// <param name="stream">A list of streams to be added to the muxing</param>
        /// <param name="fileName"> The name of the file that will be written to the output

        private Task <Mp4Muxing> CreateMp4Muxing(Models.Encoding encoding, Output output, string outputPath,
                                                 List <Stream> streams, String filename)
        {
            var muxingStreams = new List <MuxingStream>();

            foreach (Stream stream in streams)
            {
                var muxingSteam = new MuxingStream()
                {
                    StreamId = stream.Id,
                };
                muxingStreams.Add(muxingSteam);
            }

            var muxing = new Mp4Muxing()
            {
                Filename = filename,
                Outputs  = new List <EncodingOutput>()
                {
                    BuildEncodingOutput(output, outputPath)
                },
                Streams = muxingStreams,
            };

            return(_bitmovinApi.Encoding.Encodings.Muxings.Mp4.CreateAsync(encoding.Id, muxing));
        }
コード例 #2
0
        /// <summary>
        /// Creates a fragmented MP4 muxing. This will split the output into continuously numbered segments
        /// of a given length for adaptive streaming. However, the unencrypted segments will not be written
        /// to a permanent storage as there's no output defined for the muxing. Instead, an output needs to
        /// be defined for the DRM configuration resource which will later be added to this muxing.<para/>
        ///
        /// API endpoint:
        /// https://bitmovin.com/docs/encoding/api-reference/all#/Encoding/PostEncodingEncodingsMuxingsFmp4ByEncodingId
        /// </summary>
        /// <param name="encoding">The encoding to which the muxing will be added</param>
        /// <param name="stream">The stream to be muxed</param>
        private Task <Fmp4Muxing> CreateFmp4Muxing(Models.Encoding encoding, Stream stream)
        {
            var muxingStream = new MuxingStream()
            {
                StreamId = stream.Id
            };

            var muxing = new Fmp4Muxing()
            {
                SegmentLength = 4,
                Streams       = new List <MuxingStream>()
                {
                    muxingStream
                }
            };

            return(_bitmovinApi.Encoding.Encodings.Muxings.Fmp4.CreateAsync(encoding.Id, muxing));
        }
コード例 #3
0
        /// <summary>
        /// Creates a fragmented MP4 muxing. This will generate segments with a given segment length for
        /// adaptive streaming.<para />
        ///
        /// API endpoint:
        /// https://bitmovin.com/docs/encoding/api-reference/all#/Encoding/PostEncodingEncodingsMuxingsFmp4ByEncodingId
        /// </summary>
        /// <param name="encoding">The encoding where to add the muxing to</param>
        /// <param name="output">The output that should be used for the muxing to write the segments to</param>
        /// <param name="outputPath">The output path where the fragmented segments will be written to</param>
        /// <param name="stream">The stream to be muxed</param>
        private Task <Fmp4Muxing> CreateFmp4Muxing(Models.Encoding encoding, Output output, string outputPath,
                                                   Stream stream)
        {
            var muxingStream = new MuxingStream()
            {
                StreamId = stream.Id
            };

            var muxing = new Fmp4Muxing()
            {
                SegmentLength = 4,
                Outputs       = new List <EncodingOutput>()
                {
                    BuildEncodingOutput(output, outputPath)
                },
                Streams = new List <MuxingStream>()
                {
                    muxingStream
                }
            };

            return(_bitmovinApi.Encoding.Encodings.Muxings.Fmp4.CreateAsync(encoding.Id, muxing));
        }