Playback bookmark / time range video via .net mobile SDK

I have a bookmark and I want to play it. The bookmark has Start time, End time and Triggered time. I want to play video from this bookmark. I did not find any method like “GetBookmarkStream”. Is there any?

I wanted to implement workaround for not existing “GetBookmarkStream” via this code:

var videoParams = new VideoParams
{
	CameraId = cameraId,
	DestWidth = destinationWidth,
	DestHeight = destinationHeight,
	CompressionLvl = 83,
	FPS = 15,
	RequestSize = true,
	MethodType = StreamParamsHelper.MethodType.Push,
	SignalType = StreamParamsHelper.SignalType.Playback,	
	KeyFramesOnly = false
};
 
var pbParams = new PlaybackParams()
{
	SeekType = PlaybackParamsHelper.SeekType.Time,
	TimeRangeBegin = new DateTime(637884517276151006, DateTimeKind.Utc),
	TimeRangeEnd = new DateTime(637884517576160995, DateTimeKind.Utc).Subtract(TimeSpan.FromSeconds(10)),
	Speed = 1
};
 
response = await connectionWrapper.Connection.Video.RequestStreamAsync(
	videoParams,
	pbParams,
	this.connectionTimeout).ConfigureAwait(false);

Here I use TimeRangeBegin and TimeRangeEnd where I put time from the bookmark. Method RequestStreamAsync ignores those range times. I’ve tried all of seek types and all of them ignores the range values.

When I use Time (without TimeRangeBegin and TimeRangeEnd) then I get the video from the specified time but end time is not applied.

I need the same player like in Smart Client when you search for bookmarks (start time, end time, triggered time marked on the timeline):

My questions are:

  1. how can I get video playback of bookmark?
  2. how can I get video playback of specific time range?

For both I need StreamId to play it via Websocket in Angular client as I do it for live stream via the same code above with StreamParamsHelper.SignalType.Live .

Hi,

You can request time ranged video by the RequestStream command. You need to set the Time to the Playback params as well .

Also please have in mind that Bookmark time that you get form GettBookmark is in Unix format , so before setting it to PlaybackParams you need to convert . You may use TimeConverter class. (TimeConverter.FromString(..) )

/Svetlana

I’ve tried the playback params below and as I said the TimeRange params are ignored. The stream is not stopped automatically. So the time ranged video does not work. What am I doing wrong?

var playbackParams = new PlaybackParams
{
	SeekType = PlaybackParamsHelper.SeekType.Time,
	Time = videoParams.PlaybackStart,
	TimeRangeBegin = videoParams.PlaybackStart,
	TimeRangeEnd = videoParams.PlaybackStart.Add(TimeSpan.FromSeconds(5)),
	Speed = 1
};

Bookmark time from GetBookmark is a standard .net DateTime:

BookmarkService.Instance.BookmarkGet(bookmarkFqid);

Why and how should I convert it?

Which version is your XProtect Mobile Server?

Mobile server:

SDK:

Mobile Server 21.1 does not support time range playback

There is a feature flag send on Login Response that indicates if the server supports Playback in Range

Which version supports time range playback?

Hi,

It was introduced in 21.2

/Svetlana