Eccolo in working in process:
private void Live_Load(object sender, EventArgs e)
{
…..
// init Process
Play1.StartInfo.FileName = "ffplay.exe ";
Play1.StartInfo.Arguments = " -af volume=0.0 -i indirizzo_stream -vf scale=400:190 ";
Play1.StartInfo.CreateNoWindow = true;
Play1.StartInfo.UseShellExecute = false;
……
// Call StartStream fro start stream view
StartStream();
}
private void StartStream()
{
//Play1 into panel 1
Stopwatch sw1 = new Stopwatch();
// inizio process per play
Play1.Start();
// impaginazione in una panel
int timeout1 = 10 * 1000;
while (Play1.MainWindowHandle == IntPtr.Zero)
{
Play1.Refresh();
}
if (sw1.ElapsedMilliseconds > timeout1)
{
sw1.Stop();
return;
}
SetParent(Play1.MainWindowHandle, this.panel1.Handle);
MoveWindow(Play1.MainWindowHandle, -10, -30, 420, 230, true);
}
|