RedHat Linux 9
Perl v5.8.0 built for i386-linux-thread-multi

I am trying to parse a mjpeg stream out of an html response. The http server 
is using server push to push the stream of jpegs to the client. I have 
written a test client and am able to receive the stream but am having trouble 
figuring out what Perl libraries I need to use to separate and save the 
individual jpegs as actual jpegs and not MIME encoded data.

The Content Type is "multipart/x-mixed-replace; boundary=--myboundary". 
"--myboundry" is the flag used to delimit the individual data fields.

This is a stream of JPEGs so, the server will continue streaming as long as 
the connection is open. I am using the Net::HTTP library since I have to 
parse as it arrives rather than wait for the whole page to be downloaded 
(since it can't be). 

The stream's format:
#---------------------------------------------------------------------------------
HTTP/1.0 200 OK
Connection: Close
Server: Camd
Content-Type: multipart/x-mixed-replace; boundary=--myboundary

--myboundary
Content-Type: image/jpeg

<SOME JPEG IMAGE>

--myboundary
Content-Type: image/jpeg

<SOME JPEG IMAGE>

--myboundary
Content-Type: image/jpeg

<SOME JPEG IMAGE>

--myboundary
.
.
.
#---------------------------------------------------------------------------------

I am able to break all of the pieces out of the original stream and am 
currently just saving them to a file:
chunk-1.mime
#---------------------------------------------------------------------------------

Content-Type: image/jpeg

<SOME JPEG IMAGE>

#---------------------------------------------------------------------------------

Can anyone point me in the direction of the libraries or tools I need to use 
to export the encoded <SOME JPEG IMAGE> to a raw JPEG so I can save it to a 
file?

thanks,
Christopher



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to