• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 분석

  • 해결 여부

    미해결

youtube 영상말구 로컬컴퓨터에 있는 mp4를 불러오기

21.01.12 15:44 작성 조회수 112

0

youtube 영상말구 로컬컴퓨터에 있는 mp4를 불러오기는 어떻게 해야하나요?

답변 2

·

답변을 작성해보세요.

0

김태근님의 프로필

김태근

질문자

2021.01.15

답변해주신 코드는 이해가 됩니다.

그럼 youtube 영상은 webengine 위젯을 사용하는데

opencv 방식은 어떤 위젯과 연결해서 사용해야되는지 궁금하네요

연결하는 방법도 코드로 좀 알려주시면 안되나요?

0

다양한 방법이 있으나, 아래 예제 참고하세요. (opencv 이용)

9
<button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary" aria-describedby="--stacks-s-tooltip-61kmwcyz" style="margin:2px;box-sizing:inherit;font:unset;position:relative;padding:0px;border-radius:0px;background-image:none;background-position:initial;background-size:initial;background-repeat:initial;background-attachment:initial;background-origin:initial;background-clip:initial;outline:none;user-select:auto;box-shadow:none;border:initial none initial"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewbox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"></path></svg></button>

If you just want to play an mp4 video, then this opencv program will help you to do that.

import cv2

cap = cv2.VideoCapture("v2.mp4")
ret, frame = cap.read()
while(1):
   ret, frame = cap.read()
   cv2.imshow('frame',frame)
   if cv2.waitKey(1) & 0xFF == ord('q') or ret==False :
       cap.release()
       cv2.destroyAllWindows()
       break
   cv2.imshow('frame',frame)