如何在HTML5中流式传输实时视频? [英] How to stream live video in HTML5?

查看:665
本文介绍了如何在HTML5中流式传输实时视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来播放从网络摄像头拍摄的实时视频或以PC为基础的摄像头。
广播应该使用标签显示在HTML5页面中(我认为支持rtp和rtsp)。

I'm looking for a way to broadcast a live video taken from a webcam or camera rooted to a PC. The broadcast should be displayed in a HTML5 page using the tag (which support rtp, and rtsp I think).

查看流的用户不应该有安装任何插件或视频播放器,如QuickTime。

The user viewing the stream should not have to install any plug-in or video player such as QuickTime.

我需要视频为mp4格式,例如:rtsp://www.mywebsite/streaming/ video.mp4

I need the video to be in mp4 format such as: rtsp://www.mywebsite/streaming/video.mp4

这是我作为html 5视频标签的src放置的链接。

This would be the link I'd put as the src of the html 5 video tag.

所以我想知道是否可能,我有什么选择做这些事情。

So I'd like to know if it's possible, what are my options to do such things.

推荐答案

这是可能的。但是如果您正在寻找跨浏览器支持,那么您将遇到重大问题。您可以做的是向支持它的浏览器提供HTML5视频,然后为不支持它的浏览器提供QuickTime。

It's possible. But you will have major problems if you're looking for cross browser support. What you can do is offer HTML5 video to the browsers supporting it and then offer QuickTime for browsers not supporting it.

<video src="stream.mp4">

    <!-- Don't support <video> -->
    <object>
        <param name="src" value="video.mp4" />
        
    <param name="autoplay" value="true" />
        
    <param name="type" value="video/quicktime" height="256" width="320" />
        
    
    <embed src="video.mp4" height="256" width="320" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" />
    </object>

</video>

另见:通过HTML5中的RTSP或RTP进行流式传输

这篇关于如何在HTML5中流式传输实时视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆