HTML 5
我正在尝试提供实时流(即完全缓冲在内存中,无法访问过去),但在使用 Expression Encoder 4 时遇到了问题。
理想情况下,我只想将裸露的 H.264 字节流流式传输到客户端消耗:
<video id="mainVideoWindow">
<source src='http://localhost/path/to/my/stream.mp4' type='video/mp4' />
</video>
我想我可以将它流式传输到客户端,就像通过 HTTP 的任何其他字节流一样。然而,我无法弄清楚所需执行的适当代码(第一天使用表达式编码器,不知道如何获取原始字节流),所以我也不知道它是否能工作。
另一种方法是使用 IIS Live Streaming 服务器:
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 设备配合使用)。
有人有任何见解吗?
I'm trying to serve up a live stream (ie. completely buffered in memory, cannot access the past) and am having trouble with Expression Encoder 4.
Ideally, I'd like to just stream a bare H.264 byte stream to the client consumed by:
<video id="mainVideoWindow">
<source src='http://localhost/path/to/my/stream.mp4' type='video/mp4' />
</video>
I figured I could stream it to the client just like any other byte stream over HTTP. However, I'm having trouble figuring out the appropriate code required to do (first day with Expression Encoder, not sure how to go about getting the raw byte stream) so nor do I know if it would work in the first place.
An alternate was to use 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();
However, I'm having trouble getting the client side markup to want to display the video on Chrome and I haven't seen anything to indicate that it'd work on Chrome (though http://learn.iis.net/page.aspx/854/apple-http-live-streaming-with-iis-media-services indicates how it would work with an iOS device).
Anyone have any insights?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正尝试通过 HTML5 使用(使用第二个示例)平滑流式传输源(Microsoft 的 HTTP 自适应流式传输),但不受支持。
如果您启用 Apple HTTP Live Streaming 将片段转换为 MPEG-2 传输流,则这可以在 iOS 设备上运行。这还将生成一个 Apple HTTP Live Streaming 清单,可以通过视频标签调用该清单。
You are trying to consume (with your sencond example) a Smooth Streaming feed (HTTP-Adaptive Streaming by Microsoft) through HTML5, which is not supported.
This could work on iOS devices if you enable the Apple HTTP Live Streaming to transmux the fragments into MPEG-2 Transport Stream. This will also generate an Apple HTTP Live Streaming manifest which than can be called though the video tag.
...我看到你有 IIS 链接。需要在 IIS 服务器(IIS 媒体服务)上启用 Apple HTTP Live Streaming。这适用于 iOS 设备。 Quicktime 将开始发挥作用...
...I saw that you have the IIS link. The Apple HTTP Live Streaming needs to be enabled on the IIS Server (IIS Media Services). This will work for iOS devices. Quicktime will get into play...