Anything DIY

Streaming and getting a snapshot remotely from ANNKE N48PBB NVR

Post Reply
other / anything     Views: 618Prev .. Next
Streaming and getting a snapshot remotely from ANNKE N48PBB NVRPosted: Friday, April 30, 2021 [19:32:22] - 1
rootPosted by:rootMember Since:
June 16 2010
Posts: 357
Streaming video from ANNKE NVR on your phone or PC.
Accessing a live image remotely is fairly easy using RTSP protocol.
If ports are forwarded on a router the same can be done remotely from the Internet.
View Codertsp://USER:PASSWORD@NVR_IP_ADDRESS:554/Streaming/Channels/101/?transportmode=unicast.sdp

NLExplanations:

rtsp: protocol
USER: user name to access video stream (it is recommended to create a user with only access to the video and nothing else)
PASSWORD: password for the user above
NVR_IP_ADDRESS: NVR LAN IP address
554: streaming port, default is 554
Streaming/Channels: just leave it as-is
101: 1 - camera number from 1 to 8. 01 - Main Stream, 02 - Sub-Stream
?transportmode=unicast.sdp: Transport mode

VLC will play the stream.

Image 1

To make access simpler/easier html file can be created locally with local and remote links for the stream.
Links will automatically open in VLC.

i.e:
View Code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;>
<html xmlns="www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>Streaming links</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type"content="application/xhtml+xml;charset=UTF-8" />
</head>
<body>
<p><b>Local links:</b></p>
<p><a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/101/?transportmode=unicast.sdp">Cam 1</a><br />
<a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/201/?transportmode=unicast.sdp">Cam 2</a><br />
<a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/301/?transportmode=unicast.sdp">Cam 3</a><br />
<a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/401/?transportmode=unicast.sdp">Cam 4</a><br />
<a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/501/?transportmode=unicast.sdp">Cam 5</a><br />
<a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/601/?transportmode=unicast.sdp">Cam 6</a><br />
<a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/601/?transportmode=unicast.sdp">Cam 7</a><br />
<a href="rtsp://USER:PASSWORD@LAN_IP_ADDRESS:554/Streaming/Channels/601/?transportmode=unicast.sdp">Cam 8</a></p>

<p><b>Remote links:</b></p>
<p><a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/101/?transportmode=unicast.sdp">Cam 1</a><br />
<a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/201/?transportmode=unicast.sdp">Cam 2</a><br />
<a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/301/?transportmode=unicast.sdp">Cam 3</a><br />
<a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/401/?transportmode=unicast.sdp">Cam 4</a><br />
<a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/501/?transportmode=unicast.sdp">Cam 5</a><br />
<a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/601/?transportmode=unicast.sdp">Cam 6</a><br />
<a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/601/?transportmode=unicast.sdp">Cam 7</a><br />
<a href="rtsp://USER:PASSWORD@HOME_IP_ADDRESS:554/Streaming/Channels/601/?transportmode=unicast.sdp">Cam 8</a></p>
</body>
</html>

We will not dig into Port Forwarding procedure on a router.There's no place like ~
Getting a snapshot remotely from ANNKE N48PBB NVRPosted: Friday, April 30, 2021 [19:48:49] - 2
rootPosted by:rootMember Since:
June 16 2010
Posts: 357
Getting a snapshot is a little more complicated than streaming video.
One of the ways to do it is using a ffmpeg:
View Codeffmpeg -y -rtsp_transport tcp -i rtsp://USER:PASSWORD@IP_ADDRESS:554/Streaming/Channels/401/?transportmode=unicast.sdp -frames:v 1 /path/to/image_file/frame.test.jpg

Getting a snapshot remotely from ANNKE N48PBB NVR
Sometimes streaming gets errors and if process is automated some check-ups would help getting a snapshot.
Here is a Perl sub to save a snapshot from RTSP stream:
View Codesub getfile {
my $filename=shift;$tries++;my $limit=0;
while(1) {$limit++;
my $result = `ffmpeg -y -rtsp_transport tcp -i rtsp://USER:PASSWORD\@IP_ADDRESS:554/Streaming/Channels/401/?transportmode=unicast.sdp -frames:v 1 $filename 2>&1`;
unless($result =~ /Error parsing/) {last;} else {unlink $filename;}
if($limit > 10) {last;}
} ## WHILE END
} ## END GET FILE


Snapshots are great for creating an annual video from daily pictures. Further processing required..There's no place like ~
other / anythingPrev .. Next
 
Post Reply
Home - Other: Anything DIY
Our Telegram Group