User Tools

Site Tools


Start GoPro Hero live streaming

This example shows how to start live streaming. It also gives pointers how to display the live stream using ffmpeg, ffplay, and other tools. Note: the Camera Controller app has to stay active to keep the stream up (the script editor can be closed).

// Use the currently connected camera:
var connectResult = connectToCamera();
if (connectResult.ok) {
    var cameraName = connectResult.message;
    // Uncomment this line to stop live streaming:
    // Tell the camera to start live streaming
    var result = startLiveVideostream(cameraName);
    if (!result.ok) {
        logMessage("Streaming start error");    
    else {
  * Now the live stream can be viewed using tools like ffmpeg, ffplay, VLC, etc.
  * Here are some example commands:
  * // Forward the camera stream:
  * ffmpeg -f mpegts -i "udp://" -f mpegts -vcodec copy udp://localhost:1000
  * // Play the stream directly with ffplay:
  * ffplay -f mpegts -i "udp://"
  * // Forward the stream to YouTube Live:
  * ffmpeg -f mpegts -i "udp://" -f flv -acodec aac "rtmp://<your YouTube Live key>"
else logMessage("No camera found");
script-gopro-livestreaming.txt · Last modified: 2018/03/30 17:11 by teq