goprowifihack icon indicating copy to clipboard operation
goprowifihack copied to clipboard

Hero 5 Livestreaming

Open SokolovRobert opened this issue 8 years ago • 53 comments

####Problem: Can't livestream with Hero5 to computer. Have followed instructions here along with many other references. I'm not sure if this is due to a firmware update, but on wireshark I'm not seeing any udp traffic whatsoever.

####Details: Would like to wirelessly stream from Hero 5 to computer.

  • GoPro Camera(s): Hero 5 Black
  • Firmware Version: HD5.02.01.55.00
  • Steps to reproduce:
  • Happens every time? [Y/N]: Yes

SokolovRobert avatar Jan 29 '17 04:01 SokolovRobert

Try this python script: http://github.com/konradit/goprostream

It only works on Linux/Mac atm.

KonradIT avatar Jan 29 '17 10:01 KonradIT

On Linux I still get errors with my Hero 5:

python GoProStream.py Traceback (most recent call last): File "GoProStream.py", line 112, in gopro_live() File "GoProStream.py", line 48, in gopro_live response = urllib2.urlopen('http://10.5.5.9/camera/cv').read() File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(*args) File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args) File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 404: Not Found

It's connected properly and I can browse the video content through a browser, but still not achieve any form of stream to the computer.

SokolovRobert avatar Feb 03 '17 02:02 SokolovRobert

@SokolovRobert thanks for the log, fixing now.

KonradIT avatar Feb 03 '17 17:02 KonradIT

@SokolovRobert should be fixed now. Please report back.

KonradIT avatar Feb 03 '17 22:02 KonradIT

Looks like it's working now but, but ffplay isn't starting properly? No errors, but also no preview terminal comes up, and when trying to open ffplay in a new window the ports are already bound.

zappy@ubuntu:~/Downloads/GoProStream-master$ python GoProStream.py HERO4/HERO5/HERO+ camera ('UDP target IP:', '10.5.5.9') ('UDP target port:', 8554) ('message:', 'GPHD:0:0:2:0.000000\n') Recording on camera: False Press ctrl+C to quit this application.

I'm running Ubuntu 16.04 LTS and can check on a Mac later this evening.

SokolovRobert avatar Feb 04 '17 20:02 SokolovRobert

@SokolovRobert set the VERBOSE flag to True in the python script, let's see what's wrong

KonradIT avatar Feb 04 '17 23:02 KonradIT

I tried the script and nothing works. Is there any guide for live streaming to windows? I connected to Hero 5 session's WiFi and i can see it in windows. I tried the Locate Commands and it is working just to ensure it is connected. But Streaming or live not working.

udayakumarka avatar May 03 '17 07:05 udayakumarka

@udayakumarka streaming does not work on Windows

KonradIT avatar May 03 '17 09:05 KonradIT

@KonradIT Thanks for the quick response. I was hoping there should be some workaround atleast. With the same way the Capture App is showing the live previews. Hope it will be available for future versions.

udayakumarka avatar May 03 '17 09:05 udayakumarka

@udayakumarka it works in Linux (arch tested so far)

KonradIT avatar May 03 '17 11:05 KonradIT

@KonradIT Any reason why it doesn't work with Windows?

udayakumarka avatar May 04 '17 05:05 udayakumarka

@udayakumarka https://github.com/KonradIT/GoProStream/issues/3

KonradIT avatar May 04 '17 08:05 KonradIT

Hello, can I get the Live Stream on windows system with gopro sessiocn 5?

TUDarmstadtLLX avatar May 04 '17 14:05 TUDarmstadtLLX

@TUDarmstadtLLX, @udayakumarka FFmpeg does not work on windows for reasons unknown yet, so try the ffmpegless-opencv.py here

So, the way this works is by using the OpenCV python library to display the preview directly from the camera without doing ffmpeg > localhost > opencv (this is very stable but I guess it does not work on windows). To try it, install the gopro-py-api by downloading the repo, opening a terminal in the folder and doing python setup.py install (you may need admin rights) or if you have pip installed (usually in the [python dir]/tools/pip.exe run pip install goprocam. Next is to install OpenCV in your computer, follow this link to download the installer. Then set your HERO5 to WiFi App mode and connect your computer to the wireless network, launch a python instance and type:

from goprocam import GoProCamera, constants
gopro_hero5 = GoProCamera.GoPro()

and wait until it says connected to 10.5.5.9 (the camera should turn on). It should take some time to interface with the camera and turn it on, if after 30 seconds it did not turn on run the gopro_hero5 = GoProCamera.GoPro() a second time. If even after two times it does not work the see this thread and test the scripts there (it should help me to see which WOL config turns the camera on or off). If you're lucky and the camera turns on, then run this in your python terminal:

gopro_hero5.overview()

It should display some data from the HERO5 including mode, battery, etc... Check the clients connected value and note it down.

Then close the python terminal and run the ffmpegless-preview.py file. It should display the preview, might lag or might not.

NB: I don't have a HERO5 camera and I don't have Windows, so I will need logs, screenshots, videos, anything that helps me debug. Gotta study now.

KonradIT avatar May 04 '17 14:05 KonradIT

Hi, thanks for your relay.

is it possible that I just control the gopro session 5 on the window system? Such as start the video or start to capture the images.

I want to use use LabVIEW as the develepment enviroment. In LabVIEW, there are modules for the using of "http".

TUDarmstadtLLX avatar May 04 '17 15:05 TUDarmstadtLLX

Hi @TUDarmstadtLLX you can indeed start and stop recording or take photos.

gopro_hero5.take_photo() takes a picture

gopro_hero5.shoot_video() starts a video

KonradIT avatar May 04 '17 15:05 KonradIT

I've been trying to get the stream to work on Windows, the UDP packets from the GoPro will not be received at all. this is definitely a Windows issue as neither FFmpeg, ODB or OpenCV have gotten to preview the stream

KonradIT avatar May 04 '17 16:05 KonradIT

Hi, what is the command for the taking a picture or video. I have tried the command, which is listet here, but failed to do that.

TUDarmstadtLLX avatar May 05 '17 11:05 TUDarmstadtLLX

@TUDarmstadtLLX did you turn the camera on via the gopro.power_on() command

KonradIT avatar May 05 '17 12:05 KonradIT

I turned it on manually. But I tried the command for "Power off", it works. How can I do that with the command?

TUDarmstadtLLX avatar May 05 '17 12:05 TUDarmstadtLLX

use the GoPro python API, it's based on goprowifihack. You can use the aforementioned command to turn on.

KonradIT avatar May 05 '17 13:05 KonradIT

@TUDarmstadtLLX

KonradIT avatar May 05 '17 13:05 KonradIT

Hi, @KonradIT, thanks for your reply. If I do not use the python API, I can not take pictures and shot videos via the command, is it true? Sorry for the question. I have no experience with neither java nor python.

TUDarmstadtLLX avatar May 05 '17 13:05 TUDarmstadtLLX

@TUDarmstadtLLX you can take pictures and record videos with the command line using the python api. look at the videos in the gopro-py-api README

KonradIT avatar May 05 '17 13:05 KonradIT

@KonradIT , ok, thanks!

TUDarmstadtLLX avatar May 05 '17 13:05 TUDarmstadtLLX

@udayakumarka

VirtualBox might not be able to receive UDP packets, even though I edited the firewall config on Windows.

screenshot from 2017-05-04 18-25-01

(Right terminal: opencv running on arch, while windows inside VM cannot open the stream from opencv or ffmpeg)

KonradIT avatar May 05 '17 20:05 KonradIT

I am using the window system. If I want to get the Live Stream and be able to set up the camera, such as set the FPS, I need to install the linux system on my PC and use the Python API. Is it true?

Sorry for such foolish question

TUDarmstadtLLX avatar May 08 '17 07:05 TUDarmstadtLLX

Hi, I am using a GoPro 5 Session.

TUDarmstadtLLX avatar May 08 '17 08:05 TUDarmstadtLLX

@KonradIT Hi, I just thought , for my research, I do not need to get the live stream. I only need to control this GoPro 5 session wirelessly on my computer, such as set up the camera, take pictures and shot videos.

If there are any http commands with which I can do that, that would be awesome.

TUDarmstadtLLX avatar May 08 '17 08:05 TUDarmstadtLLX

Hi @TUDarmstadtLLX you can use the GoPro Python API to control the camera (take pictures and shoot videos) even set the FPS.

KonradIT avatar May 08 '17 12:05 KonradIT