Answers for "make python play a video"

15

play videos in python

from playsound import playsound
playsound('audio.mp3')
Posted by: Guest on May-06-2020
-2

how to play videos using python

import numpy as np
import cv2

cap = cv2.VideoCapture(0)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Our operations on the frame come here
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    # Display the resulting frame
    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
Posted by: Guest on November-20-2019

Python Answers by Framework

Browse Popular Code Answers by Language