如何使用C#创建视频流。

8
我一直在使用C#开发视频流网络服务的解决方案。我使用Windows XP系统,最新版本的VLC 1.0.3来通过局域网进行视频流传输。但是目前,我只能在自己的电脑上进行视频流传输。现在的问题是我需要将这个流按钮放到网络服务中。有没有人知道如何将其改为Web方法?如何将这个Web服务链接到HTML网页?
以下代码用于使用Windows应用程序进行流媒体传输。
    private void btnStream_Click(object sender, EventArgs e)
    {
        // Create process and command to run file
        System.Diagnostics.ProcessStartInfo psi =
          new System.Diagnostics.ProcessStartInfo(@"C:\videotest.bat");

        psi.RedirectStandardOutput = true;

        psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

        psi.UseShellExecute = false;

        System.Diagnostics.Process listFiles;

        listFiles = System.Diagnostics.Process.Start(psi);

        System.IO.StreamReader myOutput = listFiles.StandardOutput;

        listFiles.WaitForExit(2000);
        if (listFiles.HasExited)
        {
            string output = myOutput.ReadToEnd();
            //this.processResults.Text = output;
        }
    }

----- C:\videotest.bat ------

cd "C:\PROGRA~1\VideoLAN\VLC"
vlc c:\alvinchipmunks.vob --sout "#transcode{vcodec=h264,vb=800,scale=1,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=std{access=udp,mux=ts,dst=152.226.238.64:1234},dst=std{access=udp,mux=ts,dst=152.226.238.59:1234},dst=display}"

任何回复都将不胜感激。
谢谢!=)
1个回答

4

VLC是一个桌面应用程序,不适合在服务器上使用。您真正需要的是一个流媒体服务器。对于网络,我建议转码视频为H264(使用ffmpeg),然后使用RTMP服务器提供Adobe Flash播放器,您可以将其嵌入到网页中。有许多服务器选项,包括商业和免费。

您还可以简单地发布视频,并使用http下载或某些模拟http流的实现。

开源:

FluorineFX http://fluorinefx.com/

Red5 http://osflash.org/red5

RubyIZUMI http://code.google.com/p/rubyizumi/

Kaltura http://osflash.org/kaltura

haxeVideo http://code.google.com/p/haxevideo

商业:

Adobe Flash Media Server http://www.adobe.com/products/flashmediaserver/

Wowza http://www.wowzamedia.com


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接