0

Recently I upgraded my phone from a S2(samsung) to a S4. I have developed an application which does some processing on frames. Without changing anything in the code the fps rate in the S4 has decreased . I really have no answer , since I have only change the minSDk version and TargetSdk version...

Here is the code

public void onPreviewFrame(byte[] data, Camera camera)
{ 
    if (Debug_fps) Log.d("Fps","....");
    // processing 30 ms
    camera.addCallbackBuffer(data);
}

Some relevant Data

AverageTime between frames  S2:    5 - 10 ms
AverageTime between frames  S4:    30- 35 ms

AverageTime processing  S2:    32 ms
AverageTime processing  S4:    30 ms

I really do not understand why the big differences, why does it take so long to receive the frame.

I would really appreciate if some could provide an answer,

Thank you in advance

1 Answers1

1

My first guess would be that the S2 has a camera with a mutch smaller resolution (~8 MP) and the S4 has a camera with ~ 13 MP. More pixels mean more time needed to process them. Another reason might be the differnet framework on the two phones. Maybe the Galaxy S4 saves energy by not drawing more frames than absolutely needed (30ms is about 30 fps), so android limits the frames to 30 per second.

Gumbo
  • 1,716
  • 1
  • 15
  • 22
  • Hi thank you for your response,the processing time is the same in both mobiles. But it is the time between the finalized processing and the call to onpreviewFrame() that varies so much... (10ms(S2) vs 30ms(S4)). – Ignacio Ferrero Sep 01 '14 at 20:25
  • @IgnacioFerrero that's what i said - more pixels -> more time to process. – Gumbo Sep 01 '14 at 20:31
  • so are you suggesting that there is a conversion to provide a byte[] vector? and therefore it takes more time to convert from 13mp to 1440x1080 ? I really do not know how the phone provides the byte[] array from the camera. So should I accept 30 ms between calls, no possible solution? – Ignacio Ferrero Sep 01 '14 at 20:54
  • @IgnacioFerrero I don't know how the phone gets the images from the camera, but I don't think you can do something about it anyway. As long as there isn't a real problem (30 fps is not great, but still a reasonable framerate) it probably isn't worth the effort to improve it. – Gumbo Sep 01 '14 at 20:58