Seek video to a fixed date

I have checked the documentation and i didn’t find any solution to my issue yet.

I have a video DDBB in a mobile Server and I’m trying to get the specified playback video frames of a required period of time (begin and end date) from this video using Mobile Server Protocol. The problem is that the given dates of the video are being ignored in the ‘requestStream’ request.

I ask how I have to configure the ‘requestStream’ request to receive frames from a given date and time. At the moment i’m using this request:

var begindatetime = new Date(‘28 Nov 2017 14:58:10 GMT’);// new Date(‘2017-11-28T14:58:10’);

        var enddatetime = new Date('28 Nov 2017 14:58:20 GMT');//new Date('2017-11-28T14:58:20');

var requestStreamXMLMessage = generateXMLMessage({

           sequenceId: 1,

           connectionId: player.connectionId,

           command: 'RequestStream',

           inputParams: {

              CameraId: player.cameraId,

              DestWidth: targetWidth,

              DestHeight: targetHeight,

              MethodType: 'Pull',

              SignalType: 'Playback',

              Fps: 10,

              ComprLevel: 70,

              TimeRestrictionStart: begindatetime, // StartTime stamp in ms (Unix)

              TimeRestrictionEnd: enddatetime, // StartTime stamp in ms (Unix)

              KeyFramesOnly: 'No'

           }

        });

But the video I’m receiving does not correspond to this dates. I have tried with different configurations of date and time and still the video received does not correspond to the request.

Could you please give me a tip on how to solve it?

Thanks in advanced.

Hi Alejandro,

You are completely right, those values do not work as expected.

Because they do not work at all.

We had partial implementation in older version of the Mobile server, but it was scrapped.

And the reason is in the complexity and difficulties in handling all the cases when video presents in the given time interval, or not (or partially).

I’ll remove the reference to those two parameters from the documentation.

In order to solve your case I could recommend you to initialize only the “Time” parameter, which will position your playback on desired “begindatetime”.

In order this to work “SeekType” should be set also to “Time”, or one of other time derivatives (Time, TimeOrBefore, TimeOrAfter, TimeAfter, TimeBefore).

After that you could start playback and watch for “current time” received in the video channel.

You should be very careful about different situations depending on video persisting.

Another think is that I’m pretty sure that

Time: begindatetime, // StartTime stamp in ms (Unix)

won’t work completely correct.

I would recommend you to use:

Time: begindatetime.getTime(), // StartTime stamp in ms (Unix).