MJpegストリームを生成し、それをVLCにストリーミングして、そこで再生しようとしています。
コード:
public void SendMultiPartData(String contentType, Func<byte[]> getData)
{
MemoryStream mem = null;
response.StatusCode = 200;
for ( byte[] buffer = getData(); buffer != null && buffer.Length > 0; buffer = getData())
{
response.ContentType = "multipart/x-mixed-replace; boundary=--testboundary";
ASCIIEncoding ae = new ASCIIEncoding();
byte[] boundary = ae.GetBytes("\r\n--testboundary\r\nContent-Type: " + contentType + "\r\nContent-Length:" + buffer.Length + "\r\n\r\n");
mem = new MemoryStream(boundary);
mem.WriteTo(response.OutputStream);
mem = new MemoryStream(buffer);
mem.WriteTo(response.OutputStream);
response.OutputStream.Flush();
}
mem.Close();
listener.Close();
}
Firefoxでストリームを開こうとすると、まったく問題はありませんが、VLCでは機能しません(VLCは読み続けているようですが、ビデオは表示されません)
私はVLCからVLCへのストリーミングをスニッフィングしてきましたが、multipart/x-mixed-replaceの代わりにHTTPヘッダー「application/octet-stream」として使用されているようです。
何か案は ?
事前にTks、ホセ