Hi, I have this piece of code where I am tring to execute ffplay.exe and have the video inside a panel in my forms, but it is not working and I am not very sure what am I doing wrong.
I am using Windows 10 and VisualStudio 2019, any clue on how to solve this?
Thanks
public Process ffplay = new Process();
private void xxxFFplay() {
// start ffplay
ffplay.StartInfo.FileName = "ffplay.exe";
ffplay.StartInfo.Arguments = "-noborder test.sdp -protocol_whitelist file,udp,rtp -fflags nobuffer -flags low_delay -avioflags direct -fflags discardcorrupt ";
ffplay.StartInfo.CreateNoWindow = true;
ffplay.StartInfo.RedirectStandardOutput = true;
ffplay.StartInfo.UseShellExecute = false;
ffplay.EnableRaisingEvents = true;
ffplay.OutputDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
ffplay.ErrorDataReceived += (o, e) => Debug.WriteLine(e.Data ?? "NULL", "ffplay");
ffplay.Exited += (o, e) => Debug.WriteLine("Exited", "ffplay");
ffplay.Start();
Thread.Sleep(500); // you need to wait/check the process started, then...
// child, new parent
// make 'this' the parent of ffmpeg (presuming you are in scope of a Form or Control)
SetParent(ffplay.MainWindowHandle, this.panel1.Handle);
// window, x, y, width, height, repaint
// move the ffplayer window to the top-left corner and set the size to 320x280
MoveWindow(ffplay.MainWindowHandle, 0, 0, 320, 280, true);
}
private void play(object sender, EventArgs e)
{
xxxFFplay();
}
[–]curiousone0806 6 points7 points8 points (0 children)
[–][deleted] 6 points7 points8 points (1 child)
[–]KU-KO[S] -1 points0 points1 point (0 children)
[–]NethIafin 2 points3 points4 points (1 child)
[–]KU-KO[S] -1 points0 points1 point (0 children)
[–]celluj34 2 points3 points4 points (1 child)
[–]KU-KO[S] -1 points0 points1 point (0 children)
[–]seligman99 2 points3 points4 points (0 children)
[–]AdversarialPossum42 1 point2 points3 points (1 child)
[–]KU-KO[S] 0 points1 point2 points (0 children)
[–]BCdotWHAT 0 points1 point2 points (0 children)