-1
Hello, I am trying to save the name of the video files differently every time the program runs. currently it overwrites the name of the previous video.
This is my current code:
import cv2
print("MODO DE VIDEO COM 2 CAMERAS")
#NUMERO DE CAMERAS
webcam1 = cv2.VideoCapture(0)
webcam2 = cv2.VideoCapture(1)
#VERIFICANDO AS CAMERAS
if (webcam1.isOpened() == False):
    print("Camera 1 não conectada!")
if (webcam2.isOpened() == False):
    print("Camera 2 não conectada!")   
#ARMAZENAMENTO
nome1=("Video_camera1.avi")
nome2=("Video_camera1.avi")
fourcc1 = cv2.VideoWriter_fourcc(*"DIVX")
fourcc2 = cv2.VideoWriter_fourcc(*'DIVX')
file1 = cv2.VideoWriter(nome1,fourcc1, 10.0,(640,480))
file2 = cv2.VideoWriter(nome2,fourcc2, 10.0,(640,480))
while (True):
    ret, frame1 = webcam1.read()
    ret, frame2 = webcam2.read()
    if ret==True:
        file1.write(frame1)
        file2.write(frame2)
        cv2.imshow('Webcam1 1',frame1)
        cv2.imshow('Webcam1 2',frame2)
        if cv2.waitKey(1) == ord('s'):
            break
    else:
        break
print("FINALIZADO")
webcam1.release()
webcam2.release()
file1.release()
file2.release()
cv2.destroyAllWindows()
						
Simply change the values of
nome1andnome2which, apparently, will be the names of the archives.– Woss