Giter Club home page Giter Club logo

gopro-py-api's Introduction

GoPro API for Python

GitHub issues Github All Releases PyPi Version

Unofficial GoPro API Library for Python - connect to GoPro cameras via WiFi.

Notice:

Project has been updated to support Hero10 Black + OpenGoPro v2 + USB control. Further is needed to support these features:

  • Python3.8 typing
  • Custom exceptions
  • Integration tests
  • BLE support (using gopro-ble-py)
  • Hero9 (v1.21 & 1.22 fw) / Hero10 (OpenGoPro v2) USB identifier Autodiscovery
  • Stacktraces
  • More robust examples, with boilerplate code ready for use

Project covers a decade worth of camera releases, naturally something might've broken as development focuses on the newer cameras. Hopefully nothing broke.

Acknowledgments to GoPro for the OpenGoPro API spec release.

- @konradit

Compatibility:

  • HERO3
  • HERO3+
  • HERO4 (including HERO Session)
  • HERO+
  • HERO5 (including HERO5 Session)
  • HERO6
  • Fusion 1
  • HERO7 (Black)
  • HERO8 Black
  • MAX
  • HERO9 Black
  • HERO10 Black

WiFi vs USB:

Hero3..Hero8 (incl. MAX/Fusion/Session) all use WiFi (and some use Bluetooth) for controls, media management, status updates and live preview

Hero9 Black and Hero10 Black have Webcam functionality, and Hero10 Black is officially exposing the API server over USB Ethernet with full camera control capabilities

Hero9 Black requires using an older firmware to get ability to take photos. See the compatibility chart

Installation

From PyPi:

pip install goprocam

Git (unstable):

git clone http://github.com/konradit/gopro-py-api
cd gopro-py-api
python setup.py install

Tested on Python 3.6.0 -- works on Linux and Windows and Mac

Quick start:

Connect your camera to your computer via WiFi (WiFi on the camera must be on!)

from goprocam import GoProCamera, constants

goproCamera = GoProCamera.GoPro()

goproCamera.shoot_video(10)

Examples:

See examples for examples on how to use this API.

Documentation:

Documentation is available: docs

Video screencap:

gopro-py-api's People

Contributors

afogal avatar aleksandr-vin avatar bmunroezappos avatar cedricbellec avatar f0k avatar fark avatar jornb avatar konradit avatar lopezchris avatar maximedb avatar nunohumberto avatar safeisnotanoption avatar sorenrade avatar waider avatar yuri-sevatz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gopro-py-api's Issues

[Hero 6] Pairing screen stays visible, https pairing refuses connection

I tried pairing the hero 6 through its LCD display (connections -> connect new device -> GoPro App). then connected to the correct SSID and tried .pair(), but the https port refuses connections.

All other commands work, but only while the LCD shows "pairing".

I've also tried configuring a router for the smart remote mode (correct MAC, SSID, DHCP), but in that mode, none of the ports are accessible.

Has anyone had success pairing the Hero6 with the latest firmware?

Gopro Fusion compatibility

Hi Konrad,

Thanks for this lib. I was wondering if there is any plan to support the new gopro fusion.
So far from my test you can connect and take_photo().
I have found most of the settings of the camera are still compatible such as Protune, EV change, Raw, photo/video mode etc... Only new settings such as resolution, ISO got new parameters that are not listed in the library.

However since the fusion is a dual camera I can get or download only the back camera image. l'url return only the back camera file.

Thanks

H

power on and off

Hello.
If you dont mind clarify me.

it is posible power on at 7 am and power off at 7pm, day after day and not lost the connection with a computer.

Also I could change values like protune, flat or exposition in real time.

Thank you

Connecting to multiple GoPro Hero 3+

I've probably missed something obvious, but is there a method or value to change such that I can connect to several gopros at once or that I can switch connections to a specific gopro?

urllib.request

hello,

Thank you for the post before.

What version of python need ?

    import urllib.request
ImportError: No module named request

I have version 2.7 I need install another verison

GoProHero 4Session not connecting

Hi,

I have a two GoProHero 4Sessions that I am trying to turn on and off using your API. However, I am having trouble connecting the cameras (I am testing with one camera at a time) to my raspberry Pi that I am using.
It is a strange issue in that it will connect one time, but then after I disconnect and try again it will not work again. I am connected to the gopros wifi (attached is a screenshot of ifconfig and what happens when I try to connect to one of the gopros) but it will not connect.

Probably not the best explanation but let me know if you have any questions! Thanks!

capture

Issues with ffmpeg not being recognized

When running a basic example this is the output I get. Seems to be connecting fine, but no matter what I do ffmpeg is not recognized. I've downloaded, unzipped, and added ffmpeg to the PATH. I attempted a PIP install of ffmpeg but I get an error for subprocess (see below)

HERO+
HD3.22.01.50
Camera successfully connected!
{"status":"0"}


'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.
Could not find a version that satisfies the requirement subprocess (from ffmpeg) (from versions: )
No matching distribution found for subprocess (from ffmpeg)

Anyone else run into this issue before?

Media download says Not supported while recording or processing media.

I am using gopro Hero 4 silver.
Everytime I connect and capture it works. But when I try downloadLastMedia() option or downloadMedia() it shows "Not supported while recording or processing media."

The self.isRecording() functions returns 1.
What mode should I keep my camera to download the media files?

Problem with MultiShot Mode and Download

Hi again Konrad !
I'm always on my photogrammetry project. I used your code to create an interface on Qt, it is working perfectly, such a good work !!!

I have just one problem. I need to download photos and rename file with the timestamp. No problem for rename a folder with your example, the problem is in downloading photos. I need to use MultiShot Mode and it's only downloading the first photo of the MultiShot. I tryied with DowloadAll and it is the same problem.

Do you have any issue to get infos of all MultiShot photos ?
I join my code with definition of my Qt fonctions.

 def connexion(self):
        self.gpCam = GoProCamera.GoPro()
        if self.gpCam.getStatusRaw()== None:
            self.actual_statut_2.setText("Erreur")
        else:
            self.actual_statut_2.setText("Connecté")

    def Allumer(self):
        self.gpCam.power_on()

    def Eteindre(self):
        self.gpCam.power_off()

    def play(self):
        self.actual_statut.setText("PLAY")
        self.gpCam.shutter(constants.start)
        if self.gpCam.getStatus(constants.Status.Status,constants.Status.STATUS.IsBusy) == 1:
            self.debut = datetime.datetime.utcnow()
            print(self.debut)

    def download(self):
        self.actual_statut.setText("DOWNLOAD")
        media = self.gpCam.listMedia(True, True)
        self.gpCam.downloadAll()


    def stop(self):
        self.actual_statut.setText("STOP")
        self.gpCam.shutter(constants.stop)
        self.fin = datetime.datetime.utcnow()
        print(self.fin)
        self.delta_t = self.fin - self.debut
        print(self.delta_t)

    def Timelapse05(self):
        self.actual_statut.setText("05")
        self.gpCam.mode(constants.Mode.MultiShotMode, constants.Mode.SubMode.MultiShot.TimeLapse)
        self.gpCam.gpControlSet(constants.Multishot.TIMELAPSE_INTERVAL, constants.Multishot.TimeLapseInterval.IHalf1)

    def Timelapse1(self):
        self.actual_statut.setText("1")
        self.gpCam.mode(constants.Mode.MultiShotMode, constants.Mode.SubMode.MultiShot.TimeLapse)
        self.gpCam.gpControlSet(constants.Multishot.TIMELAPSE_INTERVAL, constants.Multishot.TimeLapseInterval.I1)

Stuck at trying to run gopro_keepalive.py. Help please?

I already installed the prerequsite: pip install goprocam
Then I try to run gopro_keepalive.py via python3 gopro_keepalive.py (I've never able to run your scripts via python gopro_keepalive.py). This is what it tells me:
Traceback (most recent call last):
File "gopro_keepalive.py", line 1, in
from goprocam import GoProCamera
ModuleNotFoundError: No module named 'goprocam'

Thanks!

gpCam.pair AttributeError: 'module' object has no attribute '_create_unverified_context'

Thank you for sharing this API
I'm using goprocam (1.9.6) on python 3 with gopro hero 4 session.
Unfortunately my terminal looks like this:
pi@noobs190:~ $ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.

from goprocam import GoProCamera
from goprocam import constants
gpCam = GoProCamera.GoPro(constants.gpcontrol)
Waking up...
Camera successfully connected!
Connected to 10.5.5.9
gpCam.pair()
Make sure your GoPro camera is in pairing mode!
Go to settings > Wifi > PAIR > GoProApp to start pairing.
Then connect to it, the ssid name should be GOPRO-XXXX/GPXXXXX/GOPRO-BP-XXXX and the password is goprohero
Enter pairing code: 4680
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/.local/lib/python3.4/site-packages/goprocam/GoProCamera.py", line 362, in pair
context = ssl._create_unverified_context()
AttributeError: 'module' object has no attribute '_create_unverified_context'

Using getMediaInfo inside a script

Hello,
Thanks for the library, it's very helpful.
I'm running into one problem, and I'm not really sure where to look at to solve.
When I run the functions as a command it works fine, and most of the functions work fine in a script as well.
However, when I run getMediaInfo inside a script it always returns an empty string.

Thank you again

error running simple code

Hi Konrad,

I've got a Hero3 connected to the pc (Win10) with Python 3.7 and when I run:
from goprocam import GoProCamera
from goprocam import constants

gpCam = GoProCamera.GoPro()

I get this error:
Traceback (most recent call last):
File "C:\Users\iacob\Desktop\PYTHONproj\gopro\gopro1.py", line 1, in
from goprocam import GoProCamera
File "C:\Users\iacob\AppData\Local\Programs\Python\Python37\lib\site-packages\goprocam_init_.py", line 1, in
from goprocam import GoProCamera
File "C:\Users\iacob\AppData\Local\Programs\Python\Python37\lib\site-packages\goprocam\GoProCamera.py", line 51
except ImportError, e:
^
SyntaxError: invalid syntax

What should I do?

Thanks!

Iacob

pip version - getMedia function partially false indented

Problem: Parts of the getMedia function are false indented in the version installed by pip

Details: Lines 492-494 false indented

        ##
                def getMedia(self):
                        folder = ""
                        file_lo = ""
                try:
  • GoPro Camera(s): -
  • Firmware Version: -
  • Steps to reproduce:
max@MaxKubuntuNUC:~$ conda create -n GoPro-Test python=3.6 pip            
Solving environment: done

## Package Plan ##

  environment location: /home/max/miniconda3/envs/GoPro-Test

  added / updated specs: 
    - pip
    - python=3.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    readline-7.0               |       haf1bffa_1         381 KB  conda-forge
    python-3.6.6               |       h5001a0f_3        20.5 MB  conda-forge
    libgcc-ng-7.2.0            |       hdf63c60_3         6.1 MB  conda-forge
    sqlite-3.25.2              |       hb1c47c0_0         1.6 MB  conda-forge
    xz-5.2.4                   |       h470a237_1         328 KB  conda-forge
    libffi-3.2.1               |       hfc679d8_5          51 KB  conda-forge
    tk-8.6.8                   |       ha92aebf_0         3.1 MB  conda-forge
    setuptools-40.4.3          |           py36_0         554 KB  conda-forge
    ncurses-6.1                |       hfc679d8_1         1.2 MB  conda-forge
    wheel-0.32.1               |           py36_0          34 KB  conda-forge
    zlib-1.2.11                |       h470a237_3          93 KB  conda-forge
    pip-18.1                   |        py36_1000         1.8 MB  conda-forge
    libstdcxx-ng-7.2.0         |       hdf63c60_3         2.5 MB  conda-forge
    ------------------------------------------------------------
                                           Total:        38.3 MB

The following NEW packages will be INSTALLED:

    ca-certificates: 2018.10.15-ha4d7672_0 conda-forge
    certifi:         2018.10.15-py36_1000  conda-forge
    libffi:          3.2.1-hfc679d8_5      conda-forge
    libgcc-ng:       7.2.0-hdf63c60_3      conda-forge
    libstdcxx-ng:    7.2.0-hdf63c60_3      conda-forge
    ncurses:         6.1-hfc679d8_1        conda-forge
    openssl:         1.0.2p-h470a237_1     conda-forge
    pip:             18.1-py36_1000        conda-forge
    python:          3.6.6-h5001a0f_3      conda-forge
    readline:        7.0-haf1bffa_1        conda-forge
    setuptools:      40.4.3-py36_0         conda-forge
    sqlite:          3.25.2-hb1c47c0_0     conda-forge
    tk:              8.6.8-ha92aebf_0      conda-forge
    wheel:           0.32.1-py36_0         conda-forge
    xz:              5.2.4-h470a237_1      conda-forge
    zlib:            1.2.11-h470a237_3     conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
readline-7.0         | 381 KB    | ####################################################################################### | 100% 
python-3.6.6         | 20.5 MB   | ####################################################################################### | 100% 
libgcc-ng-7.2.0      | 6.1 MB    | ####################################################################################### | 100% 
sqlite-3.25.2        | 1.6 MB    | ####################################################################################### | 100% 
xz-5.2.4             | 328 KB    | ####################################################################################### | 100% 
libffi-3.2.1         | 51 KB     | ####################################################################################### | 100% 
tk-8.6.8             | 3.1 MB    | ####################################################################################### | 100% 
setuptools-40.4.3    | 554 KB    | ####################################################################################### | 100% 
ncurses-6.1          | 1.2 MB    | ####################################################################################### | 100% 
wheel-0.32.1         | 34 KB     | ####################################################################################### | 100% 
zlib-1.2.11          | 93 KB     | ####################################################################################### | 100% 
pip-18.1             | 1.8 MB    | ####################################################################################### | 100% 
libstdcxx-ng-7.2.0   | 2.5 MB    | ####################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate GoPro-Test
#
# To deactivate an active environment, use:
# > source deactivate
#
max@MaxKubuntuNUC:~$ source activate GoPro-Test
(GoPro-Test) max@MaxKubuntuNUC:~$ pip install goprocam
Collecting goprocam
Installing collected packages: goprocam
Successfully installed goprocam-2.0.9.post1
(GoPro-Test) max@MaxKubuntuNUC:~$ sed -n '486,511p;512q' ~/miniconda3/envs/GoPro-Test/lib/python3.6/site-packages/goprocam/GoProCamera.py 
        def setZoom(self, zoomLevel):
                if zoomLevel >= 0 and zoomLevel <= 100:
                        self.gpControlCommand("digital_zoom?range_pcnt=" + zoomLevel)
        ##
        ## Query media list
        ##
                def getMedia(self):
                        folder = ""
                        file_lo = ""
                try:
                        raw_data = urllib.request.urlopen('http://' + self.ip_addr + ':8080/gp/gpMediaList').read().decode('utf-8')
                        json_parse = json.loads(raw_data)
                        for i in json_parse['media']:
                                folder=i['d']
                        for i in json_parse['media']:
                                for i2 in i['fs']:
                                        file_lo = i2['n']
                        return "http://" + self.ip_addr + ":8080/videos/DCIM/" + folder + "/" + file_lo
                except (HTTPError, URLError) as error:
                        return ""
                        print("Error code:" + str(error.code) + "\nMake sure the connection to the WiFi camera is still active.")
                except timeout:
                        return ""
                        print("HTTP Timeout\nMake sure the connection to the WiFi camera is still active.")
        def getMediaFront(self):
                folder = ""
(GoPro-Test) max@MaxKubuntuNUC:~$
  • Happens every time? [Y/N]: Y

500 ISE on attempt to access GoPro URLs

The unit is a GoPro HERO4, running the AFSP firmware and an override.sh that changes the IP address and forces it onto channel 1.

The camera runs fine for a long time, until something causes it to break. Then it will not respond to commands, and needs to be restarted. Trying to visit 10.6.5.9/ works, 10.6.5.9/go/gpStatus and similar all result in 500 internal server error.

Any ideas?

import goprocam error

ImportError: No Module named request

Can you please help with this error. I do not understand what is wrong.

I also did: pip install request, but that didn't solve the problem.

failed to receive frame on gopro hero 5

hi
i m triyng to get the live streaming using the example gopro_keepalive.py and gopro_opencv.py but i acquirate a frame, it is empty.

When i launch:
python3 gopro_keepalive.py

i receive:

HERO5 Black
HD5.02.02.00.00
Camera successfully connected!
{"status":"0" }
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[mpegts @ 0x1f27140] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x1f27140] Could not find codec parameters for stream 2 (Unknown: none ([128][0][0][0] / 0x0080)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'udp://10.5.5.9:8554':
Duration: N/A, start: 0.000000, bitrate: N/A
Program 1
Stream #0:0[0x1011]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709), 960x720 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1100]: Audio: aac ([15][0][0][0] / 0x000F), 0 channels, fltp
Stream #0:2[0x200]: Unknown: none ([128][0][0][0] / 0x0080)
Please use -b:a or -b:v, -b is ambiguous
[swscaler @ 0x21170e0] deprecated pixel format used, make sure you did set range correctly
Output #0, mpegts, to 'udp://127.0.0.1:10000':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: mpeg2video, yuv420p, 960x720 [SAR 1:1 DAR 4:3], q=2-31, 800 kb/s, 30 fps, 90k tbn, 30 tbc
Metadata:
encoder : Lavc56.60.100 mpeg2video
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
[h264 @ 0x200f200] left block unavailable for requested intra mode at 0 5
[h264 @ 0x200f200] error while decoding MB 0 5, bytestream 8470
[h264 @ 0x200f200] concealing 2449 DC, 2449 AC, 2449 MV errors in P frame
[h264 @ 0x2288800] concealing 1865 DC, 1865 AC, 1865 MV errors in P frame
[h264 @ 0x200f200] left block unavailable for requested intra mode at 0 24
[h264 @ 0x200f200] error while decoding MB 0 24, bytestream 3947
[h264 @ 0x200f200] concealing 1309 DC, 1309 AC, 1309 MV errors in P frame
[h264 @ 0x22cff20] concealing 1844 DC, 1844 AC, 1844 MV errors in P frame4kbits/s
[h264 @ 0x2067d40] concealing 1297 DC, 1297 AC, 1297 MV errors in P frame
[h264 @ 0x2317620] error while decoding MB 46 40, bytestream -6
[h264 @ 0x2317620] concealing 303 DC, 303 AC, 303 MV errors in P frame
[h264 @ 0x2288800] concealing 647 DC, 647 AC, 647 MV errors in P frame
[h264 @ 0x200f200] concealing 678 DC, 678 AC, 678 MV errors in P frame
[h264 @ 0x2317620] concealing 2207 DC, 2207 AC, 2207 MV errors in P frame2kbits/s
[h264 @ 0x22cff20] error while decoding MB 52 42, bytestream -5rate=1059.1kbits/s
[h264 @ 0x22cff20] concealing 177 DC, 177 AC, 177 MV errors in P frame
[h264 @ 0x200f200] concealing 1351 DC, 1351 AC, 1351 MV errors in P frame
[h264 @ 0x22cff20] left block unavailable for requested intra mode at 0 8
[h264 @ 0x22cff20] error while decoding MB 0 8, bytestream 7447
[h264 @ 0x22cff20] concealing 2269 DC, 2269 AC, 2269 MV errors in P frame
[h264 @ 0x2067d40] concealing 1535 DC, 1535 AC, 1535 MV errors in P frame
[h264 @ 0x2067d40] concealing 1838 DC, 1838 AC, 1838 MV errors in P frame0kbits/s
[h264 @ 0x2317620] concealing 2140 DC, 2140 AC, 2140 MV errors in P frame
[h264 @ 0x22cff20] error while decoding MB 13 44, bytestream -5rate= 986.1kbits/s
[h264 @ 0x22cff20] concealing 96 DC, 96 AC, 96 MV errors in P frame
[h264 @ 0x2067d40] left block unavailable for requested intra mode at 0 36
[h264 @ 0x2067d40] error while decoding MB 0 36, bytestream 1522

what i wrong?

thank you

overview() fails to parse FRAME_RATE

Hi, in the overview() function, the API fails to correctly parse the frame rate. Current mode is 1080p80FPS.

HERO4 Black
HD4.02.05.00.00
Camera successfully connected!
camera overview
current mode: Video
current submode: Video
current video resolution: 1080pSV
Traceback (most recent call last):
File "xxx", line 9, in
print(cam.overview())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/goprocam/GoProCamera.py", line 1083, in overview
print("current video framerate: " + "" + self.parse_value("video_fr",self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
TypeError: must be str, not NoneType

API hung after Take Photo/Video

KonradIT,

First, let me commend you on the GoPro Python API. It has some great functionality.

One thing I noticed today is that the API seems to get hung after issuing take_photo() or take_video(10):

**>>> gopro = GoProCamera.GoPro()
HERO5 Black
HD5.02.02.60.00
Camera successfully connected!

gopro.take_photo()
{}

{}

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/goprocam/GoProCamera.py", line 430, in take_photo
ready=int(self.getStatus(constants.Status.Status, constants.Status.STATUS.IsBusy))
ValueError: invalid literal for int() with base 10: ''

**

I received the Traceback after issuing a Ctrl+C. From the GoPro screen, it appears the camera has finished taking the photo/video and returns to standby. So this may just be an issue with the IsBust status.

Do you have any suggestions?

Thanks in advance!

Hero5 Black stuck on Waking up...

I can connect to Hero5 Black wifi and look at http://10.5.5.9/gp/gpControl in the browser, but when trying to initialize with:
self.go = GoProCamera.GoPro(constants.gpcontrol)
It will say Waking up... and not do anything further.
When I then connect using the phone app and try again it works fine.

Burst Mode and how to take Multiple Exposures

Howdy, I can connect to the camera and issue commands to set Burst Mode, however I cannot get multiple exposures using the take_photo() command. Am I missing something?

`from goprocam import GoProCamera
from goprocam import constants
gopro = GoProCamera.GoPro(constants.gpcontrol)

Waking up...
Camera successfully connected!
Connected to 10.5.5.9

gopro.mode(constants.Mode.MultiShotMode, constants.Mode.SubMode.MultiShot.Burst)
gopro.gpControlSet(constants.Multishot.BURST_RATE, constants.Multishot.BurstRate.B3_1)

gopro.overview()

camera overview
current mode: Multi-Shot
current submode: Burst
current video resolution: 1080p
current video framerate: 60
pictures taken: 1
videos taken: 0
videos left: 00:21:49
pictures left: 3015
battery left: Full
space left in sd card: 7.19GB
camera SSID: goprohero4
Is Recording: Not recording - standby
Clients connected: 1
camera model: HERO4 Black
firmware version: HD4.02.05.00.00
serial number: XXXXXXXXXXXXXX

gopro.take_photo()

{}

{}

'http://10.5.5.9:8080/videos/DCIM/100GOPRO/GOPR0400.JPG'
`

As you can see only one exposure is recorded... any ideas?

"Camera successfully connected!" shows twice

Thank you for sharing your code. I'm using it on raspberry pi to connect with GoPro session 4. I've successfully sync'd the GoPro date and time. I notice that the "Camera successfully connected!" appears twice after >>> gpCam = GoProCamera.GoPro(constants.gpcontrol) is entered. Maybe exceptions to try are queued causing prepare_gpcontrol() to restart in another loop?

Camera hangs when Switching between Livestreaming and Photo mode

I am currently Hero 4 Session and my use-case is to stream the live feed and when the user clicks a button, I want to take a photo and resume the live feed.

I am able to stream the live feed gopro.stream("udp://127.0.0.1:1000", "high") and capturing the feed in the browser

I also wanted to take picture in the mid of the live streaming. I tried

  1. gopro.take_photo(),

  2. gopro.livestream("stop")
    gopro.take_photo()
    gopro.stream("udp://127.0.0.1:1000", "high")

But the camera hangs in both the cases, the ISBUSY flag is set indefinitely. (take_photo method doesn't return)

I am calling gopro.stream(.......) in a separate thread.

Environment:

  • Windows 7 , 64-bit, Python 3.6
  • Using the published python package

Am I missing anything ?

Do I need to call any other function before calling the take_photo method ?

Any clue would be much helpfull

Thanks in Advance

HERO5 Session HD5.03.02.51.00

First of all i have to thank you all your work, it have been very helpful for us.

I have a HERO5 Session with firmware version HD5.03.02.51.00. I have been troubles connecting with my laptop. After a little research i suspect the behaviour of this firmware is a slightly different from the expected by the API.

Problem A: Pairing

I can connect to the GoPro wifi when i put it in pairing mode with GOPRO APP, and then i have access to HTML API, but the camera do not recognize me as connected device and after a while it stop the pairing proccess and turn off wifi.

I have tried solve this whith the GoPro.pair() API mehtod, but i can not access to prouposed pairing URL (https://10.5.5.9/gp/gpPair?...). Finally i have used the GoPro application with a sniffer and i see the following pairing message: http://10.5.5.9/gp/gpControl/command/wireless/pair/complete?success=1&deviceName=<HOSTNAME>. I have tried it and it works.

Problem B: connected status

The API method GoPro.prepare_gpcontrol() polling the GoPro until /gp/gpControl/status[status][31] is greather than 1. But with my camera i do not observe any change in this field so this method causes an infinite loop. Besides i think i not need to wait for this indicator to access to the HTML API.

I will send you a patch with my pruposed solution.

gpCam.overview() TypeError: Can't convert 'NoneType' object to str implicitly

Thank you for sharing this API
I'm using goprocam (1.9.3) on python 3 with gopro hero 4 session.
Unfortunately my terminal looks like this:

gpCam.overview()
camera overview
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/.local/lib/python3.4/site-packages/goprocam/GoProCamera.py", line 997, in overview
print("current mode: " + "" + self.parse_value("mode", self.getStatus(constants.Status.Status, constants.Status.STATUS.Mode)))
TypeError: Can't convert 'NoneType' object to str implicitly

GoPro Fusion - overview() is erroing

Hi Konrad,

I have just noticed that the overview() method return a error.

gpCam = GoProCamera.GoPro(constants.gpcontrol)
gpCam.overview()

return this :

camera overview
current mode: Video
current submode: Video
Traceback (most recent call last):

  File "<ipython-input-9-c0b03d50bfb9>", line 1, in <module>
    gpCam.overview()

  File "C:\Users\harry\Anaconda3\lib\site-packages\goprocam\GoProCamera.py", line 1027, in overview
    print("current video resolution: " + "" + self.parse_value("video_res",self.getStatus(constants.Status.Settings, constants.Video.RESOLUTION)))

TypeError: Can't convert 'NoneType' object to str implicitly

Any ideas ?

H.

Missing setting parameter for Time-Lapse-Video?

Hi KonradIT

first, thank you for your great GoPro-API. It works fine for me except one issue:

I do not find the parameter to set the interval of a Time Lapse Video.
In mode
gpCam.mode(constants.Mode.VideoMode, constants.Mode.SubMode.Video.TimeLapseVideo)
I'm able to set parameters like:
gpCam.gpControlSet(constants.Video.RESOLUTION, constants.Video.Resolution.R2k4by3)
But I can't find any option to set the frame rate or intervall for the Time Laps Video (like: 0.5sec, 1sec, 2sec, 5sec, 10sec, ...)

Is it missing or did I fail to find it?

Sincerely,
Philipp

Hero7 support

Hi Konrad, all,

Has anyone made it work with Hero 7 Black or the support is still in progress?

Cheers

Cannot connect to HERO5 Session

Hi there! Your api was working great last week, but I tried to use it on my new PI Zero W and to seems not to be working anymore, I get the error : ´str' does not support the buffer interface in line 96

Poor quality live streaming

Hi,

Thank for all your work on this api, it's really very useful!

I'm having trouble getting a decent quality stream from my gopro hero 4 to facebook. Even if I just display the stream locally, it's quite blury, unlike when I record using the camera normally.

In my gopro_keepalive.py script, I tried adding in:
gopro.streamSettings("4000000", "4"), it doesn't seem to change the quality, though.
For some reason it wouldn't resolve the constants when I tried:
gpCam.streamSettings(constants.Stream.Bitrate.B4Mbps, constants.Stream.WindowSize.R480) #For HERO4

It doesn't look like 480p streaming at all. It looks something more like 240p

In fb_live.sh, I put in:
VBR="4000k"
FPS="30"
QUAL="medium"

When I try to put QUAL = "high", I get

"Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"

Is there any way you can point me in the right direction?

It also goes kind of pixelated at times. However i'm not too sure what to make of the errors that the gopro_keepalive.py script gives:
[h264 @ 0x1f2f6e0] left block unavailable for requested intra4x4 mode -17kbits/s speed=1.05x
[h264 @ 0x1f2f6e0] error while decoding MB 0 12, bytestream 4295
[h264 @ 0x1f2f6e0] concealing 130 DC, 130 AC, 130 MV errors in P frame
[h264 @ 0x1b4b7f0] concealing 182 DC, 182 AC, 182 MV errors in P frame8.0kbits/s speed=1.05x
[h264 @ 0x1b9d040] concealing 207 DC, 207 AC, 207 MV errors in P frame7.7kbits/s speed=1.05x
[h264 @ 0x1f2f6e0] left block unavailable for requested intra mode=1137.4kbits/s speed=1.05x
[h264 @ 0x1f2f6e0] error while decoding MB 0 8, bytestream 7354

Thanks!

GoPro 5 cannot stream to VLC or OpenCV

Hello:

First, thanks for all of your work on this api -- it rocks!

I am having issues streaming from a GoPro 5 to OpenCV and VLC. I first run the gopro_keepalive.py script and then I run the gopro_opencv.py script (and get an error that when Googled tells me that OpenCV did not receive a video stream), or VLC (which doesn't display anything, and upon stopping VLC, get an error that according to a Google search signifies that VLC did not receive a video stream).

I have attached two screen shots that show the keepalive script running in one window, and opencv and/or VLC in the other. Any insight or advice you have on what I could be doing wrong is greatly appreciated!

Thanks!
Kerri
vlc-nostream
opencv-vlc-nostream-error

GoPro 6 can get informations but cannot stream to VLC.

Hello @KonradIT ,
Thank you for this amazing API.

I tried it on Windows 7, i can get the camera connected and get the overview infos, but when it came to streaming it fails.
I'm on the firmware 1.60.00, using pythonV3.7.0, and last ffmpegV4 64-bit (i also tried ffmpegV4 32bit just in case), and finally VLC-v3.03 to capture the stream using udp://localhost:5000.

Here's my code for quick testing :

from goprocam import GoProCamera
# from goprocam import constants

gpCam = GoProCamera.GoPro()
# gpCam.pair(usepin=False)  # I use this as said to pair for the first time.

print(gpCam.overview())  # I get the camera infos here but isRecording == Recording even if it's not !!!

gpCam.stream("udp://localhost:5000")  # I tried to switch order with gpCam.livestream("start") just in case but nothing
gpCam.livestream("start")

while True:  # just for quick testing
    print()

And here's the output :

ffmpeg version N-91378-g3f953379e1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 20.104 / 58. 20.104
  libavformat    58. 17.101 / 58. 17.101
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 25.100 /  7. 25.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[h264 @ 00997680] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00997680] decode_slice_header error
[h264 @ 00997680] no frame!
[mpegts @ 00982900] Could not find codec parameters for stream 2 (Unknown: none ([128][0][0][0] / 0x0080)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'udp://10.5.5.9:8554':
  Duration: N/A, start: 0.066733, bitrate: N/A
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709, progressive), 848x480 [SAR 1:1 DAR 53:30], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 193 kb/s
    Stream #0:2[0x200]: Unknown: none ([128][0][0][0] / 0x0080)
Please use -b:a or -b:v, -b is ambiguous
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
  Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
Press [q] to stop, [?] for help
[h264 @ 00a33280] concealing 1127 DC, 1127 AC, 1127 MV errors in P frame
[swscaler @ 08b63e00] deprecated pixel format used, make sure you did set range correctly
Output #0, mpegts, to 'udp://localhost:5000':
  Metadata:
    encoder         : Lavf58.17.101
    Stream #0:0: Video: mpeg2video (Main), yuv420p, 848x480 [SAR 1:1 DAR 53:30], q=2-31, 800 kb/s, 30 fps, 90k tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.20.104 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 0/0/800000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
    Metadata:
      encoder         : Lavc58.20.104 mp2
[h264 @ 05f86c00] concealing 1142 DC, 1142 AC, 1142 MV errors in P frame
[h264 @ 00a33a40] cabac decode of qscale diff failed at 51 8
[h264 @ 00a33a40] error while decoding MB 51 8, bytestream 2671
[h264 @ 00a33a40] concealing 1164 DC, 1164 AC, 1164 MV errors in P frame
[h264 @ 00a33280] concealing 504 DC, 504 AC, 504 MV errors in P frame
[h264 @ 00a33280] concealing 278 DC, 278 AC, 278 MV errors in P frame
[h264 @ 00a40000] concealing 129 DC, 129 AC, 129 MV errors in P frame
[h264 @ 00a33640] error while decoding MB 23 5, bytestream -33
[h264 @ 00a33640] concealing 1351 DC, 1351 AC, 1351 MV errors in I frame
[h264 @ 00a33640] cabac decode of qscale diff failed at 0 23
[h264 @ 00a33640] error while decoding MB 0 23, bytestream 500
[h264 @ 00a33640] concealing 420 DC, 420 AC, 420 MV errors in P frame
[h264 @ 00a33640] cabac decode of qscale diff failed at 20 24
[h264 @ 00a33640] error while decoding MB 20 24, bytestream 302
[h264 @ 00a33640] concealing 347 DC, 347 AC, 347 MV errors in P frame
[h264 @ 00a33280] cabac decode of qscale diff failed at 47 14
[h264 @ 00a33280] error while decoding MB 47 14, bytestream 1797
[h264 @ 00a33280] concealing 850 DC, 850 AC, 850 MV errors in P frame
[h264 @ 00a33280] cabac decode of qscale diff failed at 41 22
[h264 @ 00a33280] error while decoding MB 41 22, bytestream 580
[h264 @ 00a33280] concealing 432 DC, 432 AC, 432 MV errors in P frame
[h264 @ 00a33280] concealing 1162 DC, 1162 AC, 1162 MV errors in P frame
[h264 @ 00a33280] cabac decode of qscale diff failed at 10 18
[h264 @ 00a33280] error while decoding MB 10 18, bytestream 1542
[h264 @ 00a33280] concealing 675 DC, 675 AC, 675 MV errors in P frame
[h264 @ 00a33280] concealing 1140 DC, 1140 AC, 1140 MV errors in P frame
[h264 @ 00a40000] cabac decode of qscale diff failed at 20 6
[h264 @ 00a40000] error while decoding MB 20 6, bytestream 2778
[h264 @ 00a40000] concealing 1301 DC, 1301 AC, 1301 MV errors in P frame
[h264 @ 00a40000] concealing 1162 DC, 1162 AC, 1162 MV errors in P frame
[h264 @ 00a40000] concealing 890 DC, 890 AC, 890 MV errors in P frame
[h264 @ 00a40000] concealing 471 DC, 471 AC, 471 MV errors in P frame
[h264 @ 00a33a40] cabac decode of qscale diff failed at 22 20
[h264 @ 00a33a40] error while decoding MB 22 20, bytestream 1036
[h264 @ 00a33a40] concealing 557 DC, 557 AC, 557 MV errors in P frame
[h264 @ 05f86c00] concealing 178 DC, 178 AC, 178 MV errors in P frame
[h264 @ 05f86c00] cabac decode of qscale diff failed at 20 20
[h264 @ 05f86c00] error while decoding MB 20 20, bytestream 1802
[h264 @ 05f86c00] concealing 559 DC, 559 AC, 559 MV errors in P frame
[h264 @ 05f86c00] cabac decode of qscale diff failed at 36 25
[h264 @ 05f86c00] error while decoding MB 36 25, bytestream 714
[h264 @ 05f86c00] concealing 278 DC, 278 AC, 278 MV errors in P frame
[h264 @ 05f86c00] concealing 1240 DC, 1240 AC, 1240 MV errors in P frame
[h264 @ 05f86c00] concealing 676 DC, 676 AC, 676 MV errors in P frame
[h264 @ 00a33a40] concealing 108 DC, 108 AC, 108 MV errors in P frame
[h264 @ 05f86c00] error while decoding MB 52 28, bytestream -5
[h264 @ 05f86c00] concealing 103 DC, 103 AC, 103 MV errors in P frame
[h264 @ 05f86c00] concealing 881 DC, 881 AC, 881 MV errors in P frame
[h264 @ 00a33a40] cabac decode of qscale diff failed at 25 6
[h264 @ 00a33a40] error while decoding MB 25 6, bytestream 3839
[h264 @ 00a33a40] concealing 1296 DC, 1296 AC, 1296 MV errors in P frame
[h264 @ 00a33a40] concealing 1017 DC, 1017 AC, 1017 MV errors in P frame
[h264 @ 00a33a40] concealing 1284 DC, 1284 AC, 1284 MV errors in P frame
[h264 @ 00a33280] concealing 812 DC, 812 AC, 812 MV errors in P frame
[h264 @ 00a40000] concealing 570 DC, 570 AC, 570 MV errors in P frame
[h264 @ 00a33280] concealing 1233 DC, 1233 AC, 1233 MV errors in P frame
[h264 @ 00a33280] concealing 622 DC, 622 AC, 622 MV errors in P frame
[h264 @ 00a33280] cabac decode of qscale diff failed at 7 21
[h264 @ 00a33280] error while decoding MB 7 21, bytestream 39601
[h264 @ 00a33280] concealing 519 DC, 519 AC, 519 MV errors in P frame
[h264 @ 00a33640] cabac decode of qscale diff failed at 6 10
[h264 @ 00a33640] error while decoding MB 6 10, bytestream 19291
[h264 @ 00a33640] concealing 1103 DC, 1103 AC, 1103 MV errors in P frame
[h264 @ 00a33640] concealing 1273 DC, 1273 AC, 1273 MV errors in P frame
[h264 @ 00a33640] concealing 1232 DC, 1232 AC, 1232 MV errors in P frame
[h264 @ 00a33640] concealing 1257 DC, 1257 AC, 1257 MV errors in P frame
[h264 @ 00a33640] concealing 1008 DC, 1008 AC, 1008 MV errors in P frame
[h264 @ 00a33280] concealing 164 DC, 164 AC, 164 MV errors in P frame
[h264 @ 00a40000] concealing 1159 DC, 1159 AC, 1159 MV errors in P frame
[h264 @ 00a40000] concealing 1135 DC, 1135 AC, 1135 MV errors in P frame
[h264 @ 00a40000] concealing 1092 DC, 1092 AC, 1092 MV errors in P frame
[h264 @ 00a40000] cabac decode of qscale diff failed at 0 16
[h264 @ 00a40000] error while decoding MB 0 16, bytestream 1526
[h264 @ 00a40000] concealing 791 DC, 791 AC, 791 MV errors in P frame
[h264 @ 05f86c00] cabac decode of qscale diff failed at 6 7
[h264 @ 05f86c00] error while decoding MB 6 7, bytestream 3098
[h264 @ 05f86c00] concealing 1262 DC, 1262 AC, 1262 MV errors in P frame
[h264 @ 05f86c00] concealing 1045 DC, 1045 AC, 1045 MV errors in P frame

And sometimes is starts with :

[mpegts @ 0000000000502d40] PES packet size mismatch
    Last message repeated 1 times
[mpegts @ 0000000000502d40] Could not find codec parameters for stream 2 (Unknown: none ([128][0][0][0] / 0x0080)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options

Do i need to upgrade to the last firmware 2.01 ? i hope not, it's a disaster ^^"
Can you help with this one please ?

Thank you so much for keeping this a live.
Karam.

GoProCam problem

Hello,
Theres a small problem in line 751. Whenever I run the code it give a error there. It might just be the use of { instead of ':'

Hero 6 black - multi cam

I would like to use your API to synchronize a same order to 3 cameras. Should I be able to do this if I made an AP mode in my computer ?

Cannot install goprocam via PIP

Cannot install goprocam via PIP because of missing README.md.

# pip install goprocam
Collecting goprocam
  Using cached https://files.pythonhosted.org/packages/bf/eb/8a7ac4b170ab95dfe13862b0ae73851116ee5d071e471d32899db2f08213/goprocam-2.0.5.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-KyU8Yu/goprocam/setup.py", line 2, in <module>
        with open("README.md", "r") as fh:
    IOError: [Errno 2] No such file or directory: 'README.md'

Take a shot when shooting video

Hi, GoPro5H has a mode is take shot per n seconds when shoot video.
Can I send a request to take a photo during shooting video?
Thanks a lot!

delete in gopro3+ retuerns error

gpCam.delete("last")
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/goprocam/GoProCamera.py", line 303, in delete
print(self.sendCamera("DL"))
File "/usr/local/lib/python3.6/site-packages/goprocam/GoProCamera.py", line 113, in sendCamera
urllib.request.urlopen('http://10.5.5.9/camera/' + param + '?t=' + self.getPassword() + value_no tempty, timeout=5).read()
UnboundLocalError: local variable 'value_notempty' referenced before assignment

Install issues

I can connect my rPi to the GoPro wifi, and send commands via curl http://10.5.5.9/..... but, the wifi times out on the gopro after about 5 minutes. So i thought that the gopro-py-api might be the way to go.

cloned it to the Pi, but fails on running setup.py on line 1. Something about setuptools. So i installed setuptools, but still errors. The Pi has Raspbian Stretch Lite installed and Python3.
I'm pretty certain that it will be something that i'm doing wrong.

My goal is simply to be able to send a shutter activation command to the gopro in burst mode 10 frames/3 seconds).
Where am i going wrong?

Many thanks

Stream to Motion

Hi all,

Sorry for limited styling, first time post on Github and limited experience.

I'd like to feed Motion with my GoPro stream.
I can get the GoPro running, taking photos and streaming to UDP and everything.

However, I can't get Motion to work with the UDP stream (net_cam_url pointing to UDP://ip address doesn't work) and therefore try to stream to /dev/video0, to run Motion as if the stream was coming from a USB camera directly.

I'm using the following code.

from goprocam import GoProCamera from goprocam import constants gopro = GoProCamera.GoPro() gopro.stream("/dev/video0")

This doesn't work and I don't understand why.

I've also tried just running ffmpeg in a similar manner:

` from goprocam import GoProCamera
from goprocam import constants

ip_addr="10.5.5.100"
subprocess.Popen("ffmpeg -f mpegts -i udp://"+ ip_addr + ":8554 v4l2 /dev/video0", shell=True)`

But that doesn't work either. Motion can't find a camera on /dev/video0.
VLC or OXM can't find anything on /dev/video0 either.

What am I missing here?

I've read about feeding Motion with a loopback but that seems more applicable to static files and I can't get that to run either.

Anyone who can help me out? Anyone successfully combined Motion with a GoPro stream?

Cheers

GoPro hero can not stop and download

Hello:

Thanks for your work on this api !

I recently bought a GoPro hero,GoPro hero was on sale in April this year,This is the latest GoPro product。But I have some problems now:
1.To start a video or take a picture: "gpCam.shutter(constants.start) " is noproblem。 2."gpCam.shutter(constants.stop)" can not stop a video or timelapse。
3."gpCam.downloadLastMedia()" can't use either。
Can you help me?

Thanks
chen

Thanks!

streamSettings available parameters

Hello

Thank you for such useful information and library. I'm not sure what the settings are expected with the function streamSettings(bitrate, resolution). Could you please list the possible ones? Thx.

Camera: Hero4 Black.

Launch ffplay with python - Android

  1. In order to have one self contained py script to go in streaming with session 4 which command line in python of the equivalent ffplay -an -fflags nobuffer -f:v mpegts -probesize 8192 rtp://10.5.5.9:8554?

2)possibility to do the same by android. API could work on SMARTPHONE?
Used GoProStream.py on samsung S5 and works properly but none ffmpeg app is able to stream on udp 8554 ..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.