Performance issue on mobile app developed using mobile SDK

Hi, our partner has developed mobile app (android and ios) to get video stream via mobile server, they are requesting direct streaming, however the steaming is still a bit lagging, as shown in attached video. they have tested xprotect mobile app, and there is no such problem. i have attached source codes for both andrio and ios, can please help to take a look and advise how they can improve the performance. thanks.

Hi,

The source code you provided for Android and iOS seems fine, however it is using transcoded video since adding the direct streaming type in the video properties this way will have no effect.

In addition to the transcoded video you could implement direct streaming for performance. Please refer to the direct streaming sample currently available for Android - https://github.com/milestonesys/mipsdk-mobile-android/tree/main/DirectStreamingSample

Best regards,

Stanislav Zhuklev

hi Stanislav, thanks for the reply. we will try the sample. is iOS directing steaming methods/parameter the same? it is quite confusing, we followed the description in the ios lib, which stated that steamtype = fmpeg is for directing streaming.

Hi Xinshuang,

The description in the iOS lib is correct, the value for direct streaming type parameter is “FragmentedMP4”, but in the provided source code it is overridden in startVideo method in XPSDKVideoFactory class that is called from the requestVideo method in XPSDKLiveVideo since only transcoded video is supported in the available samples.

You will need to call requestStream method in XPMobileSDK with the desired streaming type.

Best Regards,

Stanislav Zhuklev

Thanks for the explanation Stanislav!

Hi Stanislav,

We have changed it as you suggest, but the video play still very choppy.

I have attached source codes for both android and ios, can please help to take a look and advise how we can improve the performance. thanks.

Hi Vic,

If you have tried directly using the live video samples for Android and iOS and there is no such problem in them, then debugging while the issue is being reproduced would be better for finding the cause.

Android samples - https://github.com/milestonesys/mipsdk-mobile-android

iOS samples - https://github.com/milestonesys/mipsdk-mobile-ios

Best regards,

Stanislav Zhuklev

Hi Stanislav,

The Source Code by Android is using Milestone official sample to modify our code but the video still choppy。

And our app video time and official sample video time the different in 4 second.

I don’t no how can I fix , in my source code did I lack some important parameter?

Hi Vic,

The parameters for starting the video are ok, they are the same as in the live video samples.

Best regards,

Stanislav Zhuklev

Hi Stanislav,

Thanks for the explanation.

But I have another question ,What causes our app video time and official sample video time the different in 4 second?

Hi Vic,

The time difference between transcoded and direct streaming video can be due to the camera configuration. Please refer to the requirements for direct streaming https://doc.milestonesys.com/latest/en-US/standard_features/sf_mobile/mobs_requirementsfordirectstreaming.htm

Best regards,

Stanislav Zhuklev