HTML 5 <video>使用的表达式编码器 4 实时流



我正在尝试提供一个直播流(即。完全缓冲在内存中,不能访问过去)和我有麻烦的表达式编码器4。

理想情况下,我想只是流式传输一个裸露的H.264字节流到客户端:

 <video id="mainVideoWindow">
     <source src='http://localhost/path/to/my/stream.mp4' type='video/mp4' />
 </video>

我想我可以像HTTP上的任何其他字节流一样将其流式传输到客户端。然而,我有困难找出适当的代码需要做(第一天与表达式编码器,不知道如何去获得原始字节流),所以我也不知道它是否会在第一时间工作。

另一种选择是使用IIS Live Streaming server:

        var source = job.AddDeviceSource(device, null);
        job.ActivateSource(source);
        job.ApplyPreset(LivePresets.VC1IISSmoothStreaming720pWidescreen);
        var format = new PushBroadcastPublishFormat();
        format.PublishingPoint = new Uri("http://localhost/test.isml");
        job.PublishFormats.Add(format);
        job.StartEncoding();
        // Let's listen for a keypress or error message to know when to stop encoding
        while (Console.ReadKey(true).Key != ConsoleKey.X) ;
        // Stop our encoding
        Console.WriteLine("Encoding stopped.");
        job.StopEncoding();

然而,我有麻烦让客户端标记想要在Chrome上显示视频,我还没有看到任何迹象表明它会在Chrome上工作(虽然http://learn.iis.net/page.aspx/854/apple-http-live-streaming-with-iis-media-services表明它将如何与iOS设备一起工作)。

有人有什么见解吗?

您正在尝试使用(与您的第二个例子)通过HTML5平滑流提要(HTTP-Adaptive Streaming by Microsoft),这是不支持的。

这可以在iOS设备上工作,如果你启用Apple HTTP Live Streaming将片段转换为MPEG-2 Transport Stream。这也将生成一个Apple HTTP Live Streaming清单,它可以通过video标签调用。

…我看到你有IIS链接。Apple HTTP Live Streaming需要在IIS服务器(IIS Media Services)上启用。这将适用于iOS设备。

最新更新