jschmid1 / gopro_as_webcam_on_linux

Allows to use your GoPro camera as a webcam on linux
Apache License 2.0
539 stars 68 forks source link

Error while starting webcam mode #30

Open trummerschlunk opened 3 years ago

trummerschlunk commented 3 years ago

Hello, thanks for the software. I am having issues getting it to work. It always ends with and error while starting webcam mode. Here is the output. Any hints very much appreciated. Thanks.

sudo gopro webcam
Running GoPro Webcam Util for Linux [0.0.3]

       Launch Options
==========================
 * Non-interactive:  0
 * Autostart:        0
 * Preview:          0
 * Resolution:       1080p
 * FOV:              linear
==========================

v4l2loopback is loaded!
v4l2loopback was unloaded successfully.
v4l2loopback was successfully loaded.
Please plug in your GoPro and switch it on. If it booted successfully (Charger icon on screen), hit Return

Guessing the GoPro's device name...
I can only make an uneducated guess wrt the name of the interface that the GoPro exposes.
For me the name of the interface is 'enxf64854ee7472'. This script will try to discover the device
that was added *last*, as you just plugged in the camera, hence the interface added last should be the one we're looking for.

Discovered: enp57s0u1u2.
Using enp57s0u1u2 to discover the GOPRO_IP.
Found 192.168.0.122
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 192.168.0.51
Error while starting the Webcam mode. # TODO Useful message.`
trummerschlunk commented 3 years ago

I am runnig arch linux.

DogyDHW commented 3 years ago

Your GoPro get a wrong ip. If i switch my GoPro Connection to MTP i get a simliar IP. Did you changed the Connection type to "GoPro Connect"?

chrisfoster121 commented 2 years ago

Hello,

I appear to be having the same issue.

Running GoPro Webcam Util for Linux [0.0.3]

       Launch Options     
==========================
 * Non-interactive:  0
 * Autostart:        0
 * Preview:          0
 * Resolution:       1080p
 * FOV:              linear
==========================

v4l2loopback is loaded!
v4l2loopback was unloaded successfully.
v4l2loopback was successfully loaded.
Please plug in your GoPro and switch it on. If it booted successfully (Charger icon on screen), hit Return

Guessing the GoPro's device name...
I can only make an uneducated guess wrt the name of the interface that the GoPro exposes.
For me the name of the interface is 'enxf64854ee7472'. This script will try to discover the device
that was added *last*, as you just plugged in the camera, hence the interface added last should be the one we're looking for.

Discovered: wlp2s0.
Using wlp2s0 to discover the GOPRO_IP.
Found 10.0.0.25
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 10.0.0.51
Error while starting the Webcam mode. # TODO Useful message.

Is there some configuration that needs to be done that I have missed? @DogyDHW what do you mean by "GoPro Connect"?

chrisfoster121 commented 2 years ago

I just noticed that this only supports the Hero 8+ (if I read that correctly). That is likely my issue.

DogyDHW commented 2 years ago

@chrisfoster121 some older GoPro's are support a webcam mode on the official Windows App with the newest firmware. Look in the settings on your GoPro for USB-Connection. I need to change it from "MTP" to "GoPro Connect" in this setting. Its maybe working on your GoPro :)

msonowal commented 2 years ago

Same issue on hero 10, and I do not see any settings related to USB connection. Anybody success with hero 10?

oVerde commented 2 years ago

What is GoPro Connect @DogyDHW ?

My GoPro is the Hero3, does any one of you @jschmid1, @juchem, @raleighlittles guys know anything?

raleighlittles commented 2 years ago

Sorry @oVerde , I don't know anything about this. I'm not involved in this project at all; you might've seen my name on a recent commit but that was a documentation change only. I don't have this issue with my GoPro Hero 10.

Did you see this response from @DogyDHW ? https://github.com/jschmid1/gopro_as_webcam_on_linux/issues/30#issuecomment-989190899

ablce9 commented 1 year ago

Worked fine below:

$ ip a|grep enx
42: enxd474f796c6dc: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
$ dhclient -v enxd474f796c6dc 
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enxd474f796c6dc/d4:74:f7:96:c6:dc
Sending on   LPF/enxd474f796c6dc/d4:74:f7:96:c6:dc
Sending on   Socket/fallback
DHCPDISCOVER on enxd474f796c6dc to 255.255.255.255 port 67 interval 8
DHCPOFFER of 172.21.155.52 from 172.21.155.51
DHCPREQUEST for 172.21.155.52 on enxd474f796c6dc to 255.255.255.255 port 67
DHCPACK of 172.21.155.52 from 172.21.155.51
bound to 172.21.155.52 -- renewal in 415188 seconds.
$ curl -v 172.21.155.51/gp/gpWebcam/START
*   Trying 172.21.155.51:80...
* Connected to 172.21.155.51 (172.21.155.51) port 80 (#0)
> GET /gp/gpWebcam/START HTTP/1.1
> Host: 172.21.155.51
> User-Agent: curl/7.74.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 31
< 
{
        "status": 2,
        "error": 0
}

* Connection #0 to host 172.21.155.51 left intact
$ ls /dev/video42
$ ffmpeg -threads 1 -i 'udp://@0.0.0.0:8554?overrun_nonfatal=1&fifo_size=50000000' -f:v mpegts -fflags nobuffer -vf format=yuv420p -f v4l2 /dev/video42

I dug a bit and found a solution in here: https://askubuntu.com/questions/1200298/using-a-gopro-as-a-webcam

mysteryx93 commented 1 year ago

Using Arch Linux, I have the same problem with a Hero 9. USB mode is set to GoPro Connect.

This issue hasn't been resolved yet? While the script can be a work-around, doing that manual work isn't really a solution.

Here's my log

╰─λ sudo gopro webcam
[sudo] password for hanuman:
Running GoPro Webcam Util for Linux [0.0.3]

Launch Options
==========================
* Non-interactive:  0
* Autostart:        0
* Preview:          0
* Resolution:       1080p
* FOV:              linear
==========================

v4l2loopback is loaded!
v4l2loopback was unloaded successfully.
v4l2loopback was successfully loaded.
Please plug in your GoPro and switch it on. If it booted successfully (Charger icon on screen), hit Return

Guessing the GoPro's device name...
I can only make an uneducated guess wrt the name of the interface that the GoPro exposes.
For me the name of the interface is 'enxf64854ee7472'. This script will try to discover the device
that was added *last*, as you just plugged in the camera, hence the interface added last should be the one we're looking for.

Discovered: enp0s20f0u3.
Using enp0s20f0u3 to discover the GOPRO_IP.
Found 192.168.0.1
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 192.168.0.51
Error while starting the Webcam mode. # TODO Useful message.
jodstrcil commented 1 year ago

I was getting the same. What worked for me was to run the command with -d flag :

sudo gopro webcam -d enxcacfe3b065ad

To find out the device number run:

ip a|grep enx

This only works if the GoPro is connected via USB and turned on.