Webcam erfasst/ gespeichertes Video nicht abgespielt (nicht UTF-8 codiert)Python

Python-Programme
Guest
 Webcam erfasst/ gespeichertes Video nicht abgespielt (nicht UTF-8 codiert)

Post by Guest »

Dies ist der Code, mit dem ich die Webcam aufzeichnet und speichern kann. Das Video wird erfolgreich gespeichert und die letzte Zeile wird ebenfalls ausgelegt, aber ich kann es im Verzeichnis nicht öffnen, da dies folgt: "Dateilastfehler für mein webcam_new.mp4
c: \ user \ pmls \ a (DIP Lab (DIP Lab" ) \ My webcam_new.mp4 ist nicht utf-8 codiert "
Wenn jemand dies herausfinden kann! < /P>

Code: Select all

cap = cv2.VideoCapture(0)  # if we hav 2 webcams 0 for 1st and 1 for the2nd webcam

frame_width = int(cap.get(3))  # 3 means that width will be taken
frame_height = int(cap.get(4)) # 4 means that length or height will be taken

fourcc=cv2.VideoWriter_fourcc(*"avc1")   #this defines what format we need
out=cv2.VideoWriter("My webcam_new.mp4", fourcc, 20,(frame_width, frame_height))

while(cap.isOpened()):  # if the webcam is not opened then we cannot capture
ret, frame = cap.read()

if not ret:  # If the video has ended, break out of the loop
print("End of webcam!!!")
break

out.write(frame)
cv2.imshow("output_new", frame)

if cv2.waitKey(30) & 0xFF == ord('q'):
break

cap.release()
out.release()
cv2.destroyAllWindows()
print("Got it!!!!")

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post