Video
Authentication
To receive video streams from NVR, HTTP Basic / Digest and RTSP Digest authentication is required. The user must have permission to view cameras.
HLS Live
To receive live video stream with HLS protocol, use following HTTP path on NVR:
/live/videoN.m3u8
the N
in videoN.m3u8
is camera number which starts from 1.
You can specify the format
or profile
parameter like:
/live/video1.m3u8?format=FORMAT
the FORMAT
must be the one of mpegts
, fmp4
. (default: mpegts
)
/live/video1.m3u8?profile=PROFILE
the PROFILE
must be the one of high
, normal
, low
. (default: high
)
To use Internet browser with hls.js:
<!doctype html>
<html>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<video id="video" width="320" height="240" autoplay controls type="video/mp4">
Your browser does not support the video tag.
</video>
<script>
var video = document.getElementById('video');
var videoSrc = 'PROTOCOL://ADDRESS:PORT/live/videoN.m3u8?user=USER&password=PASSWORD';
if (Hls.isSupported()) {
var config = {
"lowLatencyMode": MODE
};
var hls = new Hls(config);
hls.loadSource(videoSrc);
hls.attachMedia(video);
}
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = videoSrc;
}
</script>
</html>
the N
in videoN.m3u8
is camera number which starts from 1. the PROTOCOL
is the supported http protocol set in NVR, and it is http
or https
. the ADDRESS
and PORT
are address and http port in NVR. the USER
and PASSWORD
are NVR user accounts. the MODE
is the supported low latency HLS set in NVR, and it is true
or false
.
MP4 Live
To receive live video stream in fragmented MP4 format, use following HTTP path on NVR:
/live/videoN.mp4
the N
in videoN.mp4
is camera number which starts from 1.
You can specify the profile
parameter like:
/live/video1.mp4?profile=PROFILE
the PROFILE
must be the one of high
, normal
, low
. (default: high
)
MJPEG Live
To receive live video stream in Motion JPEG format, use following HTTP path on NVR:
/live/videoN.mjpg
the N
in videoN.mjpg
is camera number which starts from 1.
JPEG Snapshot
To receive live video snapshot, use following HTTP path on NVR:
/live/videoN.jpg
the N
in videoN.jpg
is camera number which starts from 1.
MP4 Download
To download recorded video streams in fragmented MP4 format, use following HTTP path on NVR:
/download/videoN.mp4?start=START&end=END
or
/download/videoN.mp4?start=START&duration=DURATION
the N
in videoN.mp4
is camera number which starts from 1. the START
/ END
are ISO 8601 format like 2018-09-06T15:14:03
. DURATION
is the playback time from the start time. end time regards as start time + duration
minutes. If end
/ duration
parameter is missing, end time regards as start time + 10 minutes. You can also use length
or len
instead of duration
.
To download recorded video streams in normal indexed MP4 format, add index=1
parameter like:
/download/videoN.mp4?start=START&end=END&index=1
Note that the response time may be slow becauses MP4 files must be generated in the recording disk. You can specify index=2
parameter to generate MP4 files in the memory, but it's not recommended in most case.
RTSP Live
To receive live video stream with RTSP protocol, use following RTSP path on NVR:
/videoN
the N
in videoN
is camera number which starts from 1. For example, full URL may be rtsp://demo.emstone.com/video1
.
You can specify the profile
parameter like:
/video1?profile=PROFILE
the PROFILE
must be the one of high
, normal
, low
. (default: high
)
RTSP Playback
To receive playback video stream with RTSP protocol, use following RTSP path on NVR:
/playback/videoN?start=START&end=END&speed=SPEED
The N
in videoN.mp4
is camera number which starts from 1.
The START
/ END
are ISO 8601 format like 2021-01-20T15:14:03
.
The SPEED
is playback speed. 1.0 means 1x speed, 2.0 means 2x speed.
For example, play Camera 1 from 2021-01-20 15:14:00 to 2021-01-20 15:24:00 by 1x speed like:
/playback/videoN?start=2021-01-20T15:14:00&end=2021-01-20T15:24:00&speed=1.0
MJPEG / JPEG (Legacy)
To receive live video stream in MJPEG format, use following HTTP path on NVR:
/mjpeg.cgi?channel=N
the N
in channel=N
is camera number which starts from 0.
To receive live video snapshot image in JPEG format, add snapshot=on
parameter like:
/mjpeg.cgi?channel=0&snapshot=on
HLS Playback
To playback recorded video streams with HLS protocol, use following HTTP path on NVR:
/playback/videoN.m3u8?start=START&end=END
or
/playback/videoN.m3u8?start=START&duration=DURATION
To use Internet browser with hls.js:
<!doctype html>
<html>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<video id="video" width="320" height="240" autoplay controls type="video/mp4">
Your browser does not support the video tag.
</video>
<script>
var video = document.getElementById('video');
var videoSrc = 'PROTOCOL://ADDRESS:PORT/playback/videoN.m3u8?start=START&end=END';
if (Hls.isSupported()) {
var hls = new Hls();
hls.loadSource(videoSrc);
hls.attachMedia(video);
}
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = videoSrc;
}
video.playbackRate = SPEED;
</script>
</html>
the N
in videoN.m3u8
is camera number which starts from 1. the START
/ END
are ISO 8601 format like 2018-09-06T15:14:03
. DURATION
is the playback time from the start time. end time regards as start time + duration
minutes. If end
/ duration
parameter is missing, end time regards as start time + 10 minutes. You can also use length
or len
instead of duration
.
You can specify the format
parameter like:
/playback/videoN.m3u8?format=FORMAT
the FORMAT
must be the one of mpegts
, fmp4
. (default: mpegts
)
the SPEED
indicates the current playback speed of the video. (HTML DOM Video playbackRate Property)
MP4 Playback
To playback recorded video streams in fragmented MP4 format, use following HTTP path on NVR:
/playback/videoN.mp4?start=START&end=END
or
/playback/videoN.mp4?start=START&duration=DURATION
the N
in videoN.mp4
is camera number which starts from 1. the START
/ END
are ISO 8601 format like 2018-09-06T15:14:03
. DURATION
is the playback time from the start time. end time regards as start time + duration
minutes. If end
/ duration
parameter is missing, end time regards as start time + 10 minutes. You can also use length
or len
instead of duration
.
HTTP Response Code
NVR replies error status with following HTTP response code:
Code | Description |
---|---|
400 Bad Request | Bad request (ex: wrong format of channels or profile) |
401 Unauthorized | Authentication failure |
403 Forbidden | There is no streamable or no permission. |
404 Not Found | There is unused channel. |
502 Bad Gateway | There is no video signal. |