@@ -103,7 +103,14 @@ def update_video_frame():
103
103
photo = ImageTk .PhotoImage (image = img )
104
104
video_label .config (image = photo )
105
105
video_label .image = photo
106
- video_player .after (10 , update_video_frame )
106
+
107
+ # Get the actual frame rate of the video
108
+ frame_rate = video_cap .get (cv2 .CAP_PROP_FPS )
109
+
110
+ # Calculate the delay based on the original frame rate
111
+ delay = int (1000 / frame_rate )
112
+
113
+ video_player .after (delay , update_video_frame ) # Delay based on frame rate
107
114
else :
108
115
video_player .destroy ()
109
116
@@ -215,7 +222,7 @@ def show_image_in_gallery(img_path, img_name):
215
222
# Create buttons
216
223
capture_button = tk .Button (root , text = "Capture" , command = capture_image )
217
224
record_button = tk .Button (root , text = "Record" , command = start_recording )
218
- stop_button = tk .Button (root , text = "Stop" , command = stop_recording )
225
+ stop_button = tk .Button (root , text = "Stop Recording " , command = stop_recording )
219
226
gallery_button = tk .Button (root , text = "Gallery" , command = open_gallery )
220
227
quit_button = tk .Button (root , text = "Quit" , command = root .quit )
221
228
0 commit comments