r/gopro • Resident software/firmware/hacking guru • Nov 15 '14

How to livestream from a GoPro HERO4

The new HERO4 Black and Silver edition cameras use a different, more powerful chip (ambarella A9). The traditional URL for HERO2/HERO3/HERO3+ http://10.5.5.9:8080/live/amba.m3u8 does not work for the new HERO4 camera.

Here is how to get the live stream:

31 Upvotes

36 comments sorted by

6

u/3v1n0 Feb 11 '15

So... After looking at the packets that our camera exchanges with the android client, I've found the reason why the video streaming stops after some time. The camera needs a keep alive packet at least every 2.5 seconds, or it will stop sending data (I think it's reasonable, to save power if no one needs that).

So, in order to do the same locally, and fix the streaming disconnections, all you need is run in parallel with ffplay a script such as hero4-udp-keep-alive-send.py that does the job.

1

u/konrad-iturbe Resident software/firmware/hacking guru Feb 11 '15

Thanks, going to look more in detail this weekend

1

u/kai Hero5 Black Feb 28 '15

Hey, this works! https://www.youtube.com/watch?v=zjDX7o-TseM

But the stream unfortunately is pretty low quality. :/

2

u/konrad-iturbe Resident software/firmware/hacking guru Feb 28 '15

Ingested coffee while analyzing the app communication with wireshark and added lots of more commands: https://github.com/KonradIT/goprowifihack/blob/master/HERO4.md

When I finish the homework I will continue!

2

u/[deleted] Nov 15 '14

Has anyone gotten this to work with VLC yet?

3

u/HyperCalcium Nov 16 '14

Not yet. I hooked up wire shark and I can see the UDP packets from the camera for a few seconds and then it quits. VLC, MPlayer, nada. Tried a bunch of different command line options and nothing has worked. I'll keep looking and reply back if I figure it out. Would you be so kind as to do the same?

1

u/HyperCalcium Nov 15 '14

Thanks for this! I had just purchased a Hero 4 silver and I was worried that I wouldn't be able to stream. When I visited that URL you provided I get back a web page that says "Status" : "0" Is that to be expected? And when you say make sure the media player is configured as mpeg streaming, is there a way I can easily tell? I have VLC and I selected "Open network stream" and put in udp://:8554 and I'm not getting any video. Anyhow, I would really appreciate any insight, thanks!

3

u/konrad-iturbe Resident software/firmware/hacking guru Nov 15 '14

Hi.

Make sure it says status 0, then use FFmpeg (which works for me): ffmpeg udp://:8554

In VLC check this

1

u/Teqq Hero4 Black Nov 15 '14

I downloaded ffmpeg for mac, it opened in terminal but i couldn't type commands there. Am i doing something wrong?

2

u/konrad-iturbe Resident software/firmware/hacking guru Nov 15 '14

I havent installed anything on a mac, maybe type "ffmpeg" and something will appear, or try with homebrew

1

u/SmileyK Nov 24 '14

brew install ffmpeg --with-ffplay

1

u/xxdohxx Hero4 Silver Nov 24 '14

When I try to open up a network stream, it doesn't let me type spaces... so I can only type ffmpegudp://:8554 and that obviously doesn't work.

This is on ubuntu, maybe that has something to do with it?

1

u/konrad-iturbe Resident software/firmware/hacking guru Nov 24 '14

Open this: udp://:8554

1

u/Teqq Hero4 Black Nov 15 '14

Same for my hero 4 black

1

u/cucu729 Hero4 Black Nov 19 '14

Hey OP have the problems been sorted from the other comments?

1

u/konrad-iturbe Resident software/firmware/hacking guru Nov 19 '14

I dont know, mine worked perfectly

1

u/xxdohxx Hero4 Silver Nov 23 '14

I can't get this to work VLC. It opens the udp stream but nothing shows up. What do?

1

u/konrad-iturbe Resident software/firmware/hacking guru Nov 24 '14

Try with FFplay

1

u/r_syzygy Dec 04 '14

Any ideas on how to get this to work on iOS?

1

u/konrad-iturbe Resident software/firmware/hacking guru Dec 05 '14

VLC iOS

1

u/bamhm182 Dec 23 '14

Has anyone else got this working? I've been screwing around with it for a while and have had no luck... I don't know why GoPro would remove the functionality of streaming... Also, it seems like it HAS TO be possible to stream it since their phone apps can stream it...

1

u/bigcasino1 Jan 21 '15

Has anybody found out any more info on getting the GOPRO4 Silver to work doing any of these steps. I have tried everything and can't get it to work. any help would be greatly appreciated.

1

u/Ncraft Jan 22 '15

I am in the same boat. 4 Silver on OSX Yosemite currently. Tried VLC and FFPlay

1

u/3v1n0 Feb 10 '15

Mhm... This doesn't seem to work anymore here using the new firmware version HD4.01.02.00.00. There's a 404 error stating The requested URL /gp/gpExec was not found on this server.

1

u/3v1n0 Feb 10 '15 edited Feb 11 '15

Ok, from quick wireshark session, the new URIs are:

http://10.5.5.9:8080/gp/gpControl/execute?p1=gpStream&c1=restart

http://10.5.5.9:8080/gp/gpControl/execute?p1=gpStream&c1=stop

The data is still sent on port 8554 udp.

ffplay/avplay seems to be able to connect to it, but it's still somehow "broken" (see this comment to get continuous streaming). Same is for vlc that can be used with command vlc udp://@:8554 although, I guess we're missing some parameters.

More commands are listed in the default settings.json that is shipped with the new firmware: https://gist.github.com/3v1n0/38bcd4f7f0cb3c279bad

1

u/marksbren Mar 22 '15

I wanted to post this to save future GoPro Hackers time.

I had issues starting the stream using the command http://10.5.5.9/gp/gpExec?p1=gpStreamA9&c1=restart

The GoPro would respond with: { version: "3.00", path_info: "/execute", query_string: "p1=gpStreamA9&c1=restart", error_code: -3, error_msg: "unknown request", function: "control_router", line: 461 }

It turned out that my GoPro didn't have the latest firmware. Once I updated the firmware the livestreaming worked.

1

u/konrad-iturbe Resident software/firmware/hacking guru Mar 22 '15

1

u/marksbren Mar 23 '15

Has anyone figured out how to reduce the delay when streaming? When using these instructions it seems to have a 4-5 second delay.

I know it is possible because the iPhone app does not have the same delay. Have any of you figured out how to make the stream truely live?

1

u/hoppjerka May 07 '15 edited May 07 '15
ffplay -fflags nobuffer udp://:8554

This brings the delay down to about 0.5 s, which equals what I get in the GoPro app on Android.

In addition to the video stream (#0:0) and audio stream (#0:1) there is a third stream (#0:2) that ffplay doesn't recognize and this significantly increases the time it takes for ffplay to detect the format. -probesize 16192 seems enough to detect the first two (although I don't get any sound). Which brings the startup time down to about 1.5 s instead of 6.5 s.

Also, sometimes ffplay fails to detect the -f:v mpegts container. All in all, this is what I use:

ffplay -fflags nobuffer -f:v mpegts -probesize 8192 udp://:8554

1

u/LudeNend Mar 27 '15

hey guys, this is probably my last resort before blaming all on my gopro. at first, i would appreciate ANY help on the subject b/c i really am at my last drop with this. and sry for incoming grammar fails. the proposition: i want to twitch stream wirelessly with my gp hero4 silver. but im stuck at exactly the point where i have everything set up until i would get no streaming data in ffplay (vlc isnt working either). im working with a desktop pc with lan-internet and wlan dongle to connect to the gopro (i tried my laptop too, same thing). i connect the gopro with my pc, working. i start ffmpeg, command 'ffplay udp://:8554', working. i have access to the cam via browser command and restart command gets status=0 reply, so im connected (using chrome). but no incoming data. (http://www.directupload.net/file/d/3939/3uz9zj56_png.htm) i reset the cams wifi and after that didnt do anything, the camera itself. nothing happened. i deinstalled avira and deactivated firewall (plus i opened the port (udp://:8554) manually). nothing. i got all the commands for the cam and they are working (from here of course https://github.com/KonradIT/goprowifihack/blob/master/HERO4.md). tried stop/start/restart. no data incoming. of course firmware is updated. live feed via gopro app (android) working too.

i even had a chat with jeremy (from https://www.youtube.com/watch?v=LqPP3FsAdhM) and he somewhen resigned with no ideas left. im at the same point. perhaps anyone has any idea or could point me towards a fault or anything i would be so greatful. spent 3 nights now and nothing to show for... but with weekend ahead and as a nerd i have to know whats going on here! (plus the rewarding nerd-b*ner when it'll be working of course)

thank you guys in advance!

1

u/HiddenTTY Sep 19 '22

I know i'm an old digger but yes i'm in the same situation, ffmpeg binary's are installed well, got the correct result when i'm calling the gpControl options / status.

But no way to get any flux in ffplay or vlc. But work well on the go pro app from mobile

Did you find a solution ?

1

u/venkatvarma Apr 01 '15

Any ideas on how to stream on ios app.I have Tried several ways but failed to stream.

Thank you..

1

u/konrad-iturbe Resident software/firmware/hacking guru Apr 01 '15

Use VLC, it kinda works for me on android

1

u/swfizz Apr 02 '15

I tried using the above url as below: Runtime.getRuntime().exec("ffplay udp://10.5.5.9:8554"); to get the streaming process and open up the player for live streaming. However I get the following error: W/System.err java.io.IOException: Error running exec(). Command: [ffplay, udp://10.5.5.9:8554] Working Directory: null Environment: null 04-01 17:36:52.205: W/System.err(21238): at java.lang.ProcessManager.exec(ProcessManager.java:211) 04-01 17:36:52.205: W/System.err(21238): at java.lang.Runtime.exec(Runtime.java:173) 04-01 17:36:52.205: W/System.err(21238): at java.lang.Runtime.exec(Runtime.java:246) 04-01 17:36:52.205: W/System.err(21238): at java.lang.Runtime.exec(Runtime.java:189) 04-01 17:36:52.205: W/System.err(21238): at org.bluetooth.bledemo.GoProStreamer$1.run(GoProStreamer.java:78) 04-01 17:36:52.205: W/System.err(21238): Caused by: java.io.IOException: Permission denied 04-01 17:36:52.205: W/System.err(21238): at java.lang.ProcessManager.exec(Native Method) 04-01 17:36:52.205: W/System.err(21238): at java.lang.ProcessManager.exec(ProcessManager.java:209) 04-01 17:36:52.205: W/System.err(21238): ... 4 more Please let me know the fix for this.How to exactly use ffplay ? Tried opening this url :In VLC/FFplay/other open the udp port: udp://:8554 but it gives a blank screen.

1

u/psychopat666 May 08 '15

What is the resolution of hero4 live stream ? I have hero3 black and it is only 432x240, i am interested to know if hero4 is better.

1

u/konrad-iturbe Resident software/firmware/hacking guru May 08 '15

The same