视频记录

This commit is contained in:
2026-01-08 16:03:39 +08:00
parent 69be82f892
commit 69d093fcb9
18 changed files with 550 additions and 13 deletions

35
check_encoders.py Normal file
View File

@@ -0,0 +1,35 @@
import cv2
print("OpenCV版本:", cv2.__version__)
print("可用的视频编码器:")
# 打印常见编码器是否可用
try:
fourcc = cv2.VideoWriter_fourcc(*"MP4V")
print("MP4V (MPEG-4 Part 2)", "可用")
except Exception as e:
print("MP4V (MPEG-4 Part 2)", "不可用:", e)
try:
fourcc = cv2.VideoWriter_fourcc(*"avc1")
print("avc1 (H.264)", "可用")
except Exception as e:
print("avc1 (H.264)", "不可用:", e)
try:
fourcc = cv2.VideoWriter_fourcc(*"DIVX")
print("DIVX (DivX)", "可用")
except Exception as e:
print("DIVX (DivX)", "不可用:", e)
try:
fourcc = cv2.VideoWriter_fourcc(*"XVID")
print("XVID (Xvid)", "可用")
except Exception as e:
print("XVID (Xvid)", "不可用:", e)
try:
fourcc = cv2.VideoWriter_fourcc(*"MJPG")
print("MJPG (Motion JPEG)", "可用")
except Exception as e:
print("MJPG (Motion JPEG)", "不可用:", e)