Replies: 3 comments 16 replies
-
GoPro has not updated their Python package to support USB control, but I have updated my unofficial GoPro control library to support Hero9's gpWebcam USB API and Hero10 OpenGoPro USB API/gpWebcam stuff. So by using my python package, and taking this example code: import sys
import time
from goprocam import GoProCamera, constants
import threading
from signal import signal, SIGINT
record_len = 10 # How long to record for in seconds
def record_video(interface: str) -> None:
gopro = GoProCamera.GoPro(ip_address=GoProCamera.GoPro.getWebcamIP(
interface), camera=constants.gpcontrol, webcam_device=interface, api_type=constants.ApiServerType.OPENGOPRO)
try:
r = gopro.setWiredControl(constants.on)
gopro.checkResponse(r)
except:
pass # sometimes throws 500 server error when camera is already on wired control mode
r = gopro.shoot_video(record_len)
print(r)
print("Video recorded")
gopro.downloadLastMedia()
gopro.delete(constants.Delete.LAST)
exit()
def handler(s, f):
thr.stop()
quit()
signal(SIGINT, handler)
cameras = sys.argv[1]
cameras = cameras.split(",")
for interface in cameras:
thr = threading.Thread(target=record_video, args=(interface,))
thr.start() |
Beta Was this translation helpful? Give feedback.
-
but what if I don't plan to call it from the command line and need to do it on the module level and be able to run the program from within pycharm? |
Beta Was this translation helpful? Give feedback.
-
weird not seeing anything like that: Did you get my email? that I sent yesterday to the contact link of your website? pi@raspberrypi:~ $ ls /dev/* /dev/block: /dev/bus: /dev/char: /dev/disk: /dev/dma_heap: /dev/dri: /dev/fd: /dev/input: /dev/mapper: /dev/mqueue: /dev/net: /dev/pts: /dev/raw: /dev/shm: /dev/snd: /dev/v4l: |
Beta Was this translation helpful? Give feedback.
-
Hello,
I will gladly pay someone to write me an example in python to control a hero 10 on a Raspberry Pi 4 via USB.
The code simple needs to connect to the camera and start recording video for a predetermined time. Then upload the video clip to the raspberry pi and delete it off the camera.
If anyone on here can do that for me I will gladly pay for your time. let me know Thanks in advance.
Alan Bell
Beta Was this translation helpful? Give feedback.
All reactions