Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
any code for live streaming in asp.net using c#
thanks in advance
Posted
Updated 23-Jun-12 6:02am
v2
Comments
Joseph-Ali 9-Jul-12 9:04am    
This depends on where from and where to you want to stream (web client to another web client, server to general client, etc.)

Also, what exactly do you mean by "live" streaming? Will you be streaming from a capture source such as web cam?

Finally, are there any restrictions on the video format and the compression used (MPEG2, H264, Flash video, etc.)?
mujju9503 13-Nov-13 0:55am    
how can i stream for capture web cam?
ramakant verma 10-Nov-15 1:01am    
Hi Joseph
I am working on online virtual class room kind of application. where i have to achieve live video stream from web client(Teacher) to mutiple web clients(Students).
Can you please provide any help regarding this.
Member 9695480 21-May-13 4:54am    
Moi je souhaite envoyer le flux de la webcam en Streaming sur ma page aspx. Comment procéder? j'utilise la bibliothèque AForge qui me permet de détecter la webcam et de l'activer mais après ces étapes, je ne sais plus trop comment procéder. Pouvez vous m'aider?

C#
public void ProcessRequest(HttpContext context) {
    // read input etx
    context.Response.Buffer = false;
    context.Response.ContentType = "text/plain";
    string path = @"c:\somefile.txt";
    FileInfo file = new FileInfo(path);
    int len = (int)file.Length, bytes;
    context.Response.AppendHeader("content-length", len.ToString());
    byte[] buffer = new byte[1024];
    Stream outStream = context.Response.OutputStream;
    using(Stream stream = File.OpenRead(path)) {
        while (len > 0 && (bytes =
            stream.Read(buffer, 0, buffer.Length)) > 0)
        {
            outStream.Write(buffer, 0, bytes);
            len -= bytes;
        }
    }
}
 
Share this answer
 
Comments
nariman008 10-Sep-14 3:26am    
hi larry what is this code for? can i put a video or audio path to it and get that stream in my android phone?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900