Helper class for generating SMIL files to send to the IIS Live Smoothstreaming snap-in
Exemple #1
0
        /// <summary>
        /// Used once per connection, this opens a long-life HTTP stream
        /// and pushes the very basic MP4 parts needed to get IIS working.
        /// </summary>
        private void ConnectAndPushHeaders(MediaStream stream, FileRoot TargetMp4fFile)
        {
            SmilGenerator smil = new SmilGenerator("HCS Encoder by Iain Ballard.", stream);

            smil.ApproxBitrate = stream.Bitrate;
            MP4_Mangler.ExtraBoxes.SmoothSmil ssmil = new MP4_Mangler.ExtraBoxes.SmoothSmil(smil.Generate());
            PushServer.Connect(stream.TrackId);             // This pushes to the subpath: Streams({id}-stream{index})

            // push headers (only done once per track)
            // each one needs it's own HTTP Chunk, so don't concat!
            PushServer.PushData(stream.TrackId, TargetMp4fFile.GenerateFileSpec());
            PushServer.PushData(stream.TrackId, ssmil.deepData());
            PushServer.PushData(stream.TrackId, TargetMp4fFile.GenerateHeaders());
        }
        /// <summary>
        /// Used once per connection, this opens a long-life HTTP stream
        /// and pushes the very basic MP4 parts needed to get IIS working.
        /// </summary>
        private void ConnectAndPushHeaders(MediaStream stream, FileRoot TargetMp4fFile)
        {
            SmilGenerator smil = new SmilGenerator("HCS Encoder by Iain Ballard.", stream);

            smil.ApproxBitrate = stream.Bitrate;
            MP4_Mangler.ExtraBoxes.SmoothSmil ssmil = new MP4_Mangler.ExtraBoxes.SmoothSmil(smil.Generate());
            PushServer.Connect(stream.TrackId); // This pushes to the subpath: Streams({id}-stream{index})

            // push headers (only done once per track)
            // each one needs it's own HTTP Chunk, so don't concat!
            PushServer.PushData(stream.TrackId, TargetMp4fFile.GenerateFileSpec());
            PushServer.PushData(stream.TrackId, ssmil.deepData());
            PushServer.PushData(stream.TrackId, TargetMp4fFile.GenerateHeaders());
        }