我使用 GET nphMotionJpeg 从 IP Camera Panasonic 获取 Motion Jpeg 流。响应内容在下面的文档中进行了描述。
(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 图像数据时遇到的问题是它不让我知道每个图像的大小。
当没有图像大小时,这很难处理。
我必须尝试编写一个算法来做到这一点,但我太老练了。它可能会影响系统性能,并且可能存在更多错误。
你能建议我一个简单的方法吗?