我使用GET nphMotionJpeg从IP Camera Panasonic获取Motion Jpeg流。 响应内容在下面的文档中描述。如何从IP摄像机的Motion Jpeg Stream中提取图像?
(2) Data reception
"HTTP/1.0 200 OK\r\n"
"Content-Type: multipart/x-mixed-re place; bound ary=--myboundary..."
"...--myboundary.Content-type: image/jpeg..."
JPEG binary data No. 1 (Hexadecimal notation="FFD8...... ........................ ..FFD9")
"...--myboundary.Content-type: image/jpeg..."
JPEG binary data No. 2 (Hexadecimal notation="FFD8...... ........................ ..FFD9")
:
:
"...--myboundary.Content-type: image/jpeg..."
JPEG binary data No. N (Hexadecimal notation="FFD8...... ........................ ..FFD9")
* Above mentioned Content-type: From FFD8(following image/jpeg) to "--my boundary" (just before FFD9)
is 1 JPEG data file.
(3) Image displaying/saving
From the data above, extract JPEG data, and display the extracted consecutively or save it.
A viewer that supports the above data is required to view images.
我试图从上面的响应内容中提取jpeg图像数据时遇到的问题是它不让我知道每个图像的大小。
这是非常难处理时,没有图像的大小。
我必须尝试写一个算法来做到这一点,但我非常复杂。它可能会影响系统性能,也可能存在更多的错误。
你能告诉我一个简单的方法吗?
http://stackoverflow.com/questions/6022423/mjpeg-streaming-and-decoding – 2012-02-10 18:55:05