libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] JPEG Streaming with libmicrohttpd


From: Erik Slagter
Subject: Re: [libmicrohttpd] JPEG Streaming with libmicrohttpd
Date: Fri, 12 Nov 2010 17:16:37 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4 ThunderBrowse/3.3.2

So you don't need to call MHD_queue_response for each frame? Just copying
the data into the buffer in the callback is enough to send the data to the
client? What about the inter-frame headers,
--myboundary
Content-Type: image/jpeg
Do I just put these manually in the callback buffer at the start of the JPEG
data? ie. not using MHD_add_reponse_header?

If I may be so inappropriate to answer this ;-)

The whole point of a motion jpeg stream is that it consists of a more or less "normal" sequence of http headers, declaring the content type ("multipart/x-mixed-preplace"), length (if known) etc. Then an empty line follows. An empty line in http _always_ means the end of the headers. What follows after the empty line is data, although it's not just data, it's structured to enable the client to split it at appropriate points, the "--myboundary" lines and the lines that follow until another empty line. These may be specified by http, but from the standpoint of libmicrohttpd it's all just data.

So, the initial few lines of headers are to be constructed using MDH_queue_response, everything else, including the MIME headers that follow, are passed to libmicrohttpd as if it were plain data.

Interesting project BTW, I might implement something like this for the webcam in the baby's room, I am now using a construction with ffmpeg and apache, which is a bit overkill.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]