Answers for "python cv2 videocapture"

7

how to read video in opencv python

import numpy as np
import cv2
cap = cv2.VideoCapture('videos/wa.avi')
while(cap.isOpened()):
  ret, frame = cap.read()
  gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  cv2.imshow('frame',gray)
  if cv2.waitKey(1) & 0xFF == ord('q'):
    break

cap.release()
cv2.destroyAllWindows()
Posted by: Guest on June-18-2020
0

cv2.videocapture python set frame rate

#on efficient solution

frame_rate = 10
prev = 0

while capturing:

    time_elapsed = time.time() - prev
    res, image = cap.read()

    if time_elapsed > 1./frame_rate:
        prev = time.time()

        # Do something with your image here.
        process_image()
Posted by: Guest on May-28-2020
-1

opencv videocapture rtmp

myrtmp_addr = "rtmp://myip:1935/myapp/mystream"
cap = cv2.VideoCapture(myrtmp_addr)
frame,err = cap.read()
Posted by: Guest on August-29-2020

Code answers related to "python cv2 videocapture"

Python Answers by Framework

Browse Popular Code Answers by Language