我一直在研究使用 C# 开发视频流 Web 服务的解决方案。我正在使用带有最新版本 vlc 1.0.3 的 Windows XP 通过 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}"
任何答复将不胜感激。
谢谢!=)