FPS মান পেতে, আমরা 'get()' এর আর্গুমেন্ট হিসেবে 'get()' কমান্ড এবং 'CAP_PROP_FPS' ব্যবহার করেছি। এই যুক্তি পূর্ণসংখ্যা আকারে FPS প্রদান করে।
প্রোগ্রামের শুরুতে, আমরা 'FPS' নামে একটি পূর্ণসংখ্যা ভেরিয়েবল নিয়েছি। তারপর আমরা FPS =cap.get(CAP_PROP_FPS); ভেরিয়েবলে FPS মান সংরক্ষণ করতে।
নিম্নলিখিত প্রোগ্রামটি একটি ভিডিওর FPS পায় এবং এটি কনসোল উইন্ডোতে দেখায়৷
৷উদাহরণ
#include<opencv2/opencv.hpp>//OpenCV header to use VideoCapture class//
#include<iostream>
using namespace std;
using namespace cv;
int main() {
int FPS;//Declaring an integer variable to store the number of total frames//
VideoCapture cap("video1.mp4");//Declaring an object to capture stream of frames from default camera//
FPS = cap.get(CAP_PROP_FPS);//Getting the total number of frames//
cout << "Total Number of frames are:" << FPS << endl;//Showing the number in console window//
system("pause");//Pausing the system to see the result
cap.release();//Releasing the buffer memory//
return 0;
} এই প্রোগ্রামটি চালু করার পরে, আমরা কনসোল উইন্ডোতে FPS মান পাব।
আউটপুট
