Coder Social home page Coder Social logo

gopro_as_webcam_on_linux's Introduction

Use your GoPro as a webcam on Linux (without additional hardware)

Currently there is no official support for using your GoPro 8, 9, or 10 (the only versions that offer this feature natively) as a webcam on Linux. The web is full of incomplete tutorials for this topic. This script tries to simplify this effort.

Installation

git clone https://github.com/jschmid1/gopro_as_webcam_on_linux
sudo ./install.sh

The gopro script is installed at /usr/local/sbin/gopro.

Usage

sudo gopro webcam

Starts the tool in the interactive mode and tries to identify the GoPro's device, find the interface and ultimately start the webcam mode.

There are a couple of parameters you can set if this isn't enough. See Synopsis or the --help text

Synopsis

Usage:  action [options...]
Options:
  -n,  --non-interactive   do not wait for user input. Use this when used in a startup-script/fstab

  -p,  --device-pattern    provide a device pattern i.e. (enx, lsr) in case the script failed
                           to detect one by itself.

  -d,  --device            provide a full device name i.e. (enxenx9245589250e7)
                           USE WITH CAUTION. THIS CHANGES EVERY TIME YOU REBOOT/RECONNECT THE CAMERA
                           THIS OPTION IS NOT SUITABLE FOR AUTOMATION!

  -r,  --resolution        select the resolution you would like the GoPro to output. "1080", "720", or "480."
  
  -f,  --fov               select the FOV you would like to use. "wide", "linear", or "narrow."

  -i,  --ip                provide a IPv4 address to the GoPro i.e. (172.27.187.52)
                           CAUTION! This may change over time.
  
  -a,  --auto-start        automatically start ffmpeg to serve the GoPro as a video device to your operating system.
                           If this flag is omitted, print the corresponding command to run it yourself.

  -v,  --preview           Just launch a preview in VLC. This will not expose the device to the OS.

  -u,  --user              VLC can't be started as root, please provide a username you want to run it with. (Typically your 'default/home' user)

  -V,  --verbose           echo every command that gets executed

  -h,  --help              display this help
Commands:
  webcam                   start the GoPro in webcam mode

Formats supported

After launched in webcam mode, the device only supports one format:

	[0]: 'YU12' (Planar YUV 4:2:0)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)

Examples

gopro webcam -p enx -n -a

Find a device that matches the pattern 'enx' (which is the gopro device for me) and starts the webcam mode without asking for user input. It also starts ffmpeg and exposes the device to the OS.

gopro webcam -d enxenx9245589250e7 -n -r

Use the provided device 'enxenx9245589250e7' and do not ask for user input. Just start VLC to preview the output you'll get from the Camera.

gopro webcam -i 172.27.187.52 -a -n

Use the provided ip '172.27.187.52' and automatically start an ffmpeg to expose the device to the OS. Also don't ask for user input.

Start on boot

It's rather annoying to start this script every time you start up your PC. This is why I provided an example service file in this repository.

Note that the GoPro needs to be plugged in and be in 'standby' mode (Charger symbol) when the computer boots

[Unit]
Description=GoPro Webcam start script
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
ExecStart=/usr/local/sbin/gopro webcam -a -n
Restart=on-failure
RestartSec=15s

[Install]
WantedBy=multi-user.target

Feel free to adapt it to your needs and copy it to /etc/systemd/system/

sudo cp gopro_webcam.service /etc/systemd/system/

sudo systemctl start gopro_webcam.service sudo systemctl status gopro_webcam.service

Logs can be followed with sudo journalctl -u gopro_webcam -f

If all looks fine.

sudo systemctl enable gopro_webcam.service

Start on plug in

You can also start the script when plugging in the usb cable or powering on the camera using udev rules. The script is also stopped without error when unplugging or powering off the camera. You can find an example file 60-gopro.rules in the repo.

To set this up, first follow the service installation in Start on boot above. You can skip the last step sudo systemctl enable gopro_webcam.service if you don't want to script to start and fail on every startup.

Then copy the rule file sudo cp 60-gopro.rules /lib/udev/rules.d/. Now the setup is complete.

You can check the status using systemctl and journalctl as described above.

A known issue is that the first service start fails. The second service start then succeeds about 10s later. This is because even the service is only started after the ethernet interface, the network is not fully initialized. The service fails then because no ip is yet available. In the second try, the network is then usually initialized.

Also the udev rule currently only works for HERO8 BLACK. The rules in the file can be duplicated and adapted for every new model supporting webcam mode released by GoPro in the future.

Dependencies

sudo apt install ffmpeg v4l2loopback-dkms curl vlc

Traffic on port 8554/udp of the webcam network interface must be enabled e.g. with firewalld:

sudo firewall-cmd --add-port 8554/udp
sudo firewall-cmd --add-port 8554/udp --permanent

If your distribution doesn't provide v4l2loopback-dkms you may get it from https://github.com/umlaeute/v4l2loopback

Troubleshooting

I can't find the network device for my GoPro

Double check that the USB connection mode is GoPro Connect and not MTP under Preferences -> Connections -> USB Connection. If that options doesn't exist, you likely need a firmware upgrade. Instructions can be found at https://gopro.com/en/us/update.

Release History

  • 0.0.1
    • Work in progress
  • 0.0.2
    • Added args and arg parsing which
    • Allows to run at OS startup for easily

Credits

Credits go to https://github.com/KonradIT for a comprehensive documentation and tooling around inofficial GoPro things.

Buy the developer a cup of coffee!

If you found the utility helpful you can buy me a cup of coffee using

Donate

Contributing

  1. Fork it (https://github.com/jschmid1/gopro_as_webcam_on_linux/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

gopro_as_webcam_on_linux's People

Contributors

andrewnicolalde avatar fmstrat avatar jschmid1 avatar juchem avatar newoistaken avatar raleighlittles avatar robinj1995 avatar rplevka avatar xxc3nsoredxx 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

gopro_as_webcam_on_linux's Issues

cannot install

When trying to run "sudo su -c "bash <(wget -qO- https://cutt.ly/PjNkrzq)" root" I get: chmod: cannot access '/usr/local/sbin/gopro': No such file or directory

What do I have to do ?

Problem discovering GoPro

I have a GoPro 8 Black. It is connected and "on" with a usb symbol on the front. small screen. When I run

sudo gopro webcam -p enx

I get

Could not discover a interface. Please restart the script by providing the device or the device pattern that the GoPro exposes (use 'ip addr' for that) i.e. gopro webcam -d enx123123123 or i.e. gopro webcam -p lxr

I have tried a few things. when i use lsusb I can see it. I know this may be something stupid on my end but I need some help. Thanks

No license

Hey @jschmid1, it seems like this project currently does not have a license. Is it possible that you choose one to us so I can also attach it to the AUR?

[Feature Request] Increase streaming resolution/framerate

Hello! Thanks for supporting this project!

Currently, the max setting for streaming is 1080p/30fps.
I'm wondering if it would be possible to add some more configurations for resolution (4K/5.3K), and framerate (60fps)?
Maybe also HDR, and color bitrate.
That would be very helpful !!!

Thanks!

Using the auto start on plug it fails the first time, but succeeds the second time

I've been able to get the udev rules to work to start and stop the service on plug. The only issue I have is thatit fails to discover a valid GOPRO_IP the first time, but when the the service restarts it finds it. Is there a way so it doesn't failthe first time?

First run

Apr 12 17:09:26 samticus-comouman systemd[1]: Started GoPro Webcam start script.
Apr 12 17:09:26 samticus-comouman gopro[165927]: Running GoPro Webcam Util for Linux [0.0.3]
Apr 12 17:09:26 samticus-comouman gopro[165927]:        Launch Options
Apr 12 17:09:26 samticus-comouman gopro[165927]: ==========================
Apr 12 17:09:26 samticus-comouman gopro[165927]:  * Non-interactive:  1
Apr 12 17:09:26 samticus-comouman gopro[165927]:  * Autostart:        1
Apr 12 17:09:26 samticus-comouman gopro[165927]:  * Preview:          0
Apr 12 17:09:26 samticus-comouman gopro[165927]:  * Device Pattern:   enp
Apr 12 17:09:26 samticus-comouman gopro[165927]: ==========================
Apr 12 17:09:26 samticus-comouman gopro[165927]: v4l2loopback is loaded!
Apr 12 17:09:26 samticus-comouman gopro[165927]: v4l2loopback was unloaded successfully.
Apr 12 17:09:26 samticus-comouman gopro[165927]: v4l2loopback was successfully loaded.
Apr 12 17:09:26 samticus-comouman gopro[165927]: Using provided device pattern enp
Apr 12 17:09:26 samticus-comouman gopro[165927]: 
Apr 12 17:09:26 samticus-comouman gopro[165927]: Discovered: enp1s0f0u4.
Apr 12 17:09:26 samticus-comouman gopro[165927]: Using enp1s0f0u4 to discover the GOPRO_IP.
Apr 12 17:09:26 samticus-comouman gopro[165927]: Could not automatically discover a valid GOPRO_IP. Use the '-p, -d or -i' option to provide more information. (see --help for more information)
Apr 12 17:09:26 samticus-comouman systemd[1]: gopro_webcam.service: Main process exited, code=exited, status=1/FAILURE
Apr 12 17:09:26 samticus-comouman systemd[1]: gopro_webcam.service: Failed with result 'exit-code'.
Apr 12 17:09:41 samticus-comouman systemd[1]: gopro_webcam.service: Scheduled restart job, restart counter is at 1.
Apr 12 17:09:41 samticus-comouman systemd[1]: Stopped GoPro Webcam start script.

Restart

Apr 12 17:09:41 samticus-comouman systemd[1]: Started GoPro Webcam start script.
Apr 12 17:09:41 samticus-comouman gopro[166016]: Running GoPro Webcam Util for Linux [0.0.3]
Apr 12 17:09:41 samticus-comouman gopro[166016]:        Launch Options
Apr 12 17:09:41 samticus-comouman gopro[166016]: ==========================
Apr 12 17:09:41 samticus-comouman gopro[166016]:  * Non-interactive:  1
Apr 12 17:09:41 samticus-comouman gopro[166016]:  * Autostart:        1
Apr 12 17:09:41 samticus-comouman gopro[166016]:  * Preview:          0
Apr 12 17:09:41 samticus-comouman gopro[166016]:  * Device Pattern:   enp
Apr 12 17:09:41 samticus-comouman gopro[166016]: ==========================
Apr 12 17:09:41 samticus-comouman gopro[166016]: v4l2loopback is loaded!
Apr 12 17:09:41 samticus-comouman gopro[166016]: v4l2loopback was unloaded successfully.
Apr 12 17:09:41 samticus-comouman gopro[166016]: v4l2loopback was successfully loaded.
Apr 12 17:09:41 samticus-comouman gopro[166016]: Using provided device pattern enp
Apr 12 17:09:41 samticus-comouman gopro[166016]: 
Apr 12 17:09:41 samticus-comouman gopro[166016]: Discovered: enp1s0f0u4.
Apr 12 17:09:41 samticus-comouman gopro[166016]: Using enp1s0f0u4 to discover the GOPRO_IP.
Apr 12 17:09:41 samticus-comouman gopro[166016]: Found 172.27.199.54
Apr 12 17:09:41 samticus-comouman gopro[166016]: To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Apr 12 17:09:41 samticus-comouman gopro[166016]: Now using this GOPRO_IP internally: 172.27.199.51

My modified 60-gopro.rules

SUBSYSTEM=="net", ATTRS{idVendor}=="2672", ATTRS{product}=="HERO9", ACTION=="add", RUN+="/usr/sbin/systemctl start gopro_webcam"
SUBSYSTEM=="net", ATTRS{idVendor}=="2672", ATTRS{product}=="HERO9", ACTION=="remove", RUN+="/usr/sbin/systemctl stop gopro_webcam"

My modified gopro_webcam.service

[Unit]
Description=GoPro Webcam start script
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
ExecStart=/usr/local/sbin/gopro webcam -p enp -a -n
Restart=on-failure
RestartSec=15s

[Install]
WantedBy=multi-user.target

Lookd like FFMPEG it's not starting correctly

I've been using mu GoPRO with this script for the past week but now when I run the command

$ sudo gopro webcam -p enx -n -a

I get this output:

Running GoPro Webcam Util for Linux [0.0.3]

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

v4l2loopback is loaded!
v4l2loopback was unloaded successfully.
v4l2loopback was successfully loaded.
Using provided device pattern enx

Discovered: enx624213007f25.
Using enx624213007f25 to discover the GOPRO_IP.
Found 172.23.118.53
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 172.23.118.51
{ "status": 1, "error": 1 }
{ "status": 1, "error": 0 }
Sucessfully started the GoPro Webcam mode. (The icon on the Camera should have changed)
Starting ffmpeg..
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

and looks like the FFMPEG doesn't start to stream the feed of the GoPRO.
What it's wrong?

best wishes
Paulo Aboim Pinto

GUI

"I also would like to use my GoPro as a webcam on Linux but do not want to go through the CLI or use it." - normal user

I am a Linux developer and am pretty much skilled in CLI (and in programming general). Some people that are used to the GUI UX and are coming from Windows want to use their GoPro like on Windows (where the GoPro Webcam software exists).

I wanted to ask you @jschmid1 what your plans are? Do you have some plans to create a GUI or less technical solution for "normal" people?

I can help if help is needed.

Camera remains on after stopping systemd service

Model: GoPro Hero10 Black

I used the command sudo systemctl stop gopro_webcam.service which brings down the virtual video stream device but the camera remains active and in webcam mode even after. Is there a way to put camera into standby mode and turn off the screen?

Can't seem to get past the install, really not positive what my issue is?

Running the new script

/dev/fd/63: line 20: curl: command not found
chmod: cannot access '/usr/local/sbin/gopro': No such file or directory


The GoPro install script succeeded
Run with with:
sudo gopro


sudo: gopro: command not found`

running the deprecated script

`Leaving this here to maintain backwards compatibility to any users who may just do a backwards search in their history to re-run this script.

Just FYI, there is a new version of the script with more functionality, including:

  • Provide a device pattern for which look for
  • Provide a device directly
  • Provide an IP
  • Auto-start and Preview mode.
  • and more..

All of these features will hopefully simplify using a GoPro as a camera in the day-to-day life by allowing it to run automated in a start-up script.

If you wish to use the new version just check the Github repository. The README should be updated.
v4l2loopback is not loaded!
v4l2loopback was successfully loaded.
Please plug in your GoPro and switch it on. If it booted successfully (Charger icon on screen), hit Return

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: enx36749da17635.
Using this to discover the IP.
Found 172.26.167.53
To control the GoPro, we need to contact another interface (IP ending with .51).. Adapting internally..
Now using this IP internally: 172.26.167.51
/dev/fd/63: line 133: curl: command not found
Error while starting the Webcam mode. # TODO Useful message.`

Really excited to potentially resolve this :)

latency evaluation

Thanks for this project.
Is there any latency metrics of the feed ?
I intend to use a GoPro in a live gesture recognition project and I wonder how much is the latency.
(anything beyond 100ms will be a huge problem for me)

ffmpeg freezed, wrong IP, rotation and 'nice-to-have's

Thanks for your script. I would still struggle with other issues if there was no your gopro repo.
My camera is GoPro HERO10.

When ffmpeg is executed it gets freezed on this:

ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

ifconfig shows positive values of RX packets/bytes for camera though.
It might be something with marking connection as ESTABLISHED.
To remedy this I tried the script below before ffmpeg

gopro_device=`ip -4 --oneline link | grep -v "state DOWN" | grep -v "LOOPBACK" | grep -v "NO-CARRIER" | cut -f2 -d":" | tail -1`
# will succeed when goPro IP is last on the list: ip -4 --oneline link ...
gopro_ip=`ip -4 addr show dev $gopro_device | grep -Po '(?<=inet )[\d.]+'`
gopro_interface_ip=`echo "$gopro_ip" | awk -F"." '{print $1"."$2"."$3".51"}'`

# tcpdump
# GoPro has to be turned on to get its port, tcpdump will wait for the start of webcam mode: curl -s ${gopro_interface_ip}/gp/gpWebcam/START?res=480
gopro_port=`tcpdump -ni $gopro_device -c 1 dst port 8554 2>/dev/null | grep -o '51.[0-9]*' | grep -o '.[0-9]*$' | cut -c2-`
echo -n "gopro" | nc -w0 -u $gopro_interface_ip $gopro_port -s $gopro_ip -p 8554 >/dev/null

and voilร  :-) ffmpeg works. Lets call it a "tcpdump script".


Wrong IP

It might be something with VPN connection when you turn on your GoPro before VPN resulting GoPro's IP being not last.
For that case

ip -4 --oneline link | grep -v "state DOWN" | grep -v "LOOPBACK" | grep -v "NO-CARRIER" | cut -f2 -d":" | tail -1

gives wrong name of device (~287 line of code).
Script will not work when -p | --device-pattern is not used.


Rotation issue

It might happen that you prefer portrait but on e.g. Zoom preview you are 'landscaped' ๐Ÿ˜‰
In ffmpeg one can add a rotation by slight change of format and add a metadata:

ffmpeg [...] -vf "rotate=PI/2,format=yuv420p" -metadata:s:v rotate=0 -f v4l2 /dev/video42

It might not be the best solutions because upper and bottom part of video are cropped, but I didn't find anything better yet.


Nice to have's

Exit webcam

One can quit webcam mode of GoPro by:
curl -s ${GOPRO_INTERFACE_IP}/gp/gpWebcam/EXIT
If it does not work, then /gopro/webcam/exit is another option to check.

"WebCam on demand"

ffmpeg consumes a lot of CPU, so option to finish it would be a better choice.
ffmpeg without -nostdin enables to press q for exit.
With this option one can prepare for meeting

  1. curl -s ${GOPRO_INTERFACE_IP}/gp/gpWebcam/START?res=${GOPRO_RESOLUTION}
  2. "tcpdump script"
  3. start ffmpeg
  4. presentation, stand-up, lecture or anything else - you name it ๐Ÿ˜‰ ...
  5. press q in ffmpeg
  6. stop webcam curl -s $GOPRO_INTERFACE_IP/gp/gpWebcam/STOP
  7. maybe also exit, but I didn't try that yet: curl -s ${GOPRO_INTERFACE_IP}/gp/gpWebcam/EXIT

Is there any video meeting soon? Go back to 1. step.

There are some minor challenges still,
but I would still struggle with "webcam on linux user-story" if there was no your repo.
Thanks for this. :)

No streaming ...

Hi Joschua and viiiiiiilelen Dank for your nice idea!

The shell script says it recognizes a gopro camera and grabs an IP out of it. Then it start the camera mode.
Unfortunately none of the expressions you provide in green (for ffmpeg and vlc) shows a working stream.
ffmpeg blocks (does not stream) and VLC does not start any rendering.

On which infrastructure and which gopro camera did you test it?

My infrastructure:
a miniPCย with 6.2.0-37-generic #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 2 18:01:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

VLC and v4l2loopback-dkms are also installed, as you recommend - besides obviously ffmpeg.
Note:ย my ffmpeg is separately happily streaming an attached second camera Logitech pro into an RTMP server. My test with your script are standalone - for the sake of simplicity, no other ffmpeg action is running.

No firewall is active and if yes, allowed 8554 as you show. Port 8554 is free and can be used in both directions.

Any idea where to go from here? Thanks a lot in advance!
Of course I can provide if necessary the output but it is equal to some other issues.

Unable to use the gopro as a webcam even if it seems to be detected on my linux

First of all, well done for this repo, this is awesome :)

I'm close to make things work on my computer but I'm still facing an issue.

So I followed readme steps:
sudo su -c "bash <(wget -qO- https://cutt.ly/PjNkrzq)" root

then I installed the dependency:
sudo apt install ffmpeg v4l2loopback-dkms

Plug the gopro on my computer

And run the command
sudo gopro webcam
On the GoPro screen, I can successfully see that it's in webcam mode.

Then I run vlc, which seems to detect the gopro but I have a black screen :(

I also tried a google meet, to see if it's showing the gopro but it is not detected.

Tell me if I can give any details to investigate my issue.

I'm using:
Ubuntu 20.04.1 LTS
GoPro 9, latest updated version
GoPro (without battery) + Computer plugged with type C wire.

Here some logs:

sudo gopro webcam -p enx -n -a


Running GoPro Webcam Util for Linux [0.0.2]

       Launch Options     
==========================
 * Non-interactive:  1
 * Autostart:        1
 * Preview:          0
 * Device Pattern:   enx
==========================

v4l2loopback is loaded!
v4l2loopback was unloaded successfully.
v4l2loopback was successfully loaded.
Using provided device pattern enx

Discovered: enxfa046d4ab172.
Using enxfa046d4ab172 to discover the GOPRO_IP.
Found 172.21.112.54
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 172.21.112.51
 { "status": 2, "error": 0 }
Sucessfully started the GoPro Webcam mode. (The icon on the Camera should have changed)
Starting ffmpeg..
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100


Error while starting the Webcam mode

I'm having an issue with the webcam mode. Not sure where is the error detail.

Device:
GoPro Hero 5 Session
Ubuntu 18.4.2 on Arm64
Wifi is connected to GoPro AP

$ sudo gopro webcam
Running GoPro Webcam Util for Linux [0.0.2]

       Launch Options
==========================
 * Non-interactive:  0
 * Autostart:        0
 * Preview:          0
==========================

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: wlx00e0232059ea.
Using wlx00e0232059ea to discover the GOPRO_IP.
Found 10.5.5.100
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 10.5.5.51
Error while starting the Webcam mode. # TODO Useful message.

Help would be much appreciated

Starting and stopping gopro_webcam.service leads to failure to reconnect to camera

With a HERO8 BLACK working as a webcam (blinking red light on camera, video in cheese)...
manually stopping the gopro_webcam.service does not kick the camera out of webcam mode.
When restarting the service it will not reconnect - and the red light on the camera stays on, no longer blinking.

This prevents changing modes, or reconnecting after a reboot, as the camera must be power cycled to connect a second time.

Error while starting the Webcam mode.

`cxc@cxc-Latitude-5580:~$ sudo gopro webcam -i 192.168.1.51
Running GoPro Webcam Util for Linux [0.0.3]

   Launch Options     

==========================

  • Non-interactive: 0
  • Autostart: 0
  • Preview: 0
  • Resolution: 1080p
  • FOV: linear
  • IP Address: 192.168.1.51
    ==========================

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 Return51
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.1.51
Error while starting the Webcam mode. # TODO Useful message.
`

Hi, i receive this messages and this error... can you help me?
i have a gopro 5 black with Ubuntu 22.04.1 LTS
thank's a lot.
ciao
Carlo A.

Error while starting webcam mode

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.`

Hero 8 Lens Select

Hello,

I used this script on Arch Linux, and run out-of-the-box, but I need to select other lens configuration. actualy I get a superview, but I need linear lens. Is it possible?

Dependency curl

Really nice job, works almost out of the box for me (tested with GoPro 9 Black).
Obviously curl is a dependency. That's why it failed for me after the first try ๐Ÿ‘

Does not work at all with a Hero 9 Black

After trying 17 other projects, I was hopeful that this one would work. Unfortunately, it goes on the heap with the other 17.

When I plug in my Hero9, it creates a device, usb0, and passing this in as ./gopro webcam -p usb, fails to discover the GoPro IP (because it actually doesn't have an IP, since it's not broadcasting as a network device, it's connected over USB), so that fails with the unhelpful message of:

Discovered: usb0.
Using usb0 to discover the GOPRO_IP.
Could not automatically discover a valid GOPRO_IP.

Since you can't use USB and network at the same time, these options would seem to be in conflict with each other.

How does one stream video from this device, plugged in via USB, when it's not on the network?

Likewise, since the device itself can't connect TO a wireless network, it can only be an AP, how does one get this thing visible as a device that can connect to OBS?

Any chance this could work on a HERO7?

I got the HERO7 today and would love to use it as a webcam without buying extra hardware (hdmi cable, hdmi capture card). I know GoPro only supports this for 8 & 9, but is that a firmware limitation on the GoPro or a software limitation on mac/windows? I.e. any chance this would work with a hero7 on linux?

hero 7 black instruction

I have a hero 7 black and had an issue while firing up this cmd sudo gopro webcam it says v4l2loopback could not be unloaded. There is maybe an ffmpeg(or similar) running that uses this module.

I indeed installed this v4l2loopback and used for droidcam to use my android device as a webcam but I also want to use my gopro as a webcam too.

Thanks.

v4l2loopback does not exist

But I the latest version of it installed.

Running Manjaro KDE.

Would also be cool to have a quick way of uninstalling the script..

Connection fails when using the GoPro Media Mod

Model: GoPro Hero 10 Black

This is the log when i do sudo gopro webcam

Running GoPro Webcam Util for Linux [0.0.3]
.....
Discovered: wlp1s0.
Using wlp1s0 to discover the GOPRO_IP.
Found 192.168.100.8
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.100.51
Error while starting the Webcam mode. # TODO Useful message.

And this is without the GoPro Media Mod

Discovered: enxd474f7536ad1.
Using enxd474f7536ad1 to discover the GOPRO_IP.
Found 172.22.133.52
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 172.22.133.51
{ "status": 2, "error": 0 }
{ "status": 2, "error": 0 }
Sucessfully started the GoPro Webcam mode. (The icon on the Camera should have changed)


You should be ready to use your GoPro on your prefered videostreaming tool. Have Fun!


If you want to use the GoPro in your prefered Video conferencing software (browser and apps works alike) pipe the UDP stream to a video device (that was created already
) with this command: 

ffmpeg -nostdin -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

To get a preview of the output in vlc you can run this command
To test this try this command(vlc needs to be installed): 

vlc -vvv --network-caching=300 --sout-x264-preset=ultrafast --sout-x264-tune=zerolatency --sout-x264-vbv-bufsize 0 --sout-transcode-threads 4 --no-audio udp://@:8554

I think it couldn't be an issue at all, but i'm just learning how to use this API. any support is very appreciated!

Camara appears as in webcam but vlc and google meet dont see it?

favio@favio-IdeaPad-3-14IIL05:~$ sudo gopro webcam
[sudo] password for favio:
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: enx5ee6e706d905.
Using enx5ee6e706d905 to discover the GOPRO_IP.
Found 172.22.149.53
To control the GoPro, we need to contact another interface (GOPRO_IP ending with .51).. Adapting internally..
Now using this GOPRO_IP internally: 172.22.149.51
{ "status": 2, "error": 0 }
{ "status": 1, "error": 0 }
Sucessfully started the GoPro Webcam mode. (The icon on the Camera should have changed)

You should be ready to use your GoPro on your prefered videostreaming tool. Have Fun!

If you want to use the GoPro in your prefered Video conferencing software (browser and apps works alike) pipe the UDP stream to a video device (that was created already) with this command:

ffmpeg -nostdin -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

To get a preview of the output in vlc you can run this command
To test this try this command(vlc needs to be installed):

vlc -vvv --network-caching=300 --sout-x264-preset=ultrafast --sout-x264-tune=zerolatency --sout-x264-vbv-bufsize 0 --sout-transcode-threads 4 --no-audio udp://@:8554

when i put the vlc command it never loads, and when i put the ffmpeg command it never shows up on google meet..
Screenshot_2022-06-16_10-57-49
.
i have a gopro hero 8 with firmware updated and i dont know what im doing wrong...

Fails to work with firewall on

[Tested with Hero9]
I try this and run the ffmepg command. The camera was in webcam mode but it was not detected by any software.
I disabled my firewall and the it worked perfectly.

I suspect it could be the 0.0.0.0 ip address setting.

ISO Control

Everything seems to work great except for the ISO which is auto controlled. The metering is terrible and I either end up with blown out highlights or tons of noise. Is there any way to fix the ISO value for those of us that have proper lighting?

Resolution is not passed to ffmpeg

HERO 8 BLACK

The resolution selected in the command line when launching gopro is not passed on to ffmpeg.
When the gopro is set to 720p with for example 'gopro webcam -a -n -r 720', applications still receive a 1080p stream.

EDIT: It may be that the -r 720 flag is not working for me.

not working with EndeavourOS + Hero10Black

hey, the default setting isn't working.
I installed the latest firmware update, still not find the USB settings in my Gopro...
when I connect it to the computer, the USB state in my gopro is active, and i see new ethernet wired connection on my computer.
I'm using EndeavourOS + hero10black

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: enp0s20f0u1u4.
Using enp0s20f0u1u4 to discover the GOPRO_IP.
Could not automatically discover a valid GOPRO_IP. Use the '-p, -d or -i' option to provide more information. (see --help for more information)

what i need to do next? how do i find my gopro IP?

Conversion failed after ffmpeg call

When I run the command: ffmpeg -nostdin -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 get the error output:

ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-cuda --enable-cuda-sdk --enable-cuvid --enable-libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libnpp --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[h264 @ 0x5558233ad100] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x5558233ad100] decode_slice_header error
[h264 @ 0x5558233ad100] no frame!
[h264 @ 0x5558233ad100] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x5558233ad100] decode_slice_header error
[h264 @ 0x5558233ad100] no frame!
[h264 @ 0x5558233ad100] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x5558233ad100] decode_slice_header error
[h264 @ 0x5558233ad100] no frame!
[mpegts @ 0x555823386a40] 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
[mpegts @ 0x555823386a40] Could not find codec parameters for stream 3 (Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'udp://@0.0.0.0:8554?overrun_nonfatal=1&fifo_size=50000000':
  Duration: N/A, start: 159.360000, bitrate: N/A
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 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, 196 kb/s
    Stream #0:2[0x200]: Unknown: none ([128][0][0][0] / 0x0080)
    Stream #0:3[0x201]: Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, fltp
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
[swscaler @ 0x555823451a80] deprecated pixel format used, make sure you did set range correctly
[video4linux2,v4l2 @ 0x5558233d9740] Unable to open V4L2 device '/dev/video42'
Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
Error initializing output stream 0:0 -- 
Conversion failed!

I can start the preview in vlc without any issues. Is there something that needs to be changed?

Unable to connect to stream via local network

GoPro HERO8 is connected to Ubuntu machine. Able to start connection and view preview on vlc on Ubuntu machine via the following commands:

sudo gopro webcam -n --fov "narrow" --user $USER
vlc -vvv --network-caching=300 --sout-x264-preset=ultrafast --sout-x264-tune=zerolatency --sout-x264-vbv-bufsize 0 --sout-transcode-threads 4 --no-audio udp://@:8554

I opened up port 8554 to any machine for udp traffic

sudo ufw allow from any to any port 8554 proto udp
> Rules updated
> Rules updated (v6

From here I would like to view the stream on other machines in the local network. I've tried opening a network stream in VLC on a different computer (windows) with the following URL: udp://xxx.x.x.xxx:8554 with the local IP of the Ubuntu machine. VLC doesn't show any errors, and the playback bar has a bouncing orange "loading" animation. The stream never starts.

I don't know much about the tech stacks here so any insight as to what I've got set up incorrectly, or if this script even supports this use case would be greatly appreciated.

Advice for OBS

Hey there, firstly thanks for making this little script; it's awesome :-) I've gotten it working fine on my black 9, and it beats the hell out of my webcam.

But I'm just wondering if anyone could give me some advice on which source, and what settings to use in OBS to use the UDP stream via the command that's provided when I run the script? I'm guessing that'd be more efficient than just getting OBS to capture the VLC window preview directly, which is what I've been doing so far, especially whilst I'm streaming some more resource intensive stuff at the same time.

GoPro Hero 10 - got video but not sound - Resolved

I am able to get it working on Linux Mint 20.3 Cinnamon. Minor change to /etc/udev/rules.d/60-gopro.rules

SUBSYSTEM=="net", ATTRS{idVendor}=="2672", ATTRS{product}=="HERO10 Black", ACTION=="add", RUN+="/usr/bin/systemctl start gopro_webcam"
SUBSYSTEM=="net", ATTRS{idVendor}=="2672", ATTRS{product}=="HERO10 Black", ACTION=="remove", RUN+="/usr/bin/systemctl stop gopro_webcam"

Question:
How do I get a sound from gopro?

Never mind, I just find out that the mic is disabled in webcam mode on gopro 10. Thanks for good work.

Using this asseet with VideoCapture in OpenCV

Hello, I really appreciate your great work about this repository.

Now, I'm trying to use this assets with VideoCapture in C++ OpenCV like below.
But, neither of them doesn't work.
Could you give me some advice?

    cv::VideoCapture cap("udp://@0.0.0.0:8554");  
    // or below
    // cv::VideoCapture cap("udp://@:8554");
    if (!cap.isOpened()) {
        std::cout << "camera error." << std::endl;
        return -1;
    }

On the other hand, I could confirm that the below command work well after I entered 'sudo gopro webcam' and see video stream.

# command for ffmepg
ffmpeg -nostdin -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

# command for VLC
vlc -vvv --network-caching=300 --sout-x264-preset=ultrafast --sout-x264-tune=zerolatency --sout-x264-vbv-bufsize 0 --sout-transcode-threads 4 --no-audio udp://@:8554

Thank you.

Poor Image Quality + No support for Video Apps

Hey guys, first of all thank you for making this possible on Linux (testing on Ubuntu Budgie).

Here's what I've experienced:

  • Preview quality is really bad when compared to the quality on the official GoPro Webcam App (being it for W10 or macOS).
  • Zoom, Microsoft Teams and Google Meet failed to detect that there was even an available camera.

Detailed version:
1st: Installed the app using the installation script
2nd: Installed the dependencies
3rd: Tested the preview using VLC

  • Image was grainy and to dark! I then reconnected the app to W10 and in the same light conditions the image was great.

4th: Thinking the quality should be nice on a real app I tested it on Zoom, Microsoft Teams and Google Meet.

  • All 3 platforms failed to detect the camera, because of this no more tests were made.

Conclusion:
While the camera does work on my linux distro, it does not function for the suite of apps I use.
Maybe I did something wrong or didn't configured something, but following this repo instructions lead me to this stage.
Hope you can provide some info about this.

Thank you once more!

No issue, just thanks

No issue, just a big thanks for doing what GoPro should've done from the start. Freakin' amazing job, works flawlessly on Pop OS 21.04. Thank you.

"Narrow" FoV sending wrong value to GoPro

I was trying to use this script with my GoPro Hero 12 Black in "narrow" field of view mode, but couldn't get it to work. After digging around, I found out that the integer that should be passed in the HTTPS request for narrow is 2, but the value being passed in the script is 6.
The script is as follows:
elif [[ ${GOPRO_FOV} == "narrow" ]]; then GOPRO_FOV_ID=6
It should be:
elif [[ ${GOPRO_FOV} == "narrow" ]]; then GOPRO_FOV_ID=2
This part is line 112-113.

P.s.: Making this change on my end does make everything work fine.

Go Pro Max

Hi, I've tried to use the software with my go pro max but I get this error:

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: wlp0s20f3.
Using wlp0s20f3 to discover the GOPRO_IP.
Found 192.168.182.95
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.182.51
Error while starting the Webcam mode. # TODO Useful message.

can i use this project with raspberry pi 4?

Hello,
I would need to be able to use the GoPro connected to the Raspberry Pi 4 as a webcam, but it's a pity that even if the GoPro goes into webcam mode you can't see anything and if I restart with "sudo gopro webcam" every time it resets the GoPro in webcam mode, you know if c is there way to solve?

streaming bitrate

Thank you very much for creating this repository!
I observed that the stream becomes noisy when the camera is moving fast.
Is this because of lower bitrate? Will it improve if I reduce the resolution of streaming? Currently I am using 1080p. Is it possible to increase the streaming bitrate?

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.