Skip to content

Instantly share code, notes, and snippets.

@laurieainley
Last active May 24, 2024 12:08
Show Gist options
  • Save laurieainley/7663756 to your computer and use it in GitHub Desktop.
Save laurieainley/7663756 to your computer and use it in GitHub Desktop.
Live streaming from a GoPro Hero3 camera to RTMP server using FFmpeg
Basic Requirements:
Computer with wired and wireless connection
FFmpeg installation: http://www.ffmpeg.org/
GoPro Hero 3+: http://gopro.com/
RTMP server e.g. FMS (http://www.adobe.com/products/adobe-media-server-family.html) or CDN ingest point
Overview:
GoPro Hero3 cameras produce HLS streams which are consumed by control apps and their removeable monitor.
It's simple to take this stream and rebroadcast over RTMP by following the instructions below.
Hopefully there are also a lot more interesting use cases for this, but this should provide a starting
point.
Instructions:
1. Turn on WiFi on GoPro.
2. Connect to GoPro from computer over WiFi.
3. Determine IP address of GoPro camera by finding the default gateway for your wireless connection -
this is usually 10.5.5.9 but may differ. Guide for Windows / Mac here:
http://www.noip.com/support/knowledgebase/finding-your-default-gateway/. This can be achieved in a
similar way on Linux using the command ifconfig on the command line.
4. Browse to the IP address of the camera on port 8080 to ensure you can connect to it and it is
capable of streaming video over WiFi. You can do this by putting http://[IP]:8080 in a browser window,
where [IP] is the IP of the GoPro camera identified in step 3. You should see a directory listing if
connected successfully.
5. Once confirmed, in the command below replace [IP] for the IP address as above, and replace [RTMP]
with the URL to the entry point for your FMS server/CDN e.g. rtmp://myserver.com/stream/stream_name.
If authentication is required, apply it as username:password@ after the protocol,
e.g. rtmp://username:password@myserver.com/stream/stream_name.
ffmpeg -re -i http://[IP]:8080/live/amba.m3u8 -c copy -c:a aac -strict experimental -b:a 96k -ac 2
-ar 44100 -f flv "[RTMP] live=1"
6. Execute the command and verify playback.
@oneindelijk
Copy link

@sanat94
Check the following:

  1. are you connected directly to the Hero3's access point ?
  2. did your pc get an ip addres in the range 10.5.5.x ?
    (check this on windows in the terminal by typing 'ipconfig' or on linux 'ip addr' or on mac 'ifconfig')
  3. if you didn't you might have to manually supply an ip address (find howto's on the internet)
  4. if you did, try 'ping 10.5.5.9' or do a full network scan (nmap, netscanner, netdiscover) to find out if the Hero3 might be at a different ip address.
  5. make sure your pc doesn't have the same ip address as the Hero3
  6. make sure the main Cherokee page @ http://10.5.5.9:8080 is working...

@WHYDLM
Copy link

WHYDLM commented Apr 9, 2020

Hello,

I got a bit confused about the RTMP part, can't we just open the video flux in VLC ?
I'm a newbie so please excuse me...

Thanks you

@laurieainley
Copy link
Author

@WHYDLM This gist was written with rebroadcasting the feed as a live stream for distribution to a wider audience in mind - if you want to just monitor the output locally, then I believe you can just connect to it by its IP in VLC e.g. http://10.5.5.9:8080/live/amba.m3u8. Apologies I can't remember precisely, this was written 6 years ago.

@WHYDLM
Copy link

WHYDLM commented Apr 9, 2020

@laurieainley Hey thanks you very much, that's working !
Latency is high but for my use is ok.
Thanks you very much again !

@laurieainley
Copy link
Author

@WHYDLM no problem, happy to hear this is still useful after so long! Are you using this with a GoPro Hero 3?

@StanYago
Copy link

StanYago commented Jul 8, 2020

Worked for me on GoPro Hero 3, thank you! Just using the following command
ffplay -i http://10.5.5.9:8080/live/amba.m3u8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment