gpt4 book ai didi

c# - 如何使用 C# 创建视频流

转载 作者:太空狗 更新时间:2023-10-29 19:43:23 25 4
gpt4 key购买 nike

我一直在研究使用 C# 开发视频流 Web 服务的解决方案。我正在使用 Windows XP,使用最新版本的 vlc 1.0.3 通过 LAN 网络传输视频。但是,目前,我只能设法在自己的 PC 上播放视频。现在的问题是我需要改为在 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 服务器提供给 Adob​​e Flash 播放器,您可以将其嵌入到网页中。服务器有多种选择,包括商业版和免费版。

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

开源:

FluorineFX http://fluorinefx.com/

红5 http://osflash.org/red5

泉 ruby http://code.google.com/p/rubyizumi/

卡尔图拉 http://osflash.org/kaltura

haxe视频 http://code.google.com/p/haxevideo

商业:

Adobe Flash 媒体服务器 http://www.adobe.com/products/flashmediaserver/

哇扎 http://www.wowzamedia.com

关于c# - 如何使用 C# 创建视频流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2041864/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com