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?
Looks like MIME multipart with “ipcamera” as boundary.
http://en.wikipedia.org/wiki/MIME#Multipart_messages
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
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/