Open Zeus916 opened 5 years ago
Writing to video won't skip frames. It sounds like there might be a logic error somewhere else in your code.
Otherwise, you may want to try using cv2.VideoCapture
instead of FileVideoStream
.
I also tried a simple barebones code to record video. for some reason the video play back is faster. im not able to figure this out.
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cap.set(cv2.CAP_PROP_FPS, 25)
out = cv2.VideoWriter('vid2.avi', cv2.VideoWriter_fourcc('M','J','P','G'), 25, (1280, 720))
#ret0, frame0 = cap.read()
while True:
ret0, frame0= cap.read()
out.write(frame0)
cv2.imshow("shoo", frame0)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
cap.release()
The playback of cv2.imshow
on your screen? Or the playback of the generated .avi
file?
Hi, I'm trying to write the frame stored in the queue to a video file for video recording. I have problems with fps, basically I recorded video for 1 minute but the recorded video was short and played like a timelapse. I'm reading from a HDR camera over USB . I guess writing to video seems to skip frames.