Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I just copied an program to detect faces through video but the video capture is really slow, and i dont know how to fix it! Every time when I change the FPS same value is return which is 59.98... I try lots of solution in Stack (mostly use C++ language and thread or timer tick ) but still I get the same fps.

What I have tried:

C#
private void StartButton_Click(object sender, EventArgs e)
       {
           grabber = new VideoCapture(videoPath);
           grabber.QueryFrame();
           //System.Threading.Thread.Sleep(1000);
           grabber.SetCaptureProperty(CapProp.Fps, 100); //fps setting  default 5
           Console.WriteLine("Show FPS   ->>>> " + grabber.GetCaptureProperty(CapProp.Fps));
           Application.Idle += new EventHandler(FrameGrabber);
           StartButton.Enabled = false;
       }

       void FrameGrabber(object sender, EventArgs e)
       {
           currentFrame = grabber.QuerySmallFrame(); //Orginalley use QueryFrame() method.
           Image<Bgr, Byte> currentImageFrame = currentFrame.ToImage<Bgr, Byte>();
           currentImageFrame.Resize(320, 240, Emgu.CV.CvEnum.Inter.Cubic);
           gray = currentImageFrame.Convert<Gray, byte>();

           Rectangle[] facesDetected = Face.DetectMultiScale(gray, 1.01, 7, new Size(30, 30));
           numberLabel.Text = "";
           .
           .
           .
        }
Posted
Updated 26-Apr-19 5:09am
v6
Comments
Patrice T 26-Apr-19 7:44am    
Why don't you ask the author ?
Elif Özçiftci 26-Apr-19 7:54am    
I did ask another question to author. He/She does not reply that's why I'm asking.
Patrice T 26-Apr-19 8:11am    
Giving library references may help too.

1 solution

FPS is a function of your graphics card abilities. The lower the FPS, the lamer the card. FPS is not something you "set". Read the vendor documentation for that card.

90 FPS is a card that supports VR (without making people sick), and is on the high-end.
 
Share this answer
 
Comments
Elif Özçiftci 29-Apr-19 1:40am    
I can change FPS with iDealshare VideoGo 6. But I want to change FPS while program processing. Why FPS can change with program but not with Video Capture library? I think there is no relation between graphics card abilities and FPS in this situations. I suppose about video character but I'm not sure about that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900