Recording Search

Authentication

HTTP Basic / Digest authentication is required. The user must have permission to view cameras.

Search URL

The search for recordings uses the following URL:

GET /setting.cgi?object=recording&action=search

Cameras

The channels parameter is a list of camera channels. If not specified, it means all cameras. Channel numbers start at 0 and can be specified using quotes (,) and dashes.

For example, to specify channels 0, 1, 2, 3, 5, 9, 10, 11, and 12, you would specify the following:

GET /setting.cgi?object=recording&action=search&channels=0-3,5,9-12

Recording Dates

To get a list of dates with recordings, you can specify a list of cameras and add target=summary. For example, the following request

GET /setting.cgi?object=recording&action=search&format=text&target=summary&channels=0,2

Get the recording date for channels 0 and 2 in the following format.

CHANNELS: 0,2
DATES: 2015-10-05,2015-10-06,2015-10-07

The recording dates will be included if any of the specified camera list is present.

Recording Files

To get a list of recordings for a specific day, specify a list of cameras, add target=day to the and specify the date in the form date=YYYY-MM-DD.

For example, the following request:

GET /setting.cgi?object=recording&action=search&format=text&target=day&date=2015-10-05&channels=0,2

This returns the following response:

DATE: 2015-10-05
CHANNELS: 0,2
TIMELINE: 00;87-86399
TIMELINE: 02;87-86399
FILE: 00;/data/disk1/dvr/2015-10-05/00/00-20151005-000127-20151005-001127.avi
FILE: 00;/data/disk1/dvr/2015-10-05/00/00-20151005-001127-20151005-002127.avi
FILE: 00;/data/disk1/dvr/2015-10-05/00/00-20151005-002127-20151005-003127.avi
FILE: 00;/data/disk1/dvr/2015-10-05/00/00-20151005-003127-20151005-004127.avi
FILE: 02;/data/disk1/dvr/2015-10-05/02/02-20151005-000127-20151005-001127.avi
FILE: 02;/data/disk1/dvr/2015-10-05/02/02-20151005-001127-20151005-002127.avi
FILE: 02;/data/disk1/dvr/2015-10-05/02/02-20151005-002127-20151005-003127.avi
FILE: 02;/data/disk1/dvr/2015-10-05/02/02-20151005-003127-20151005-004127.avi
FILE: 02;/data/disk1/dvr/2015-10-05/02/02-20151005-004127-20151005-005127.avi

The 00;, 02; part immediately following TIMELINE:, FILE: means the camera channel number.

The part after TIMELINE: is the recording range for the specified date, expressed in seconds, for that camera. 0:0:0:0 is 0, and 23:59:59:59 is 86399. If the recording range is empty in the middle, it is shown separated by quotation marks, such as 0-12,15-30.

The part after FILE: is the actual recording file name. The list is sorted in chronological order.

To play the recording, you need to use the Video Playback API.

JSON Format

Specifying the format=json parameter instead of format=text returns results in JSON format instead of text format.

Refresh Recording Index

By default, the NVR creates a 10-minute recording file, and the currently recording file will not appear in the search list. If necessary, you can send a request to refresh the recording and search again a second or two later.

GET /setting.cgi?object=recording&action=refresh&channels=0,2

However, sending recording renewal requests too frequently can cause recording file lengths to become too short and generate a lot of files, which can hurt overall performance and stability.