What format is this jpeg stream from my cheap chinese ip webcam?

I have a cheap Chinese IP webcam that has a web interface featuring live video. The video looks like a sequence of jpeg images uploaded to the browser. If I point wget to the URL http: //my-ip-camera/video.cgi , I get a large piece of streaming data in the following format:

--ipcamera Content-Type: image/jpeg Content-Length: 46056 JFIF header data ... lots of data ... 

this pattern is repeated for each β€œframe”.

Is this a β€œstandard” streaming format that I can play / transcode with something, or is it some kind of constituent collection of JPEG files stored in my browser that just makes them as fast as possible?

I tried using VLC but could not process the URL.

The software in my IP camera is pretty awful, so I want to capture this stream and process it on my Linux machine. Is there any collection of ffmpeg / mplayer tools that I can use for this?

+4
source share
2 answers

It looks like a MIME multipart with "ipcamera" as a border.

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 the data?

There are many libraries for working with MIME multipart. I think you should find a JS library to parse the MIME-multipart and transfer it to a dynamic DOM browser. Or you can use perl or other MIME-enabled scripts and get jpegs from this stream.

UPDATE:

in fact, this is "M-JPEG over HTTP" http://en.wikipedia.org/wiki/Motion_JPEG#M-JPEG_over_HTTP

The server software mentioned above transmits a sequence of JPEG files via HTTP. Special content type mime multipart / x-mixed-replace; border = tells the browser that multiple parts as a response are separated by a special border. This boundary is defined in the MIME type. For M-JPEG streams, JPEG data is sent to the client with the correct HTTP header. A TCP connection does not close while the client wants to receive new frames, and the server wants to provide new frames. The two main implementations of such a server are the cambozola test servers and the MJPG-Streamer webcam.

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

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

+6
source

Sounds like Motion JPEG, or at least a variant of it.

+4
source

Source: https://habr.com/ru/post/1246543/


All Articles