Giter Club home page Giter Club logo

camerasdk-cpp's Introduction

CameraSDK-Cpp

CameraSDK-Cpp is a C++ library to control Insta360 cameras.

Supported cameras

Model Link
ONE X http://insta360.com/product/insta360-onex/
ONE R Dual-Lens Edition http://insta360.com/product/insta360-oner_twin-edition
ONE R Wide Edition http://insta360.com/product/insta360-oner_twin-edition
ONE R 1-inch Edition http://insta360.com/product/insta360-oner_1inch-edition
ONE X2 https://www.insta360.com/cn/product/insta360-onex2
ONE RS https://www.insta360.com/cn/product/insta360-oners
ONE X3 https://www.insta360.com/cn/product/insta360-x3
ONE X4 https://www.insta360.com/cn/product/insta360-x4

Supported platforms

Platform Version
Windows Windows 7 or later, only x64 supported
MacOS 10.8.2 or later, only x64 supported
Linux Ubuntu 16.04(x86_64), other distributions need to be tested

Table of contents

Before running the test demo, there are several steps that need to be prepared.

By default, when you connect Insta360 cameras to your computer, the camera will switch to udisk mode automatically, making the camera act as a USB storage device. You need to switch the camera to the correct mode before you can connect and control it.

For ONE X

You need to upgrade to a special version of firmware, download it here

After upgrading, on camera, go to settings, find USB, set it to Android mode.

For ONE R/RS

On the camera, swipe down the screen to the main menu, go to Settings->General, set USB Mode to Android, and set U-Disk Mode to Mobile Mode.

ONE X2

On the camera, swipe down the screen to the main menu, go to Settings->General, and set USB Mode to Android

ONE X3

On the camera, swipe down the screen to the main menu, go to Settings->General, and set USB Mode to Android

On Linux, please make sure your distribution has libusb installed.

You may install via yum or apt-get

sudo apt-get install libusb-dev
sudo apt-get install libudev-dev

or build from source

wget http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2
tar xjf libusb-1.0.9.tar.bz2
cd libusb-1.0.9
./configure 
make
sudo make install

After installing driver, check whether the camera is detected via lsusb command, if any USB device with vender id 0x2e1a is found, congratulations, your driver is successfully installed.

Note: On Linux,demo program must be run by "sudo", for example
sudo ./CameraSDKDemo //for ubuntu

On Windows, please make sure libusbK driver is installed. You could do that by install libusbK directly, or using zadig to help install the libusbK driver.

When both of your camera and computer are prepared, you can connect your camera to your computer via USB type-c.

Discover your camera

You can use class DeviceDiscovery to easily find available cameras.

#include <camera/device_discovery.h>
...
ins_camera::DeviceDiscovery discovery;
auto list = discovery.GetAvailableDevices();
for(int i = 0;i < list.size(); ++i) {
    std::cout << "device:" << list[i].serial_number << std::endl;
}

The DeviceDiscovery class may establish a connection with the detected camera to retrieve some basic information, such as serial number. The connection will be closed right after information retrieved. Remember to call discovery.FreeDeviceDescriptors to free allocated.resources when you no longer use the DeviveDescriptor in the list.

Connect to the camera

The discovery.GetAvailableDevices() method returns a list of DeviceDescriptor, which contains neccessary DeviceConnectionInfo of the camera.

#include <camera/camera.h>
...
ins_camera::Camera cam(list[0].info);
if(!cam.Open()) {
  std::cout << "failed to open camera" << std::endl;
  return -1;
}
... 
cam.Close(); // close the connection after use.

After cam.Open(), the DeviceDescriptor is no longer used.

We try to simplify the SDK to make integration for developers more easily.

// only for x4.  When shooting x4, you need to switch to the corresponding shooting mode first.
bool ret = cam->SetPhotoSubMode(ins_camera::SubPhotoMode::PHOTO_SINGLE);
if (!ret) {
    std::cout << "change submode failed!" << std::endl;
    continue;
}
#include <camera/camera.h>
...


const auto url = cam.TakePhoto();
if (url.Empty()) {
    std::cout << "failed to take picture" << std::endl;
    return -1;
}
std::cout << "Take picture done: " << url.GetSingleOrigin() << std::endl;

Once the camera is opened, an http tunnel is created at http://localhost:9099. You can make an http request to access the images on the camera. The full url might look like this: http://localhost:9099/DCIM/Camera01/IMG_20200312_113006_00_261.jpg

Recording is as simple as taking picture

// only for x4.  When using x4, you need to switch to the corresponding shooting mode first.    
bool ret = cam->SetVideoSubMode(ins_camera::SubVideoMode::VIDEO_NORMAL);
if (!ret) {
    std::cout << "change submode failed!" << std::endl;
    continue;
}
#include <camera/camera.h>
...
if (!cam.SetVideoCaptureParams({ins_camera::VideoResolution::RES_3840_2160p30,
  1024 * 1024 * 60
})) {
  std::cout << "Failed to set recording params." << std::endl;
} else {
  auto success = cam.StartRecording();
  if (success) {
      std::cout << "Success!" << std::endl;
  } else {
      std::cout << "Failed to start recording" << std::endl;
  }
}
#include <camera/camera.h>
...
auto url = cam.StopRecording();
if(url.Empty()) {
    LOG(ERROR) << "stop recording failed";
    continue;
}
auto& origins = url.OriginUrls();
LOG(INFO) << "stop recording success";
for(auto& origin_url: origins) {
    LOG(INFO) << "url:" << origin_url;
}

Same as Picture, you can access the video via http request. The returned MediaUrl instance may contain multiple origin urls as well as low bitrate video urls.

Exposure settings are independent between function modes(like TakePicture and Recording). So you need to specify function mode when you set exposure settings.

#include <camera/camera.h>
...
auto exposure = std::make_shared<ins_camera::ExposureSettings>();
exposure->SetExposureMode(ins_camera::PhotographyOptions_ExposureMode::PhotographyOptions_ExposureOptions_Program_MANUAL);//set to manual exposure mode
exposure->SetIso(400); // set iso to 400
exposure->SetShutterSpeed(1.0/120.0); // set shutter to 1/120 second.
auto success = cam.SetExposureSettings(ins_camera::CameraFunctionMode::FUNCTION_MODE_NORMAL_VIDEO, exposure);
if (success) {
  std::cout << "Success!" << std::endl;
} else {
  std::cout << "Failed to set exposure settings" << std::endl;
}

Capture settings are similar to Exposure Settings

#include <camera/camera.h>
...
auto settings = std::make_shared<ins_camera::CaptureSettings>();
settings->SetValue(ins_camera::CaptureSettings::CaptureSettings_Saturation, 60);// set saturation to 60
settings->SetWhiteBalance(ins_camera::PhotographyOptions_WhiteBalance_WB_AUTO); // set white balance to AUTO mode
settings->SetValue(ins_camera::CaptureSettings::CaptureSettings_Brightness, 30); // set brightness to 30
settings->SetValue(ins_camera::CaptureSettings::CaptureSettings_Sharpness,4); // set sharpness to 4
settings->SetValue(ins_camera::CaptureSettings::CaptureSettings_Contrast,100); // set contrast to 100
auto ret = cam.SetCaptureSettings(ins_camera::CameraFunctionMode::FUNCTION_MODE_NORMAL_IMAGE, settings);
auto success = cam.SetCaptureSettings(ins_camera::CameraFunctionMode::FUNCTION_MODE_NORMAL_VIDEO, settings);
if (success) {
  std::cout << "Success!" << std::endl;
} else {
  std::cout << "Failed to set exposure settings" << std::endl;
}

For more details, please view documentations under /doc directory.

Note: On Windows, use Visual Studio 2015; on Ubuntu, use g++.

For X4 HDR photos, the output results are already integrated in machine.

camerasdk-cpp's People

Contributors

capjason avatar capjason-insta360 avatar le-insta360 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

camerasdk-cpp's Issues

timelapse_video

      // 以RS一英寸为例 4k对应的分辨率是RES_3920_1920P30
      // 6k对应的分辨率是RES_3920_1920P30 4k为例
      ins_camera::RecordParams record_params;
      record_params.resolution = ins_camera::VideoResolution::RES_3920_1920P30;
      if (!cam->SetVideoCaptureParams(
              record_params,
              ins_camera::CameraFunctionMode::FUNCTION_MODE_MOBILE_TIMELAPSE)) {
        std::cerr << "failed to set capture settings." << std::endl;
        break;
      }

      // mode 是你相机所支持的模式
      ins_camera::TimelapseParam param = {
          ins_camera::CameraTimelapseMode::MOBILE_TIMELAPSE_VIDEO, 0, 1000, 5};
      if (!cam->SetTimeLapseOption(param)) {
        std::cerr << "failed to set capture settings." << std::endl;
      } else {
        auto ret = cam->StartTimeLapse(param.mode);
        if (ret) {
          std::cerr << "success!" << std::endl;
        } else {
          std::cerr << "failed to start timelapse" << std::endl;
        }
      }
    }```
    I noticed that whatever i want to set as video reosolution i get the same setting for timeelapse, is it by design or there other setting that needs to be set?

Implementation of methods

Are you planning to publish the implementation of the methods mentioned in this repository? Or maybe you can describe the functions you use to implement methods like Camera :: TakePhoto () or Camera :: StartRecording ()?

What devices work with the SDK?

I haven't been able to get Mac running with the SDK, and I do not own a windows. Does anyone know if the SDK works on a pi or some other device?

visual studio编译错误

运行example的时候报了如下错误:

错误 LNK2019 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall ins_camera::MediaUrl::Empty(void)const " (_imp?Empty@MediaUrl@ins_camera@@QBE_NXZ),函数 _main 中引用了该符号 Project1

ld: library not found for -lCameraSDK, How to run the sample in macos

I got the error below when I download the full sdk from offical website
I execute this command step by step

cmake .
make

full error below:

CMake Warning (dev) at CMakeLists.txt:25:
  Syntax Warning in cmake code at column 30

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:26:
  Syntax Warning in cmake code at column 44

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:27:
  Syntax Warning in cmake code at column 39

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- iokit dir: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/IOKit.framework
-- core foundation lib dir: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/CoreFoundation.framework
-- camera sdk lib dir: CameraSDK_LIB-NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/allen/Works/workspace/insta360sdk/WindowsSDK20220917/CameraSDKWindows/build
Consolidate compiler generated dependencies of target CameraSDKTest
[ 33%] Building CXX object CMakeFiles/CameraSDKTest.dir/cmake-build-debug/CMakeFiles/3.23.2/CompilerIdCXX/CMakeCXXCompilerId.cpp.o
[ 66%] Building CXX object CMakeFiles/CameraSDKTest.dir/main.cc.o
[100%] Linking CXX executable /Users/allen/Works/workspace/insta360sdk/WindowsSDK20220917/CameraSDKWindows/bin/CameraSDKTest
ld: library not found for -lCameraSDK
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/allen/Works/workspace/insta360sdk/WindowsSDK20220917/CameraSDKWindows/bin/CameraSDKTest] Error 1
make[1]: *** [CMakeFiles/CameraSDKTest.dir/all] Error 2
make: *** [all] Error 2

Get images from camera (1 inch)

Hi I'm working on camera sdk to get the fisheye images.
I was able to compile and test the sdk functionalities.
Looking into function onVideoData we have
void OnVideoData(const uint8_t* data, size_t size, int64_t timestamp, uint8_t streamType, int stream_index = 0)
I suppouse the images are encoded on format h264 and are stored on data pointer.
How can I decode this image and display it in live stream mode?

Cross compilation SDK?

Hi Insta360 team! @capjason-insta360
I am working with this CameraSDK-Cpp and an ARM machine. This SDK is only compatible with Intel machines, right? It would be nice if you create a cross compilation SDK for both arm64 and intel platforms. Thanks in advance!

How to use "Camera::SyncLocalTimeToCamera"?

The SyncLocalTimeToCamera function is declared in the Camera class.

...
bool SyncLocalTimeToCamera (uint64_t time)
...

I am trying to perform time synchronization using this function.

I got the value of changing the current PC's time to the epoch time.
And It was executed using this value as a parameter.

But it did not change to the normal date.

How can I use it to synchronize with the current PC date/time?

Insta360 1-inch - Inconsistent streaming video resolution mode

Hi,

I'm building a streaming app on windows - I 'm using the SDK, and I try to get the best resolution from the camera while streaming - I try to use different resolution modes and somehow the results are inconsistent - I receive the H262 stream and start to decode it - I can from this mean retrieve the size of the frame , and the size of the frame doesn't correspond to the streaming resolution defined in the SDK. Even worse some modes - after I adapted my code to the resolution, the encoded data seems to get invalid line width / stripes.

All in all here is my testing with 1-inch camera:

`
//param.video_resolution = ins_camera::VideoResolution::RES_2560_1280P30;
//param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P25; // ==> 6144x1728 => image truncated
//param.video_resolution = ins_camera::VideoResolution::RES_3840_1920P30; // => 3840x1920 => aligned
//param.video_resolution = ins_camera::VideoResolution::RES_2560_1280P30; // ==> 2560x1290 => aligned
//param.video_resolution = ins_camera::VideoResolution::RES_1920_960P30; // ==> 1920x960 ==> aligned
//param.video_resolution = ins_camera::VideoResolution::RES_2560_1280P60; //==> 6080x3040 ==> not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_2048_512P120; // 6080x3040 ===> not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_3328_832P60; // idem
//param.video_resolution = ins_camera::VideoResolution::RES_3072_1536P30; // idem
//param.video_resolution = ins_camera::VideoResolution::RES_2240_1120P30; // idem
//param.video_resolution = ins_camera::VideoResolution::RES_2240_1120P24; // idem
//param.video_resolution = ins_camera::VideoResolution::RES_1440_720P30; // 1440x720 => not aligned
param.video_resolution = ins_camera::VideoResolution::RES_2880_2880P30; // => 3840x1920 => aligned

//param.video_resolution = ins_camera::VideoResolution::RES_1440_2560P60; // idem
//param.video_resolution = ins_camera::VideoResolution::RES_1440_1920P30; // 6080x3040 => not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_1080_1920P30; // 6080x3040 => not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_1440_2560P30; // 6080x3040 => not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_2560_1440P60; // 6080x3040 => not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_2560_1440P30; // 6080x3040 => not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_1920_1440P24; // 2304x1152
//param.video_resolution = ins_camera::VideoResolution::RES_1920_1440P25; // 2304x1152
//param.video_resolution = ins_camera::VideoResolution::RES_2720_2040P24; // 5440x2040
//param.video_resolution = ins_camera::VideoResolution::RES_2720_2040P25; //// 2304x1152
//param.video_resolution = ins_camera::VideoResolution::RES_4000_3000P24; // 2304x1152
//param.video_resolution = ins_camera::VideoResolution::RES_4000_3000P25; // 2304x1152
//param.video_resolution = ins_camera::VideoResolution::RES_1920_1080P24; // 6144x1728

//param.video_resolution = ins_camera::VideoResolution::RES_1920_1080P25; // 6144x1728
//param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P24; // ++> 5440x1530 not aligned
//
//param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P24; // ===> 5440x1530
//param.video_resolution = ins_camera::VideoResolution::RES_2720_2040P30; // ==> 5440x2040 => image not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_2720_2040P25; // ==> 2304x1152
//param.video_resolution = ins_camera::VideoResolution::RES_2720_2040P24; // ==> 5440x2040 => image not aligned
//param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P60; // ===> 1920x960
//param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P50; // ===> crash
//param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P30; // ==> 1440x720
//param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P100; // ==> 2304x1152
`

As well as for the best resolution I had so far param.video_resolution = ins_camera::VideoResolution::RES_2720_1530P25; // ==> 6144x1728 I got an image that is truncated i.e. the fisheye data is not centered in height missing 15% of the upper data.

Could you provide the correct settings for the 1-inch camera ?

Best regards,
Julien

How to get Intrinsic Calibration Matrix

Hi.

I am using Insta360 one X3.
Is there any way to get Intrinsic and distortion matrix for any lens of the camera? If no then any open source algorithm useful for the same?

Thanks.

OneRS - SDK - GetAvailableDevices() not working

Hi,
I'm working with the OneRS.
My computer has Ubuntu 22.04
Firmware version = 2.0.8.4
Settings > USB mode > Android
It is connected to my computer via the original cable.

I'm trying to detect the camera via the SDK. I downloaded it here : https://www.insta360.com/fr/sdk/record linux version.
Unfortunately, it seems the function ins_camera::DeviceDiscovery.GetAvailableDevices() returns nothing.

I call it in a script test_camera.cc

#include <iostream>
#include <camera/device_discovery.h>

int main(int argc, char* argv[]) {
    ins_camera::DeviceDiscovery discovery;
    auto list = discovery.GetAvailableDevices();
    std::cout << "device_count: " << list.size() << std::endl;
    for(int i = 0; i < list.size(); ++i) {
        std::cout << "device:" << list[i].serial_number << std::endl;
    }
    std::cout << "The end." << std::endl;
}

I compile it this way : g++ -I ./include ./example/test_camera.cc -Llib -Wl,-rpath,lib -lCameraSDK -ludev -o test_camera_compiled
I execute it ./test_camera_compiled
The output :

device_count: 0
The end.

How can I make it detect the camera ?

"/lib//libCameraSDK.so: file not recognized: file format not recognized" on Raspberry Pi

I can successfully compile the sdk on a amd ubuntu machine but failed to do so on raspberry pi 4. It seems to me it is due to the cpu architecture but the document says it supports Raspberry pi
The compilation error log is below:

pi@raspberrypi:~/insta/Linux_20210628/CameraSDK $ g++ -v -std=c++11 ./example/main.cc -I./include/ -L./lib/ -lCameraSDK -lpthread -ludev -o ./bin/CameraSDKTest
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 8.3.0-6+rpi1' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)
COLLECT_GCC_OPTIONS='-v' '-std=c++11' '-I' './include/' '-L./lib/' '-o' './bin/CameraSDKTest' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu' '-marm' '-march=armv6+fp'
/usr/lib/gcc/arm-linux-gnueabihf/8/cc1plus -quiet -v -I ./include/ -imultilib . -imultiarch arm-linux-gnueabihf -D_GNU_SOURCE ./example/main.cc -quiet -dumpbase main.cc -mfloat-abi=hard -mfpu=vfp -mtls-dialect=gnu -marm -march=armv6+fp -auxbase main -std=c++11 -version -o /tmp/cc2PBJ3e.s
GNU C++11 (Raspbian 8.3.0-6+rpi1) version 8.3.0 (arm-linux-gnueabihf)
compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.20-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/arm-linux-gnueabihf/c++/8"
ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
ignoring nonexistent directory "/usr/lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
./include/
/usr/include/c++/8
/usr/include/arm-linux-gnueabihf/c++/8
/usr/include/c++/8/backward
/usr/lib/gcc/arm-linux-gnueabihf/8/include
/usr/local/include
/usr/lib/gcc/arm-linux-gnueabihf/8/include-fixed
/usr/include/arm-linux-gnueabihf
/usr/include
End of search list.
GNU C++11 (Raspbian 8.3.0-6+rpi1) version 8.3.0 (arm-linux-gnueabihf)
compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.20-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 7defdc925cf5fede452fc531d54623d1
COLLECT_GCC_OPTIONS='-v' '-std=c++11' '-I' './include/' '-L./lib/' '-o' './bin/CameraSDKTest' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu' '-marm' '-march=armv6+fp'
as -v -I ./include/ -march=armv6 -mfloat-abi=hard -mfpu=vfp -meabi=5 -o /tmp/ccNNj58N.o /tmp/cc2PBJ3e.s
GNU assembler version 2.31.1 (arm-linux-gnueabihf) using BFD version (GNU Binutils for Raspbian) 2.31.1
COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabihf/8/:/usr/lib/gcc/arm-linux-gnueabihf/8/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/8/:/usr/lib/gcc/arm-linux-gnueabihf/
LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/8/:/usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/8/../../../:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-std=c++11' '-I' './include/' '-L./lib/' '-o' './bin/CameraSDKTest' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu' '-marm' '-march=armv6+fp'
/usr/lib/gcc/arm-linux-gnueabihf/8/collect2 -plugin /usr/lib/gcc/arm-linux-gnueabihf/8/liblto_plugin.so -plugin-opt=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper -plugin-opt=-fresolution=/tmp/ccGdmVpu.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X --hash-style=gnu -m armelf_linux_eabi -o ./bin/CameraSDKTest /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crt1.o /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crti.o /usr/lib/gcc/arm-linux-gnueabihf/8/crtbegin.o -L./lib/ -L/usr/lib/gcc/arm-linux-gnueabihf/8 -L/usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/8/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf /tmp/ccNNj58N.o -lCameraSDK -lpthread -ludev -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/arm-linux-gnueabihf/8/crtend.o /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crtn.o
./lib//libCameraSDK.so: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status

not usable at all on any Linux system

First it is great that you provide this example... BUT, it is unusable...

  • there is no demo binary available that would run on any Linux system, even if you don't compile it yourself...
  • there is no Linux SDK that would allow building it at all. One can steal the include headers from the Windows SDK, but the lib is still missing; there is no Linux library available to build the demo, neither for x86_64 nor arm64, regardless of distributor (Ubuntu, Raspbi, etc.)
  • the Readme should include at least some notes on how to combine any of the SDK downloads into the examples, which is also missing
  • there should be a minimal example to build the system with Automake or CMake, to incorporate any libraries or include headers

Overall, you don't need to provide the sources for the libraries, but PLEASE provide a minimal SDK for Linux to just build the example at hand, consisting of a lib for x86_64 and arm64 and the required include headers...

.h264 files vs .insv files

Hi, in the live preview mode, the camera generates .h264 files. Are these the same as the .insv files?

Can I use the stitcher SDK to stitch .h264 files into 260 videos?

How to power on insta 360 one x2 from ubuntu machine

I placed jetson nano connected to insta 360 one x2 in the remote place.

I would like to do this step.

  1. enter jetson nano by ssh
  2. power on one x2
  3. transfer data from one x2 to jetson nano.
    I think x2 should be powered on in order to get data, so I would like to power on one x2.

Is there any way to turn one x2 on by command or program executed on jetson nano or other ubuntu machine?

No device found on Windows after re-compiling

I got the pre-compiled exe to run nicely.
But when recompiling, it always says

[04-19 22:03:21.854] 7116 22816 I http_tunnel_service.cpp:0077: exception occured: accept: Ein Blockierungsvorgang wurde durch einen Aufruf von WSACancelBlockingCall unterbrochen.: Ein Blockierungsvorgang wurde durch einen Aufruf von WSACancelBlockingCall unterbrochen.
no device found

Do I need to set paths somewhere?

preview live streaming

Hello everyone,

I am trying the example of CameraSDK and when I select the index (10) I read "successfully started live stream" but nothing happens. I saw the two files .h264 appearing in the folder but I cannot open them (I tried with VLC). Am I missing something here?

Live streaming from Insta360 One X2

Does this SDK allow live video streaming from Insta360 One X2 to PC? I found a stream start method in the documentation. But I did not understand how to use it in my task.

How to view the live stream?

Was able to connect the camera and run the CameraSDKTest.exe successfully. But how do we preview the live stream when we select option10?

Get started with linux

I dont understand how to run the main in linux terminal. I run the command: g++ main.cc -I ./include/camera but get the error: camera/camera.h: no such file or directory.

Does anybody know how to compile the project in Linux??

我有4台insta 360 x2相机,想实现四台相机同时拍照

我再你们提供的例程上改了改,发现地址被重复使用。
1
2
在第二次循环时,open()函数会抛出terminate called after throwing an instance of 'std::system_error'
what(): bind: Address already in use的错误。
我该怎么做,才能同时对4台相机进行拍照。

no device found error

env : linux(ubuntu 20.04), insta360 x3

I already followed all the prerequisite steps.
output of lsusb:
Bus 001 Device 010: ID 2e1a:xxxx Arashi Vision Insta360 X3

I run the main.cc and got the no device found massage

How can I do to find the device?

cam.DownloadCameraFile crashing my program

Using Insta360 ONERS:

Hi, looking for guidance for this issue.

my file_to_download and file_to_save files are defined as such:

std::string file_to_download = cam.GetHttpBaseUrl() + origin_url.substr(1);
std::string file_to_save = "C:\Users\sbernabei_user\Desktop\DesktopFolder\" + std::filesystem::path(origin_url).filename().u8string();

when I call cam.DownloadCameraFile(file_to_download, file_to_save), my program quits out without showing me the "download fail" error. The camera file names are being saved to the desktopfolder but they have no content (0KB).

Please help.

Error running: WSAEINTR 10004

Hi!
Im trying to run insta360 own sdk for windows on visual studio 17 2022. I have the ONE x2. I have installed Libubsk based on insta’s documentation. However, i get an error when running in vs, see attached image. Does anybody know how to solve this issue? Thanks in advance!
WSAEINTR_10004

OneRS SDK - Download file not working

I'm working with the OneRS.
My computer has Ubuntu 22.04
Firmware version = 2.0.8.4
Settings > USB mode > Android
It is connected to my computer via the original cable.

I am trying to dowload a file from the SD card.

    const auto ret = cam->DownloadCameraFile("/DCIM/Camera01/VID_20230417_135746_10_024.insv", "/home/georges/");
    if (ret) {
        std::cout << "Download succeed!!!" << std::endl;
    } else {
        std::cout << "Download failed!!!" << std::endl;
    }

After a while, I get a 200 HTTP status (looks good) followed by an exception (less good), and I cannot find the file locally.

...
[04-17 17:53:28.382]  40406 40406 I camera_impl.cpp:0345:  Download progress: 99(41938742/41943040)
[04-17 17:53:28.382]  40406 40406 I camera_impl.cpp:0345:  Download progress: 99(41942838/41943040)
[04-17 17:53:28.382]  40406 40406 I camera_impl.cpp:0345:  Download progress: 100(41943040/41943040)
[04-17 17:53:28.382]  40406 40406 I camera_impl.cpp:0349:  HTTP response status: 200
Download succeed!!!
[04-17 17:53:28.382]  40406 40417 E http_tunnel_client.cpp:0124:  exception occurred on socket read some: read_some: End of file

How can I download files from the SD card ?

Awake the camera by function

Hi!
I am working with the camera SDK and wonder if there is any function that could trigger the camera and awake it? I have the Insta ONE x2 camera.
Thanks in advance!

Where is the SDK?

An SDK is usually header files and precompiled library (or source code). I don't see anything here except a main.cc with top-level streaming delegate class. Where do I find these:

#include <camera/camera.h>
#include <camera/photography_settings.h>
#include <camera/device_discovery.h>
???

I do see those (and other classes) represented in the Doxygen documentation, so they must be somewhere.

Insta One RS Camera Integration with Ubuntu: Troubleshooting the cam->Open() Error

Dear Support Team,

I am reaching out to report an issue encountered while attempting to use the Insta360 SDK with an 微信图片_20240307153102 camera on Ubuntu 18.04. The primary function of my code is to initialize the camera and attempt to open it. However, upon reaching the cam->Open() method, the program fails and throws an error, highlighting an attempt to bind to a network address that is already in use, leading to a std::system_error with the message bind: Address already in use.

An important detail to note is that the Insta One RS camera is a panoramic camera featuring two lenses, which cannot be used separately. Despite this, the auto list = discovery.GetAvailableDevices(); command returns a size() of 1, yet the program still reports the "bind: Address already in use" error.

I have considered various troubleshooting steps without success. Therefore, I am seeking assistance from the official support channel and would greatly appreciate any advice or insights into resolving this issue.
微信图片_20240307153102
微信图片_20240307153140

no device found and which mode should I select?

I set the Insta360 One R as the instruction in the readme:

  1. using zadig to help install the libusbK driver.
  2. Set USB Mode to Android
    But, when I run the CameraSDKTest.exe, I get the result: "no device found."
    I want to know whether I select the wrong mode?

Control camera power mode and photo resolution programmatically. Obtain data from gyroscope/accelerometer

On the X3 there is no way to control the:

  • camera power state (the wake on Bluetooth does not work even from the official app);
  • camera resolution from the SDK, neither in picture mode nor in continuous shot mode. These mode will use the resolution settings that you manually set on the camera via its touchscreen but it is not very comfortable for remote/long term running installations;
  • Only the video resolution can be set.
  • There is no way to read data about acceleration or gyroscope as in the Android SDK.

@capjason and @capjason-insta360 : is there any hope of having these methods exposed in the next release?

As a piece of general advice to developers aiming at doing something more than taking pictures with default settings, I would not recommend the C++ implementation because it is very limited. The Android one may offer more options but requires the set-up of an android device and environment.

Stitching the dual fisheye stream

When the camera is in live stream mode, we can get dual fisheye stream in .h264 form. The MediaSDK does provide stitching code, but it only supports .insv. Is there any other way to stitch the dual fisheye stream efficiently (hoping to stitch it in real-time for live streaming)? When I'm doing stitching using FFmpeg, for each 1 second chunk it is taking more than a second to stitch, which is too long for live streaming requirement.

Thanks!

How make the .h files globally availables?

Once I download the SDK, I would like to make them globally available. I mean: Once create a .cpp file, I would like to include the headers an have no troubles with that.

I Tried to put the headers files into /usr/local/include and the .so file into /usr/local/lib

But I keep receive messages that one or more library could not be found.

thankyou

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.