加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 来自廉价中文IP网络摄像头的JPEG流是什么格式的?

发布时间:2020-12-14 01:25:17 所属栏目:Linux 来源:网络整理
导读:我有一个便宜的中文IP网络摄像头,它有一个显示实时视频的网络界面.该视频似乎是一系列输入浏览器的jpeg图像.如果我在URL http://my-ip-camera/video.cgi指向wget,我会收到以下格式的大量流数据: --ipcameraContent-Type: image/jpegContent-Length: 46056JF
我有一个便宜的中文IP网络摄像头,它有一个显示实时视频的网络界面.该视频似乎是一系列输入浏览器的jpeg图像.如果我在URL http://my-ip-camera/video.cgi指向wget,我会收到以下格式的大量流数据:

--ipcamera
Content-Type: image/jpeg
Content-Length: 46056

JFIF header data
... lots of data ...

每个“框架”都会重复这种模式.

这是一种“标准”流媒体格式,我可以用某些东西进行播放/转码,还是一些强制进入我浏览器的JPEG集合,只是尽可能快地渲染它们?

我尝试使用VLC,但无法处理URL.

我的IP cam中的软件非常糟糕,所以我想捕获这个流并在我的Linux机器上处理它.我可以使用一些ffmpeg / mplayer工具来做这个吗?

解决方法

看起来像MIME multipart以“ipcamera”为边界.

http://en.wikipedia.org/wiki/MIME#Multipart_messages

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="frontier"

This is a message with multiple parts in MIME format.
--frontier
Content-Type: text/plain

This is the body of the message.
--frontier
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64

PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==

你能发布数据的最开头吗?

有很多库可以使用MIME multipart.我想,您应该找到JS库来解析MIME-multipart并将其传递给浏览器的动态DOM.或者,您可以使用带有MIME支持的perl或其他脚本,并从此流中获取jpeg.

更新:

实际上,这是“M-JPEG over HTTP”http://en.wikipedia.org/wiki/Motion_JPEG#M-JPEG_over_HTTP

The server software mentioned above streams the sequence of JPEGs over HTTP. A special mime-type content type multipart/x-mixed-replace;boundary= informs the browser to expect several parts as answer separated by a special boundary. This boundary is defined within the MIME-type. For M-JPEG streams the JPEG data is sent to the client with a correct HTTP-header. The TCP connection is not closed as long as the client wants to receive new frames and the server wants to provide new frames. Two basic implementations of such a server are test-server “cambozola” and webcam server “MJPG-Streamer”.

以下是此格式生成http://nakkaya.com/2011/03/23/streaming-opencv-video-over-the-network-using-mjpeg/的一个示例 – 它非常适合您.

这是一个python客户端:http://code.google.com/p/python-mjpeg-over-http-client/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读