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

发布于 2024-12-03 05:06:41 字数 513 浏览 1 评论 0原文

我有一个便宜的中国 IP 网络摄像头,它有一个显示实时视频的网络界面。该视频似乎是输入浏览器的一系列 jpeg 图像。如果我将 wget 指向 URL http://my-ip-camera/video.cgi 我接收以下格式的大量流数据:

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

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

此模式对每个“帧”重复。

这是我可以播放/转码的某种“标准”流格式,还是强行输入我的浏览器的一些 JPEG 集合,只是尽可能快地呈现它们?

我尝试使用 VLC,但它无法处理该 URL。

我的 IP 摄像头中的软件非常糟糕,所以我想捕获这个流并在我的 Linux 机器上处理它。我可以使用一些 ffmpeg/mplayer 工具来执行此操作吗?

I've got a cheap Chinese IP webcam that has a web interface showing live video. The video appears to be a sequence of jpeg images fed into the browser. If I point wget at the URL http://my-ip-camera/video.cgi I receive a big chunk of streamed data in the following format:

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

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

this pattern repeats for every "frame".

Is this some "standard" streaming format I can play/transcode with something, or is it some made up collection of JPEGs forced into my browser that just renders them as quick as it can?

I tried using VLC but it couldn't process the URL.

The software in my IP cam is pretty terrible, so I want to capture this stream and process it on my Linux machine instead. Is there some collection of ffmpeg/mplayer tools I can use to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情绪少女 2024-12-10 05:06:41

看起来像 MIME 多部分,以“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 多部分。我认为,你应该找到JS库来解析MIME-multipart并将其传递到浏览器的动态DOM中。或者您可以使用 perl 或其他支持 MIME 的脚本并从此流中获取 jpeg。

更新:

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

上面提到的服务器软件通过 HTTP 传输 JPEG 序列。特殊的 mime 类型内容类型 multipart/x-mixed-replace;boundary= 通知浏览器期望由特殊边界分隔的多个部分作为答案。该边界是在 MIME 类型中定义的。对于 M-JPEG 流,JPEG 数据会使用正确的 HTTP 标头发送到客户端。只要客户端想要接收新帧并且服务器想要提供新帧,TCP 连接就不会关闭。这种服务器的两个基本实现是测试服务器“cambozola”和网络摄像头服务器“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/

Looks like MIME multipart with "ipcamera" as boundary.

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==

Can you post the very beginning of data?

There are a lot of libraries to work with MIME multipart. I think, you should find JS library to parse MIME-multipart and pass it into dynamic DOM of browser. Or you can use perl or other scripting with MIME support and get jpegs from this stream.

UPDATE:

actually, this is the "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".

Here is an example of this format generation http://nakkaya.com/2011/03/23/streaming-opencv-video-over-the-network-using-mjpeg/ - it is exaclty what you have.

Here is a python client: http://code.google.com/p/python-mjpeg-over-http-client/

就此别过 2024-12-10 05:06:41

听起来像 Motion JPEG,或者至少是其中的一些变体。

Sounds like Motion JPEG, or at least some variant thereof.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文