[error] TypeError: must be real number, not tuple 오류

최대 1 분 소요

  • 에러 내용

  • 문제 코드

  • 문제 원인
    저장할 path(str타입)를 output 변수에 저장해서 처리하면
    VideoWriter에서 output 사용할 때 str으로의 참조값이 들어감

  • 해결
    변수를 사용하지 말고 대신 저장할 “경로” 직접 삽입

    writer = cv2.VideoWriter('/videos/result.avi',fourcc,30,(frame.shape[1],frame.shape[0],True)
    

댓글남기기