What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-08 23:11:06
[ WARN:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-wwma2wne\o pencv\modules\videoio\src\cap_msmf.cpp (677) CvCapture_MSMF::initStream Failed t o set mediaType (stream 0, (640x480 @ 30) MFVideoFormat_RGB24(codec not found)
The following code resolved this issue for me: video = cv2.VideoCapture(0,cv2.CAP_DSHOW) Add solution -
Python 2021-10-10 12:02:09
get video duration opencv python
import cv2 cap = cv2.VideoCapture("./video.mp4") 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 = frame_count/fps print('fps = ' + str(fps... Add solution -
-
Python 2021-09-10 13:15:01
take screenshot of video python
import cv2 import os import time def get_frames(inputFile,outputFolder,step,count): ''' Input: inputFile - name of the input file with directoy outputFolder - name and path of the folder to save the results step - time lapse between each... Add solution
Best helpers
+10
+5
+5
+5
+5
+5
+5
+5
+5
+5