Embed login credentials within URL (Hikvision Camera)

chipreibel

n3wb
Joined
Dec 24, 2014
Messages
19
Reaction score
2
Location
Commerce Twp, MI
I now have (4) Hikvision cameras on my network, one of them aimed at the Front Porch as a "delivery" and/or "visitor" cam.

I work from a home office and would like to have a shortcut on my computer desktop that I can quickly click that will open my browser, log me into the camera and show me what (or who) is on the porch. Currently, by the time I open my browser, type the IP address of the camera, enter my credentials and wait for the live view to load, about a minute has passed (which is too long for me to make the decision on whether I want to answer it or not). As a side-note, I do NOT need this to function when I am outside my local network.

I've tried several URL's, and nothing seems to work. Does anyone have a way to do this?

Thanks!
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
Here are two things you could try. I have used 192.158.0.53 as the camera address:

1. Bookmark the URL http://192.168.0.53/onvif/snapshot, and save a shortcut to that bookmark on your desktop or bookmarks bar or wherever is convenient. This URL loads a snapshot, bypassing the need for authentication (which is one of many reasons you should never make cameras directly accessible to the internet). But it is the simplest method as it will load the image without prompting you for any credentials and it works in any web browser.

- or -

2. Create a shortcut to open the live video stream in VLC media player. First you'll need to have VLC media player installed. Then you need to make it easy to open the video quickly.

Method A:

Create a shortcut to vlc.exe, and modify the path of the shortcut to include the video url as an argument, like this:

Code:
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" rtsp://192.168.0.53/
Method B:

Create a file named whatever.xspf and insert this text:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
   <trackList>
      <track>
         <location>rtsp://192.168.0.53/</location>
      </track>
   </trackList>
</playlist>
With either method, you'll be able to double click the xspf file or the shortcut and VLC will open and begin streaming. For these to work exactly like that, you'll need to have disabled authentication for RTSP. If you don't want to disable authentication for RTSP, you can try changing the URL to
Code:
rtsp://user:password@192.168.0.53/
but I'm not sure if VLC will handle that correctly or not.
 

chipreibel

n3wb
Joined
Dec 24, 2014
Messages
19
Reaction score
2
Location
Commerce Twp, MI
Thanks for the info. I gave it a shot, but no dice.

I currently have my PC connected directly to one of the non powered ports on my POE switch - there is nothing else between my PC and the cameras.

1) I can log into the camera using firefox and view the live feed by going to the cameras IP addresses directly: "192.168.1.28 & 33". No problem.

2) When I type "192.168.1.33/onvif/snapshot", it just says "connecting" and never connects to either camera.

3) I downloaded VLC Player and attempted to open a network media feed, and I can't get it to load the feed. I tried entering just the IP (192.168.1.33) to see if I would be prompted for the credentials (which I wasn't) and also tried to use a URL with the credentials embedded (http://login : password@192.168.1.33) and nothing happens. No error, and no fault - it's just goes back to the home screen with the traffic cone.

Any ideas what the heck is going on? I am running the iVMS software on a separate PC - should I create a second login for the camera and use that for access?
 
Last edited by a moderator:

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
Well for the first one, the /onvif/snapshot URL, it is possible that is only in certain firmware versions. Maybe yours is a different version than all of mine?

In VLC you have to give it a URL if the format rtsp://192.168.0.53/

note the rtsp

VLC should prompt you for login information if the camera requires authentication and you haven't put the authentication in the URL.
 

chipreibel

n3wb
Joined
Dec 24, 2014
Messages
19
Reaction score
2
Location
Commerce Twp, MI
Bingo.

This link ("C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" rtsp://login:password@192.168.1.33/) works like a champ.

Incidentally, you can also use, ("C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" rtsp://login:password@192.168.1.33:554/Streaming/Channels/2) to view the substream. I prefer the substream because it is a lower resolution because it loads faster and even though the video is smaller, I can see exactly what I want almost instantly.

Thank you very much!!!
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
Reducing the i-frame interval in the camera's video encoding settings may improve the loading time too.
 
Top