Git Product home page Git Product logo

Comments (6)

philip-lamb avatar philip-lamb commented on June 14, 2024 1

Ah, so if the camera interface is via java methods, you'll need to manually feed the frames to the native side. The new videoExternal module supports this. I can help some more from mid-next week.

from artoolkitx.

philip-lamb avatar philip-lamb commented on June 14, 2024

Hi, if I understand correctly, this is an external camera supported by other Android camera apps? If so, it might be as simple as requesting the external camera in the configuration. I've listed the options here: https://github.com/artoolkitx/artoolkitx/wiki/artoolkitX-video-module-configuration-reference#ar_video_module_android. If the camera correctly registers itself as external, you might be able to connect to it by using video config string of -module=Android -native -position=external. See https://github.com/artoolkitx/artoolkitx/wiki/artoolkitX-video-module-configuration-reference#changing-video-configuration for details on how to change the video configuration in your app.

from artoolkitx.

MrApple100 avatar MrApple100 commented on June 14, 2024

Hi, the device was not recognized as an external camera (((. It only have function
override fun onCaptureData(timestamp: Long, bytes: ByteArray)
where I can get a frame and send it to artoolkitx

from artoolkitx.

MrApple100 avatar MrApple100 commented on June 14, 2024

Hi, i'm back. May you describe a way to use external camera?

from artoolkitx.

MrApple100 avatar MrApple100 commented on June 14, 2024

@philip-lamb

from artoolkitx.

philip-lamb avatar philip-lamb commented on June 14, 2024

I don't see anything in the Moverio SDK docs on the format of the buffers returned, but I guess a reasonable guess would be that they're NV21 format.

Since you will need to pass the video frames to artoolkitX externally, you will need to make a couple of changes in ARController.java's start() method.

At https://github.com/artoolkitx/artoolkitx/blob/master/Source/ARXJ/ARXJProj/arxj/src/main/java/org/artoolkitx/arx/arxj/ARController.java#L141, change it to arwStartRunning("-module=External", cameraParaPath), and then add an extra line: ARX_jni.arwVideoPushInit(0, width, height, "NV21", 0, 0);

You'll need to use the CaptureDataCallback2 type:

mCaptureDataCallback = new CaptureDataCallback2() {
							@Override
							public void onCaptureData(long timestamp, byte[] data) {
							    ARX_jni.arwVideoPush(0,
							        data, data.limit(), 0, 0, // OK to provide 0 for strides when using NV21.
							        null, 0, 0, 0,
								null, 0, 0, 0,
							        null, 0, 0, 0);
						        }
						    };

Also, you must call ARX_jni.arwVideoPushFinal() before calling arwVideoStop

from artoolkitx.

Related Issues (20)

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.