Is there a way to trigger an action camera using python

1k Views Asked by At

trying to make a timelapse using a cheap action cam - model: hyundai cnu3000

my first attampt was using it as a webcam, with a simple opencv script to get the imgs:

import cv2

cap = cv2.VideoCapture(0)

# reseting resolution to max it out 
# since opencv has a default of 640X480
cap.set(3,3000)
cap.set(4,3000)

while(True):
    ret, frame = cap.read()

    # Display the resulting frame
    cv2.imshow('frame',frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        # save when using 'q' key
        cv2.imwrite("testing_webcam.jpg", frame)
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

this resaults in images with a resolution of (1280X720) which is the maximum 'video recording' resolution for the camera - makes sense since we are streaming live to the computer (actually raspberry pi but windows pc worked fine as well)

now here is the thing - surprisingly the camera is capable of images with a much higher resolution (2592X1944) but only if i use it manualy (i.e. pressing button thereby saveing to sd card). i don't mind saving to sd card but i was wandering if there is a way to triger the camera without streaming - getting a higher resolution

tried gphoto with my Pi as well - as expected, doesn't work (i did not find this model in the supported model list)

pi@raspberrypi:~ $ gphoto2 --auto-detect
Model                          Port                                            
----------------------------------------------------------
Mass Storage Camera            disk:/media/pi/7AFB-BDAE
pi@raspberrypi:~ $ gphoto2 --trigger-capture

*** Error ***              
This camera can not trigger capture.
ERROR: Could not trigger capture.
*** Error (-6: 'Unsupported operation') ***       

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
...
...
...

any help / pointing in direction would be much apreciated :D

0

There are 0 best solutions below