diff --git a/gopro.py b/gopro.py
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b46024d0e2c11819a0ec9fd67ff4f712e6b20553 100644
--- a/gopro.py
+++ b/gopro.py
@@ -0,0 +1,62 @@
+import cv2
+import numpy as np
+import goprocam
+from goprocam import GoPro
+#modif
+def list_cameras():
+    """ Liste les caméras disponibles et retourne leurs indices. """
+    index = 0
+    available_cameras = []
+    while True:
+        cap = cv2.VideoCapture(index)
+        if not cap.read()[0]:
+            break
+        else:
+            available_cameras.append(index)
+        cap.release()
+        index += 1
+    return available_cameras
+
+def select_camera():
+    cameras = list_cameras()
+    if not cameras:
+        print("Aucune caméra détectée.")
+        return None
+    print("Caméras disponibles :", cameras)
+    selected = int(input("Sélectionnez l'indice de votre GoPro : "))
+    return selected if selected in cameras else None
+
+def record_video(camera_index):
+    cap = cv2.VideoCapture(camera_index)
+    if not cap.isOpened():
+        print("Impossible d'accéder à la caméra.")
+        return
+    
+    fourcc = cv2.VideoWriter_fourcc(*'XVID')
+    out = cv2.VideoWriter('gopro_output.avi', fourcc, 30.0, (640, 480))
+    
+    while True:
+        ret, frame = cap.read()
+        if not ret:
+            break
+        cv2.imshow('GoPro Video', frame)
+        out.write(frame)
+        
+        if cv2.waitKey(1) & 0xFF == ord('q'):
+            break
+    
+    cap.release()
+    out.release()
+    cv2.destroyAllWindows()
+
+if __name__ == "__main__":
+    print("Connexion à la GoPro...")
+    gopro = GoPro.GoPro()
+    gopro.webcamFOV("medium")
+    gopro.startWebcam()
+    
+    cam_index = select_camera()
+    if cam_index is not None:
+        record_video(cam_index)
+    else:
+        print("Sélection invalide.")
\ No newline at end of file