This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| video_name = "sample.mp4" | |
| input_video_path = os.path.join("Input_Video", video_name) # USER must Edit | |
| # Load video | |
| cap = cv2.VideoCapture(input_video_path) | |
| # Get General Info | |
| fps = cap.get(cv2.CAP_PROP_FPS) # OpenCV2 version 2 used "CV_CAP_PROP_FPS" | |
| frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) | |
| duration = int(frame_count/fps) |
NewerOlder