Click here to Skip to main content
11,806,350 members (64,898 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET4
any code for live streaming in using c#
thanks in advance
Posted 23-Jun-12 6:01am
Edited 23-Jun-12 6:02am
Joseph-Ali at 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.)?
مجاهد أحمد at 13-Nov-13 0:55am
how can i stream for capture web cam?
Member 9695480 at 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?
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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;
nariman008 at 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)

  Print Answers RSS
0 Richard Deeming 205
1 Sergey Alexandrovich Kryukov 170
2 ppolymorphe 145
3 OriginalGriff 135
4 Abhinav S 120
0 OriginalGriff 3,330
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,905
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 26 Mar 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100