嗨,大家好,我被困在这一点上.我想用opencv在屏幕上播放四个视频.任何人都可以帮我怎么做?假设我想同时玩
我指的是以下代码.它对单个avi文件非常有效.是否有必要连接或我可以在四个不同的窗口运行?欢迎任何建议导入cv2 import numpy as np
# Create a VideoCapture object and read from input file
# If the input is the camera, pass 0 instead of the video file name
cap = cv2.VideoCapture('first.avi')
cap2 =cv2.VideoCapture('second.avi')
if (cap.isOpened()== False):
print("Error opening video stream or file")
if (cap2.isOpened()== False):
print("Error opening video stream or file")
while(cap.isOpened()||cap2.isOpened()):
# Capture frame-by-frame
ret, frame = cap.read()
ret, frame1 = cap2.read()
if ret == True:
# Display the resulting frame
cv2.imshow('Frame',frame) …Run Code Online (Sandbox Code Playgroud)