从IP Camera将RTSP流式传输到Web浏览器的最佳方法? [英] Best approach to get RTSP streaming into web browser from IP Camera?

查看:141
本文介绍了从IP Camera将RTSP流式传输到Web浏览器的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将RTSP流数据导入Web浏览器?

以下是我的一些发现.如果我错了,请纠正我吗?

  1. 仅Mac OS和Safari支持RTSP实时流.

  2. HTML 5视频不支持RTSP.

  3. 我可以使用VLC插件,但是我不想使用它.

是否可以将ffmpeg和websocket混合使用?

假设我的IP摄像机已与以太网连接.

在客户端计算机中:

  1. 我运行ffmpeg从服务器(即IP)获取数据
  2. 客户端计算机运行websocket.
  3. 一旦ffmpeg从RTSP服务器获取数据,它将解码并生成任何格式的原始图像(例如:yuv).
  4. 现在,我必须将此图像通过websocket发送到浏览器.

问题:

  1. 这是正确的方法吗?
  2. 如何将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?

  1. Only Mac OS, and Safari supports RTSP Live Streaming.

  2. HTML 5 video does not support RTSP.

  3. 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:

  1. I run ffmpeg to get the data from server (ie: IP)
  2. Client machine runs websocket.
  3. Once ffmpeg gets the data from RTSP Server, it decodes, and generates the raw image of any format (for example: yuv).
  4. Now, i have to send this image to browser through websocket.

Question:

  1. It is the right approach ?
  2. 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屋!

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