繁体   English   中英

如何使用C#创建视频流

[英]How to create video streaming using C#

我一直在研究使用C#开发视频流Web服务的解决方案。 我正在使用Windows XP和vlc 1.0.3的最新版本通过LAN网络传输视频。 但是,目前,我只能在自己的PC上流式传输视频。 现在的问题是,我需要在Web服务中执行此流按钮。 有谁知道如何将其更改为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}"

任何答复将不胜感激。

谢谢! =)

VLC是一个桌面应用程序。 不适合在服务器上使用。 您真的想要一个流服务器。 对于网络,我建议将视频转码为H264(使用ffmpeg),然后将其与RTMP服务器一起提供给Adobe Flash Player,您可以将其嵌入网页中。 该服务器有很多选择,包括商用和免费。

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

开源:

FluorineFX http://fluorinefx.com/

Red5 http://osflash.org/red5

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

卡尔图拉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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM