logo

Crowdly

Browser

Add to Chrome

import cv2 video_input = cv2.VideoCapture(0) frame_size = (int(video_input.g...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

import cv2

video_input = cv2.VideoCapture(0)

frame_size = (int(video_input.get(3)), int(video_input.get(4)))

video_output = cv2.VideoWriter('video.avi', cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'), 20, frame_size)

while(video_input.isOpened()):

  ret, frame = video_input.read()

  if ret:

    ...

    key = cv2.waitKey(20)

    if key == ord('q'):

      break

  else:

    break

video_input.release()

video_output.release()

cv2.destroyAllWindows()

Для наведеного вище коду вкажіть рядки, які треба вставити на місці ..., щоб комп’ютерна програма мовою Python читала та відображала у вікні із заголовком “My Video” відеопотік з веб-камери і зберігала його у файлі з ім’ям “video.avi” за допомогою бібліотеки OpenCV:

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on exam.nuwm.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome