Start a new topic
Solved

slow camera frame rate

Hi,


I'm facing performance issue on certain devices (Huwaei Ascend P7 for instance).

the camera view is very slow, close to unusable.


When I execute the samples the camera view is acceptable, but using the same code in a separate app produces lagging camera view.


(Seen on both javascript 6.0.1 and native 2.0.1 SDKs, the phone android version is 5.1.1)


What could be the problem ? Am I missing some flags ?


Thanks


Hi Laurent,

Could you sent us a video demonstrating this issues and your AR project ( .html, .css, .js files, assets, target images) but in a format that contains as minimum information as possible but that we can still be able to build it and test it?

Thanks
Eva

 

What's the solution to this? Is there a way to change the framerate?

The camera is working fine on mine, but the pois don't seem to keep up with pans very well.

Hello Shane,

In most cases, the camera frames slowness is due to the usage of a high resolution preview (1280 x 720). Using any layer above the camera preview when using this format breaks down the frame rate seriously. The issue here is that the medium end phones are not powerfull enough to handle this. In general I would not expect any performance issues on a Quad-core 1.3 GHz Cortex-A53 device when it comes to the custom camera example.


Our custom camera example uses the Android camera 2 API. This camera API delivers the camera frame in a format that requires some frame data manipulations on the CPU in order to bring it into a format that can be rendered by the Wikitude SDK. This slows down rendering a lot. We will change this in the next major release (which is scheduled for early July). We're planning an API so that the conversion is done in OpenGL ES shaders like the SDK already does when it renders the frame itself. So far you can simply disable camera 2 API usage by removing the if statement in the file 'CustomCameraActivity' line 55 to 64.


Thanks

Eva


 

Ah okay, that makes sense.

I'm having trouble finding the if statement you mentioned. Which file specifically is it in? I'm using the Cordova plugin by the way.

Hello Shane,

Since the post was under the title 'slow camera rate frame', the answer provided above is about camera issues. However, you mentioned that the camera is working fine and you actually have POI issues. Can you please clarify what you mean by saying that 'the pois don't seem to keep up with pans'?

In addition, when testing with GeoLocation samples you need to keep in mind that the results could be greatly influenced by these two factors:
  • Testing inside. This could deteriorate the performance and therefore, it is always advisable to test outside.
  • GPS provider. You need to make sure that the GPS provider you are using is accurate enough and it does not influence the performance.

Thanks

Eva

Basically, when panning, it takes a while for the pois to catch up to their intended position on the screen.
Here's a screen capture:

https://youtu.be/GO6x3oqRdLQ

The video actually shows another problem I often have too, which is the pois randomly dropping (altitude?). I'll add some of the key times below.

  • 0:03 - 0:05  – POI drop - This will randomly happen, and once it does, the positioning of all pois is off. My first though was something to do with altitude, but mine is set to `AR.CONST.UNKNOWN_ALTITUDE` so I'm not sure what this is.
  • 0:39 > – POI lag - As you can see, the pois lag behind the pan of the camera view, and it takes them a while to catch up. Dont worry about the one POI disapering, it's intentional.
I'm inside right now, but the behaviour is the same outside. And the phone I'm testing on is an HTC One, running Android 5.0.2.

I've come to the conclusion that this is only happening on my android device, if that helps at all.

Hello Shane,

May I ask if you have tried with other android devices as well, or does it only occur with the HTC One mobile phone?

Thanks
Eva

 

Unfortunately, this is the only one I have, so no I haven't.

Is there something in the settings / device info we could use to narrow down whether the problem is this specific device?

Hello Shane,

Then could you please share you AR experience (.html, .css, .js files, assets, target images) so we can test internally?

Thanks
Eva

 

I just got your cordova sample running on the android (using the command) with the same results, so I guess if you can use that on an android device without issues, then it must just be my device.

Hi Shane,

I just tested our Cordova POI sample with some Android devices we have here, and was not able to reproduce your issue. Just as a hint, you need to be careful when you define your POIs, since being in close proximity of a POI (smaller distance than the accuracy of the GPS) is something that could influence your performance.

Thanks
Eva
Login or Signup to post a comment