Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

opencv loop video

import numpy as np
import cv2
cap = cv2.VideoCapture('intro.mp4')
while(cap.isOpened()):

    ret, frame = cap.read() 
    #cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
    #cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)

    if ret:
        cv2.imshow("Image", frame)
    else:
       print('no video')
       cap.set(cv2.CAP_PROP_POS_FRAMES, 0)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break


cap.release()
cv2.destroyAllWindows()
Comment

PREVIOUS NEXT
Code Example
Python :: check if something is nan python 
Python :: how to convert csv into list 
Python :: merge two columns pandas 
Python :: xgboost algorithm in python 
Python :: Django populate form from database 
Python :: numpy delete 
Python :: render django template 
Python :: unsigned int python 
Python :: increment python 
Python :: termcolor print python 
Python :: depth first search python 
Python :: numpy mean 
Python :: print for loop in same line python 
Python :: create exact window size in python tkinter 
Python :: count nan values 
Python :: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead 
Python :: duplicate in list 
Python :: online python 
Python :: append extend python 
Python :: python for loop in array 
Python :: update nested dictionary python 
Python :: How do I iterate over a subfolder in Python 
Python :: how to select top 5 in every group pandas 
Python :: python circular import 
Python :: django oauth toolkit permanent access token 
Python :: validate ip address 
Python :: find optimal number of clusters sklearn 
Python :: run python script from repl 
Python :: pyinstaller onefile current working directory 
Python :: python variable is not none 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =