60 FPS video proccessing

Hi there, I am trying to proccess 60fps video using opencv cv2.VideoCapture method but when we proccess the video the output video is getting slow and dropping the fps. For this problem i tried some solutions like multithreading but in that case video getting fast than the normal video speed. How do i get the normal speed of the 60fps video in opencv ?

there is no thing like that
(unreasoable expectation, assuming, you’re using off-the -shelf hw)

how would that be ? are you trying to write a video file ?
(and that runs too fast, bc processing makes it time-lapse ?)

processing isn’t for free. please show, what you’re doing, maybe we can help optimizing it a bit

opencv does a lot of data-parallel multithreading under the hood. tacking your own thread parallel thing on top of it rarely helps (and threads aren’t for free, either)

again, show hw / os / opencv version / code

show us what you did. nobody can debug what they aren’t being shown.

hw- Dell 11th Gen Intel(R) Core™ i7-11390H @ 3.40GHz 2.92 GHz
os- windows 11pro
opencv version- 4.6.0

I am trying to read the video of 60fps

 if os.path.isfile(self.frame_source) and pathlib.Path(self.frame_source).suffix.lower() in ['.mp4', '.mov',
                                                                                                        '.avi', '.mkv']:
                cap = cv2.VideoCapture(self.frame_source)
            else:
                raise TypeError("Unsupported file type or file extensions.")

            try:
                while True:
                    if cap and not cap.isOpened:
                        break

                    if cap:
                        ret, frame = cap.read()

                    if cap and ret:
                        h, w = frame.shape[:2]
                        if w > h:
                            p = abs(h - w) // 2
                            frame = cv2.copyMakeBorder(frame, p, p, 0, 0, cv2.BORDER_CONSTANT)

                    if ret:
                        # detect & generate face landmarks using mediapipe.
                        self.detect_face_landmarks(frame)
                        # save landmarks in PLY
                        self.save_ply(tc)

                        if self.need_visualiser:
                            pcd, vis, app = self.open3d(pcd, vis, app)

                        self.frm += 1
                        tc.add_frames(1)

                    # display frames in window.
                    if cap or ret:
                        cv2.imshow("Vide File", frame)

                    # press 'esc' key to quit frame display and visualiser.
                    if cv2.waitKey(1) & 0xFF == 27:
                        break

probably the bottleneck here …

please properly profile your code, before making assumptions about what / how to optimize