嗨,我正在尝试将Opencv VideoWriter的输出保存到AWS S3
,但是此代码似乎不起作用。
您是否有任何想法要更改VaideoWriter输出的路径?
'''代码
fourcc = cv2.VideoWriter_fourcc(*'XVID')
AWS_path = 'https://bucket.s3.ap-northeast-2.amazonaws.com/media/video/'
filename = 'temporary_video.mp4'
pull_path = AWS_path + filename
out = cv2.VideoWriter(pull_path,fourcc,fps,(int(width),int(height)))
while (cap.isOpened()):
hasframe,frame= cap.read()
if hasframe== True:
# print('떠라')
# if hasframe is None:
datum = op.Datum()
datum.cvInputData = frame
opWrapper.emplaceAndPop([datum])
# Display Image
# print("Body keypoints: \n" + str(datum.poseKeypoints))
# print("Face keypoints: \n" + str(datum.faceKeypoints))
# print("Left hand keypoints: \n" + str(datum.handKeypoints[0]))
# print("Right hand keypoints: \n" + str(datum.handKeypoints[1]))
# cv2.imshow("OpenPose 1.5.0 - Tutorial Python API",datum.cvOutputData)
# cv2.waitKey(1)
out.write(datum.cvOutputData)
else:
break
cap.release()
out.release()