Thank you Patrice for fast answer!
The ASHX handler seems to work faster but as you wrote, it will not solve
the main problem with the ASP.NET headers. I did some tests and found that
I
still have performance problem. ASP.NET is not able to deliver 30 JPEG
frames
with 800*600 pixels / second. I still need to work with the HTTP stream
directly. Is there any way to handle the HTTP stream directly or do I need
to
build a dll for ASP or an external web server?
Is there any existing solution or sample who handles MJPEG with ASP.NET?
I'm working with a server product that will capture MJPEG frames from an
IP
camera and store this frames on a server. The frames will then be
available
as a video on a Web page.
Here is a part of code used for tests:
oResponse.ClearContent();
oResponse.BufferOutput = true;
oResponse.ContentType = "multipart/x-mixed-replace; boundary=myboundary";
oResponse.CacheControl = "no-cache";
for( ix = 0; ix < iFramesInBuffer; ix++ )
{
sBundary = "--myboundary\r\nContent-Type: image/jpeg\r\nContent-Length: "
+ images[ ix ].FrameSize.ToString() + sSeparator;
boundary = Encoding.ASCII.GetBytes( sBundary );
oResponse.OutputStream.Write( boundary , 0 , boundary.Length );
oResponse.OutputStream.Write( images[ ix ].Frame , 0 , images[ ix
].FrameSize );
oResponse.Flush();
System.Threading.Thread.Sleep( 10 );
}
// Stefan
Patrice said:
If with ASPX you have no way to suppress it, you could likely do that
with a
custom handler.
See
http://dotnetperls.com/ashx-handler (even if you can, by using an
ASHX
handler you'll bypass the webform infrastructure you likely don't need in
this particular case so you may want to try directly a handler).
--
Patrice
"Stefan Soljemo" <
[email protected]> a écrit dans le message de
groupe de discussion :
(e-mail address removed)...
.