feat(app): add new preset video and refine comparison flow
This commit is contained in:
@@ -36,7 +36,7 @@ class MotionComparisonApp:
|
||||
st.session_state.comparison_state = {'is_running': False, 'should_stop': False, 'should_restart': False}
|
||||
|
||||
def get_display_resolution(self):
|
||||
modes = {'high': (1280, 800), 'medium': (960, 720), 'low': (640, 480)}
|
||||
modes = {'high': (1024, 576), 'medium': (960, 720), 'low': (640, 480)}
|
||||
mode = self.display_settings.get('resolution_mode', 'medium')
|
||||
return modes.get(mode, (960, 720))
|
||||
|
||||
@@ -74,6 +74,7 @@ class MotionComparisonApp:
|
||||
try:
|
||||
self.webcam_cap = cv2.VideoCapture(0)
|
||||
if self.webcam_cap.isOpened():
|
||||
self.webcam_cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))
|
||||
width, height = self.get_display_resolution()
|
||||
self.webcam_cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
|
||||
self.webcam_cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
|
||||
|
||||
Reference in New Issue
Block a user