Giter Club home page Giter Club logo

camerasdk-android's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

camerasdk-android's Issues

ExportUtils.exportImage not working on Android R (API 30)

Hi,

We have just discovered that following code does not export a panoramic JPEG file once a picture has been taken.

.. .. ..
ExportImageParamsBuilder builder = new ExportImageParamsBuilder()
.setExportMode(ExportUtils.ExportMode.PANORAMA)
.setTargetPath(filename);
ExportUtils.exportImage(workWrapper, builder, this);
.. .. ..

This is only happening on Android 11 devices. Could you please guide us on how to fix this.

Best regards

Initalization Problem

I follow all steps which you give in description with dependency version 1.5.3 Now the problem is InstaCameraSDK class does not found

build problem: POM never downloads

I have this in my build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.1.3' apply false
    id 'com.android.library' version '7.1.3' apply false
}

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
        maven {
            url 'http://nexus.arashivision.com:9999/repository/maven-public/'
            allowInsecureProtocol true
            credentials {
                username = 'kevin.lieberman'
                password = 'xxxxx'
            }
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and in my "other" build.gradle in the app folder:

plugins {
    id 'com.android.application'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.lieberland.insta360testing"
        minSdk 29
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    implementation 'com.arashivision.sdk:sdkcamera:1.5.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}

and I get this error:

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
  The project declares repositories, effectively ignoring the repositories you have declared in the settings.
  You can figure out how project repositories are declared by configuring your build to fail on project repositories.
  See https://docs.gradle.org/7.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
   > Could not find com.arashivision.sdk:sdkcamera:1.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/arashivision/sdk/sdkcamera/1.5.0/sdkcamera-1.5.0.pom
       - https://repo.maven.apache.org/maven2/com/arashivision/sdk/sdkcamera/1.5.0/sdkcamera-1.5.0.pom
       - https://jitpack.io/com/arashivision/sdk/sdkcamera/1.5.0/sdkcamera-1.5.0.pom
     Required by:
         project :app

I suspect the pom file for the camera sdk never downloads. I am pretty sure my credentials are correct. Any other way to get the library I need? Or how can I fix this?

How to set the capture resolution? (android sdk)

Its not clear from the docs how to set the resolution when I call InstaCameraManager.getInstance().startNormalCapture(false)

I've got a new X3 camera and I dont want to capture 72MP images right now.

The insta360 app has an option to toggle this - I'm wondering what function I can call to do the same in my app?

image

image

CODEC

can we get information on how to integrate and configure specific video codecs with the insta360 SDK

Setting camera's date-time

Hello! Is there any way to set camera's date time via SDK? I couldn't find anything in InstaCameraManager.
We used to do this via OSC, but it seems that video recordings started with the SDK ignore that setting.

FYI: @EternalSoySauce

Unable to capture HDR images continuously on Insta 360 onex2 using the latest SDK

Unable to capture 360 HDR images with the camera preview off
Here is how I could replicate it
Instead of implementing ICaptureListener like this

public class CaptureActivity extends BaseObserveCameraActivity implements ICaptureStatusListener
and InstaCameraManager.getInstance().setCaptureStatusListener(this);

I tried adding it directly to the camera instance like below

InstaCameraManager.getInstance().setCaptureStatusListener(new ICaptureStatusListener() {
@OverRide
public void onCaptureFinish(String[] filePaths) {
mTvCaptureStatus.setText(R.string.capture_capture_finished);
mTvCaptureTime.setVisibility(View.GONE);
mTvCaptureCount.setVisibility(View.GONE);
if (filePaths != null && filePaths.length > 0) {
mBtnPlayCameraFile.setVisibility(View.VISIBLE);
mBtnPlayCameraFile.setOnClickListener(v -> {
});
mBtnPlayLocalFile.setVisibility(View.VISIBLE);
mBtnPlayLocalFile.setOnClickListener(v -> {
downloadFilesAndPlay(filePaths);
});
} else {
mBtnPlayCameraFile.setVisibility(View.GONE);
mBtnPlayCameraFile.setOnClickListener(null);
mBtnPlayLocalFile.setVisibility(View.GONE);
mBtnPlayLocalFile.setOnClickListener(null);
}
}
});

The camera responds with code 500 and camera busy

Settings documentation

I need to set all settings to default/auto for normal record. What are the settings I need to set in order to accomplish that? So far I have this:

InstaCameraManager i = InstaCameraManager.getInstance();
i.setExposureMode(InstaCameraManager.FUNCTION_MODE_RECORD_NORMAL, InstaCameraManager.EXPOSURE_MODE_AUTO);
i.setGammaModeToCamera(InstaCameraManager.FUNCTION_MODE_RECORD_NORMAL, InstaCameraManager.GAMMA_MODE_VIVID);
i.setShutterMode(InstaCameraManager.FUNCTION_MODE_RECORD_NORMAL, InstaCameraManager.SHUTTER_MODE_SPORT);
i.setWhiteBalance(InstaCameraManager.FUNCTION_MODE_RECORD_NORMAL, InstaCameraManager.WHITE_BALANCE_AUTO);

Also, is it possible to know what resolutions the camera supports?

Raw Video Stream Data

Hello Insta360-Team,

I am using an Insta360 ONE X2 and I wanted to ask what is meant by "raw stream data every frame"? My goal is to stream those frames in real-time using WebRTC to the server. How can I process them? Which color space do these frames have?

@Override
public void onVideoData(VideoData videoData) {
// Callback frequency 500Hz
// videoData.timestamp: The time since the camera was turned on
// videoData.data: Preview raw stream data every frame
// videoData.size: videoData.data.length
}

Insta 360 Android SDK not work in latest targetSdkVersion

Hello ,
I am jainSamy , Integrate Insta 360 SDk on android app
// app configuration
compileSdkVersion 33
targetSdkVersion 33
minSdkVersion 21

// i am use this dependencies
implementation 'com.arashivision.sdk:sdkcamera:1.5.3'
implementation 'com.arashivision.sdk:sdkmedia:1.5.3'

After setUp all this and build the project i got this
Error : Unsupported or unrecognized SSL message
but it work on Api label 28 . Please response team its urgent

Thanks.

Google Play store rejects apps with current SDK

As of November 2022, Google now requires apps to target API level 31 or above.

The Insta360 SDK targets level 28, and as a result, no Android app using the Insta360 SDK can currently be distributed in the Google Play Store. This problem most likely affects all users of the Insta360 SDK.

Devs, can you please rebuild the Insta360 SDK with the updated level target?

Questions

When the SDK is used, does GPS data get sent to the camera like when the insta360 app is used?
Is it possible to export .insv files from camera to the phone?

180° Return Video

I want to apply on my application a send of an rtmp video but in 180°, but I don't see a method that returns a video in 180

GyroInfo[] return zero value.

hello , I am making a timelapse video , when i has stop then time lapse then I get WorkWrapper url on that bases i get GyroInfo[] but it return zero.

Below is my code. Let me know

public void onCaptureFinish(String[] strings) {
Toast.makeText(Sensor.this, "Please Wait", Toast.LENGTH_LONG).show();
WorkWrapper mWorkWrapper = new WorkWrapper(strings[0]);
}

for (GyroInfo gyroInfo : mWorkWrapper.getGyroInfo()) {
}

thanks.

Demo app is not able to open camera on Pixel 3 device

SDK v 1.3.10. Android 11.

After launch demo app is not able to open the camera, even though device is already connected to camera wifi. Works fine on Samsung devices.

Logs:

E/OneCameraSocketIO: SocketException Connect timeout (connectWithTO): Operation now in progress
I/onedriver: open wifi -1
E/com.arashivision.camera.command.OpenWifiCmd: failed init wifi: -1
W/Logger: BaseCamera: onCameraError, error: -1
D/Logger: BaseCamera: changeCameraStatus, newStatus: [ERROR], oldStatus: [OPENING], connectType: [WIFI], errorCode: [-14041]
D/Logger: BaseCamera: destroy
D/Logger: BaseCamera: changeCameraStatus, newStatus: [CLOSING], oldStatus: [ERROR], connectType: [WIFI], errorCode: [0]

Preview pano auto-rotates by itself

Preview played in InstaCapturePlayerView auto-rotates shifting the current view. This is easily reproducible in SDK Demo app.

SDK v1.3.10.

InstaImagePlayerView.play is cause out of memory.

version v1.0.5,camera onex
it consumes 50M memory every time, i can't find a way to release it.

使用InstaImagePlayerView.play 预览照片会引起内存溢出,每次执行大概增加50m内存,请问有什么方法可以解决么.

Get equirectangular Bitmap of imagePreview (like OSC)

Hi! is there an option to get the image preview frame from the camera? I need the bitmap of every frame

thanks you! :)

Edit: after change the sdk version to 1.3.23 I get this interface (on 1.3.3 doesnt exist)

   @Override
    public void onVideoData(VideoData videoData) {
        Bitmap mBitmap = BitmapFactory.decodeByteArray(videoData.data, videoData.offset, videoData.size);
        if (mBitmap != null) {
            //use the bitmap
        }
    }

But BitmapFactory always return null, any idea? videoData.data is not null

Equiretangular format of streaming video

Hi,

I am using the CamerSDK-Android to stream out the 360 videos to our video server and then watch with a web browser viewer.

However, when we stream the H.264 packet to our video server, we found that the decoded video is of "dual fisheye" format, but our viewers only support the "equirectangular" format. Is there a way to configure the Insta 360 R to stream out the "equirectangular" format of the 360 videos?

Many thanks.

No implementation of getLensType Error

Why did get the following error :

No implementation found for int com.arashivision.graphicpath.render.util.OffsetUtil.getLensType(java.lang.String) (tried Java_com_arashivision_graphicpath_render_util_OffsetUtil_getLensType and Java_com_arashivision_graphicpath_render_util_OffsetUtil_getLensType__Ljava_lang_String_2)

while calling InstaCameraManager.getInstance().getSupportedPreviewStreamResolution(InstaCameraManager.PREVIEW_TYPE_LIVE) / InstaCameraManager.getInstance().startPreviewStream() ?

Is there anything i missed in the setup process??

Timelapse 1 frame per 2 sec - need 1 frame per 0,5 sec

Hello! I need your help, it is very important for me to be able to shoot timelapse with an interval of less than the camera provides-1 frame in 2 seconds (you need 2 frames per second) is it possible to add this to the firmware and SDK to form your application, so that you can shoot in this mode? Or it is possible to implement libraries in the SDK that you use in the standard insta360 One R application, which allows you to speed up the video on the camera before exporting, or you could not tell what these libraries are, how it can be used primitively. example: after shooting a video, select "Speed" 8x, select the entire video sequence , and when exporting the video, it is downloaded without part of the frames and weighs much less.

Thx for help!

CAMERA_TYPE_ERROR (14170)

When I try to connect to a One RS camera, connection fails with error code 14170.
I see on the SDK that this points to CAMERA_TYPE_ERROR.
What is the situation ?

Is this model not supported by the SDK ?

Thanks

Insta360 X3 still failing on exporting HDR panoramas

I have this issue since X3 was launch. The result .jpg on some devices is a black image, on other devices the result is a gray image with some glitches on top. It fails also using iOS SDK

Screenshot 2023-02-14 at 11 17 15

If I export the .inps generated to my laptop, I seems to be great the thumbnails, but the result still broken.

Screenshot 2023-02-14 at 11 48 03

Screenshot 2023-02-14 at 11 49 10

Insta360 X2, oneX and RS works great with the same SDK. I think its related to a memory issue on stitching.

I was updated the camera firmware using a custom firmware (onex3_v7.0.21.1_build12) that Insta support sends me, and still failing

Please, we work with Insta360 selling cameras to our customers, and this is causing serious problems

Android SDK gives bad video result

@generalbytes @yunyiyunyi @EternalSoySauce
I try to export video from Insta360 ONE X with MediaSdk for Android, but official app gives me this (and this is what I need) :

Снимок экрана 2020-12-23 в 12 21 49

And I get (with MediaSdk) this:
Снимок экрана 2020-12-23 в 12 21 36

My code is:

val builder = ExportVideoParamsBuilder()
            .setExportMode(ExportUtils.ExportMode.PANORAMA)
            .setTargetPath(exportPath + System.currentTimeMillis() + ".mp4")

val exportId = ExportUtils.exportVideo(wrapper, builder, object : IExportCallback {
             override fun onSuccess() {}
             override fun onFail(p0: Int, p1: String?) {}
             override fun onCancel() {}
        })

HDR record freezes preview

Good day. When using the startHDRRecord feature, the preview freezes. This does not happen for the normal record.

Units of Gyro Data

Hi,
I have Insta 360 one X2 and i am calling gyro data. I want to know what are the units that I get data in. This question is for both gyro and accelerometer data.
Looking forward.

Permissions handled on the latest SDK ?

Hey,
I face the following error while generating HDR images on my INSTA 360 ONE X, with the latest SDK version

implementation 'com.arashivision.sdk:sdkcamera:1.3.11'
implementation 'com.arashivision.sdk:sdkmedia:1.3.11'

The same works fine with version 1.3.3


Error stack

W/System.err: at libcore.io.Posix.rename(Native Method)
W/System.err: at libcore.io.BlockGuardOs.rename(BlockGuardOs.java:260)
W/System.err: at java.io.File.renameTo(File.java:1043)
W/System.err: at com.arashivision.sdkmedia.stitch.StitchUtils.generateHDR(:65)
android.system.ErrnoException: rename failed: EXDEV (Cross-device link)

Please help
@EternalSoySauce

Renamed OpenCV libraries in SDK

SDK v1.3.10 dependency nativelibs artifact contains renamed OpenCV which bloats the package for apps that already using OpenCV. Is it possible to provide SDK package with dependency to standard latest OpenCV names, so that the same libraries get reused?

onCameraBatteryUpdate not call on RS 1 inch

The function onCameraBatteryUpdate is only called when the camera is connected, and it is not updated periodically. It needs to call fetchCameraBatteryState to get updated. The One X2 model is functioning correctly.

Switching 150/360 mode

It seems the camera has two mode - 360 degree / 150 degree on One X2. Is there a way to query the status of the setting and also control this when starting capture using SDK? Thanks!

I want the URL of the Maven repository to be HTTPS

I would like the following URL to be HTTPS.
http://nexus.arashivision.com:9999/repository/maven-public/

Otherwise, the following error will occur.

> Could not resolve all dependencies for configuration ':classpath'.
   > Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://nexus.arashivision.com:9999/repository/maven-public/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 

I have set allowInsecureProtocol to true to avoid this, but it is not safe.

build.gradle file in the project root directory

allprojects {
    repositories {
        ...
        maven {
            url 'http://nexus.arashivision.com:9999/repository/maven-public/'
+           allowInsecureProtocol true
            credentials {
                // see sdk demo
                username = '***'
                password = '***'
            }
        }
    }
}

Verifier rejected class com.arashivision.insta360.basemedia.util.FileUtils

Hi,

It seems that the FileUtils class used by WorkerUtils.getAllCameraWorks function to get filenames is not compatble with Kotlin. A runtime exception is thrown by java.lang.VerifyError. Do you think the support could be improved in the next version ?

Regards,

23:12:53.574  E  FATAL EXCEPTION: AsyncTask #1
                 Process: com.###.development, PID: 23973
                 java.lang.RuntimeException: An error occurred while executing doInBackground()
                 	at android.os.AsyncTask$4.done(AsyncTask.java:415)
                 	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
                 	at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
                 	at java.util.concurrent.FutureTask.run(FutureTask.java:269)
                 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
                 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                 	at java.lang.Thread.run(Thread.java:1012)
                 Caused by: java.lang.VerifyError: Verifier rejected class com.arashivision.insta360.basemedia.util.FileUtils: void com.arashivision.insta360.basemedia.util.FileUtils.IL1Iii(java.io.File, java.io.File, boolean) failed to verify: void com.arashivision.insta360.basemedia.util.FileUtils.IL1Iii(java.io.File, java.io.File, boolean): [0x4C] register v1 has type Precise Reference: java.io.FileOutputStream but expected Reference: java.io.FileInputStream
                  void com.arashivision.insta360.basemedia.util.FileUtils.copy(java.io.File, java.io.File, boolean) failed to verify: void com.arashivision.insta360.basemedia.util.FileUtils.copy(java.io.File, java.io.File, boolean): [0x5C] register v1 has type Precise Reference: java.io.FileOutputStream but expected Reference: java.io.FileInputStream (declaration of 'com.arashivision.insta360.basemedia.util.FileUtils' appears in /data/app/~~YLWe7EszDv4PZAuzWusZMw==/com.###.development-2w103zkgQBrc65wC4xpcaA==/base.apk)
                 	at com.arashivision.insta360.basemedia.util.FileUtils.getFileUrlName(Unknown Source:0)
                 	at com.arashivision.insta360.basemedia.util.MediaUtils.IL1Iii(Unknown Source:6)
                 	at com.arashivision.insta360.basemedia.util.MediaUtils.searchCameraMediaModels(:12)
                 	at com.arashivision.insta360.basemedia.util.MediaUtils.searchCameraWorks(Unknown Source:0)
                 	at com.arashivision.sdkmedia.work.WorkUtils.getAllCameraWorks(:2)
                 	at com.###.camera.FooTask.doInBackground(Insta360CameraFragment.kt:391)
                 	at com.###.camera.FooTask.doInBackground(Insta360CameraFragment.kt:386)
                 	at android.os.AsyncTask$3.call(AsyncTask.java:394)
                 	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                 	... 4 more

Cant go live on android sdk demo app

I'm trying to go live on the sdk demo app, but the live button is turned off
I connected the camera with wifi, resolution is 1920x1080, fps 50, bitrate 5mbps, and I've binded it through mobile data

Error during preview

Hey,
I face the following error while previewing using the insta 360 onex2

java.lang.NullPointerException: Attempt to invoke interface method 'void com.arashivision.onestream.pipeline.ICameraPreviewPipeline.onGyroStream(byte[], long)' on a null object reference\n\tat com.arashivision.camera.stream.StreamProcess.processGyro(StreamProcess.java:595)\n\tat com.arashivision.camera.stream.StreamProcess.precoss(StreamProcess.java:255)\n\tat com.arashivision.camera.stream.StreamProcess.access$100(StreamProcess.java:42)\n\tat com.arashivision.camera.stream.StreamProcess$4.run(StreamProcess.java:230)\n\tat android.os.Handler.handleCallback(Handler.java:938)\n\tat android.os.Handler.dispatchMessage(Handler.java:99)\n\tat android.os.Looper.loopOnce(Looper.java:201)\n\tat android.os.Looper.loop(Looper.java:288)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\n"

What might be the issue ?

FYI: @EternalSoySauce

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.