Search code examples
androidgopro

Unable to connect with GoPro HERO (2018)camera. I am unable to find code base which is able to connect with camera and record live stream actually


I have a GoPro HERO 2018 camera. I an developing an android application. In my application, I want to share live streaming on my android mobile. I meant to say that, whatever is happening on GoPro camera, I want to display it on my android mobile through my own android application. For that I need APIs through which I can connect and able to do live Currently I am using this link , but unable to do live streaming. Please help me and feel free to ask any query.


Solution

  • Finally, I have solved my problem. For this, I have used an FFMPEG command.

    I have used VLC library (that can display udp stream). With the ffmpeg library, use this command: String[] cmd = {"-f", "mpegts", "-i", "udp://:8554", "-f", "mpegts", "udp://127.0.0.1:8555/gopro?pkt_size=64"}; and with VLC library, display the stream "udp://@:8555/gopro" and then you can see the live stream.

    Steps are-

    1. Connect with GoPro WiFi.

    2. Hit GoPro API http://10.5.5.9/gp/gpControl/execute?p1=gpStream&a1=proto_v2&c1=restart.

    3. Create FFMpeg instance and first call ffmpeg.loadBinary(new LoadBinaryResponseHandler() {...} Leave its overrided methods blank.

    Then call ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {...} In its onProgress methos, hit again GoPro API http://10.5.5.9/gp/gpControl/execute?p1=gpStream&a1=proto_v2&c1=restart

    1. Using VLC library, create your media player and set your VideoView/SurfaceView there.

    2. Now you will be able for live streaming from GoPro HERO 2018.

    Note:- This is not working on higher API level of android (above 20). I have used Volley for calling GoPro API.

    May this will help anyone.