从IP Camera将RTSP流式传输到Web浏览器的最佳方法? [英] Best approach to get RTSP streaming into web browser from IP Camera?
问题描述
是否可以将RTSP流数据导入Web浏览器?
以下是我的一些发现.如果我错了,请纠正我吗?
-
仅Mac OS和Safari支持RTSP实时流.
-
HTML 5视频不支持RTSP.
-
我可以使用VLC插件,但是我不想使用它.
是否可以将ffmpeg和websocket混合使用?
假设我的IP摄像机已与以太网连接.
在客户端计算机中:
- 我运行ffmpeg从服务器(即IP)获取数据
- 客户端计算机运行websocket.
- 一旦ffmpeg从RTSP服务器获取数据,它将解码并生成任何格式的原始图像(例如:yuv).
- 现在,我必须将此图像通过websocket发送到浏览器.
问题:
- 这是正确的方法吗?
- 如何将ffmpeg的解码图像导入浏览器?
我在不同的地方可能错了.请提供输入.
jsmpeg .将 stream-example.html
中的WebSocket URL更改为 localhost
,然后在您喜欢的浏览器中将其打开.
更新 stream-m Java服务器或 ffserver
./p>
Is it possible to get the RTSP Streaming data into the web browser?
Below are some of my findings. Kindly correct me if I am wrong?
Only Mac OS, and Safari supports RTSP Live Streaming.
HTML 5 video does not support RTSP.
I can use the VLC plugin, but I don't want to use that.
Possibility of mixing ffmpeg and websocket?
Assume my IP camera is connected with Ethernet.
In the client machine:
- I run ffmpeg to get the data from server (ie: IP)
- Client machine runs websocket.
- Once ffmpeg gets the data from RTSP Server, it decodes, and generates the raw image of any format (for example: yuv).
- Now, i have to send this image to browser through websocket.
Question:
- It is the right approach ?
- How can I get the decoded image from ffmpeg into the browser ?
I might be wrong in different places. Kindly provide input.
Here is a blog entry, or tutorial if you will, that achieves something very similar.
Their setup slightly different, but this is the summary:
use ffmpeg
to convert your input into mpeg1video:
ffmpeg -i rtsp://whatever -f mpeg1video -b 800k -r 30 http://localhost:8082/yourpassword/640/480/
Install node.js
with stream-server.js
script from jsmpeg and ws
ws WebSocket package.
To view the stream, use the stream-example.html
and jsmpg.js
from the jsmpeg. Change the WebSocket URL in stream-example.html
to localhost
and open it in your favorite browser.
Update an SO topic suggest two other working solutions, with <video> tag: with stream-m Java server or with ffserver
.
这篇关于从IP Camera将RTSP流式传输到Web浏览器的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!