去除FFMPEG后端

This commit is contained in:
2025-12-19 08:56:58 +08:00
parent c51757f66b
commit 8c0727990e
22 changed files with 163 additions and 33 deletions

View File

@@ -10,7 +10,7 @@ running = True
def video_thread():
global frame, running
cap = cv2.VideoCapture(0, cv2.CAP_ANY)
cap = cv2.VideoCapture(1, cv2.CAP_ANY)
cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc(*"YUYV"))
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
@@ -18,7 +18,7 @@ def video_thread():
if not cap.isOpened():
print("[ERROR] Cannot open camera", file=sys.stderr)
running = Falseq
running = False
return
while running:
@@ -26,7 +26,13 @@ def video_thread():
if not ret:
break
frame = f.copy()
cv2.imshow('Live Feed (Local Display)', f)
# print(frame.shape)
# frame = cv2.resize(frame, (1280, 720))
# print(frame.shape)
cv2.namedWindow('AHD Video', cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProperty('AHD Video', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
cv2.imshow('AHD Video', f)
# cv2.showFullscreen('Live Feed (Local Display)', f)
if cv2.waitKey(1) & 0xFF == ord('q'):
running = False
break