0
I’m using a camera to capture video, and save the video. I’m trying to save and finish the code with a command in the IDLE(python) but I’m not getting it.
Actualement to finish and save the program is necessary to be with the window open and press the letter "q" or "Q"...
This is my current code:
import cv2
camera = 0
camera1 = cv2.VideoCapture(camera)
while True:
ret, frame = camera1.read()
#Sai do while caso a tecla apertada for "q" ou "Q"
if cv2.waitKey(1) in (ord('q'),ord("Q")):
break
camera1.release()
cv2.destroyAllWindows()
print("FINALIZADO!")
But pressing the letter Q does not do what you need? It is not clear what you want to do.
– Woss
I wanted to then hide the window, view the camera... and still the code work, and press a key and save the video.
– Edvaldo Teomar
In this code, use the Videowriter, and then put the release in
def close(event):
and within theif event.key == 'ctrl+c':
– danieltakeshi