Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我可以将opencv VideoWriter的输出保存到AWS S3存储器中吗?_Python_Opencv - Fatal编程技术网

Python 我可以将opencv VideoWriter的输出保存到AWS S3存储器中吗?

Python 我可以将opencv VideoWriter的输出保存到AWS S3存储器中吗?,python,opencv,Python,Opencv,嗨,我正在尝试将Opencv VideoWriter的输出保存到AWS S3 但是这个代码似乎不起作用 您是否有任何更改VaideoWriter输出路径的想法 ''代码 你能添加一个比“不工作”更详细的错误描述吗?谢谢你的评论,这段代码没有任何错误消息。但是,在AWS S3存储中,没有输出文件。似乎VideoWriter找不到路径。你应该把它添加到你的问题中。 fourcc = cv2.VideoWriter_fourcc(*'XVID') AWS_path = 'https:

嗨,我正在尝试将Opencv VideoWriter的输出保存到AWS S3

但是这个代码似乎不起作用

您是否有任何更改VaideoWriter输出路径的想法

''代码


你能添加一个比“不工作”更详细的错误描述吗?谢谢你的评论,这段代码没有任何错误消息。但是,在AWS S3存储中,没有输出文件。似乎VideoWriter找不到路径。你应该把它添加到你的问题中。
    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()