✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
import cv2...frame_size = (frame_width, frame_height)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: cv2.imshow('My Video', frame) video_output.write(frame) key = cv2.waitKey(20) if key == ord('q'): break else: breakvideo_input.release()video_output.release()cv2.destroyAllWindows()Для наведеного вище коду вкажіть рядки, які треба вставити на місці ..., щоб комп’ютерна програма мовою Python читала та відображала у вікні із заголовком “My Video” файли з поточної папки з іменами “image001.jpg”, “image002.jpg”, “image003.jpg” тощо і зберігала сформованевідео у файлі з ім’ям “video.avi” за допомогою бібліотеки OpenCV: