Playback video with MobileSDK leads to severe lag

Hello Milestone Community,

I’ve done a tool, with mobileSDK, based on the MultiCameraPlayback sample for one of our customer, to visualize road traffic.

One main issue is that when an operator click on pause, it takes about 2 second for the video to actually pause.

I’ve made a video to show exactly the issue.

Do you have an idea of optimisation I can make to prevent that ?

I saw that in Playback mode with the mobileSDK I have no choice but to go with Transcoded mode, is there any way we can have the “real” video displaying ?

Thanks for your help,

Jeremy

Hi Jeremy,

Firstly, regarding Transcoded: This is currently the only mode in Playback. I don’t see how can this cause the delay you’re describing.

Do you observe the same lag when you connect the MultiCameraPlayback sample to the same server? If not, it must be an issue in your client code. If the problem exists with the sample, we can continue the discussion further.

Br,

Nikolay

Hello Nikolay,

When I take the raw sample from Milestone, we don’t have the issue.

So I made some tests and as soon as we raise the image size (and display size) we have the same issue.

Here are the only modifications I made to reproduce the issue :

file : …\Samples\MultiCameraPlayback\js\sample.js

window.RequestStreamParams = function (cameraId) {

    return {

        CameraId: cameraId,

        **DestWidth: 720,**

        **DestHeight: 480,**

        SignalType: 'Playback',

        MethodType: 'Push',

        **Fps: 50,**

        **ComprLevel: 100,**

        KeyFramesOnly: 'No'

        RequestSize: 'Yes',

        StreamType: 'Transcoded',

        PlaybackControllerId: playbackController.getId()

    };

};

file: …\Samples\lib\css\sample.css

.camera {

width: 720px;

height: 480px;

}

.camera canvas {

width: 720px;

height: 480px;

}

That’s it.

As soon as I change the size (I tried also 1920, 650,…) I have the near 2 secondes latency.

either with my modified sample and with the raw one.

I had to change the size because for the customer, the default is too small, and not acceptable.

Can you advise me on how I could raise the quality + size and not having the latency ?

Regards,

Jeremy

Hi Jeremy,

Even when I do the changes you listed, I don’t see much of a difference streaming 3-4 cameras in the sample, but my cameras only record at 15-30FPS.

I managed to reproduce it when I opened more streams, until CPU utilization reaches 95-100% on the Mobile Server machine. When CPU load is high, playback stops with a 1-2 sec. lag, indeed. Transcoding is a processing-heavy operation and 50FPS is a lot, so this is normal.

I can recommend that you try to run on a more powerful hardware.

Here are the system requirements for our software. Mobile Server machine will mostly benefit from a dedicated GPU or a really powerful CPU with integrated graphics.

Another approach is to optimize for performance, not for video quality, as described here.

Br,

Nikolay

Hi Nikolay,

I’ll check the hardware on the server and update you when I have more news.

I already tried to change the “direct” and “altervative” streaming settings (with both Quality Video or Performance) and I didn’t see any change.

Regards,

Jeremy