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

我有一个便宜的中文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/

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...