Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing live stream IP camera through VB Script

Status
Not open for further replies.

ihcc2uni

Technical User
Mar 26, 2007
70
0
0
US
I have a VB Script that works for viewing an IP camera. We had to get a new IP camera and it is using a different protocol (RTSP) for the live feed.

Here is my current script:
'**************************Multi-Point Conference Application*******************************

'Setup Explorer Window
Dim strHost, strName
Set objExplorer = wscript.CreateObject("InternetExplorer.Application", "IE_")

objExplorer.Height = 766
objExplorer.Width =1024
objExplorer.Top = 0
objExplorer.Left = 0
objExplorer.MenuBar = 0
objExplorer.StatusBar = 0
objExplorer.ToolBar = 0
objExplorer.Navigate "about:blank"
objExplorer.Visible = 1
Do While (objExplorer.Busy)
Loop
Set objDocument = objExplorer.Document
objDocument.Open
objDocument.Writeln "<TITLE>Web Conference</TITLE><body bgcolor=black text='White'><CENTER>"

'Setup Popup Boxes
Const wshYes = 6
Const wshNo = 7
Const wshYesNoDialog = 4
Const wshQuestionMark = 32
Set objShell = CreateObject("Wscript.Shell")


'Iowa City Camera
intReturn = objShell.Popup("Connect to Atlanta's Camera?", _
10, "Iowa City", wshYesNoDialog + wshQuestionMark)

If intReturn = wshYes Then
objDocument.writeln("<OBJECT ID=VaCtrl WIDTH=964 HEIGHT=672 hspace=5")
objDocument.writeln(" CLASSID=CLSID:A93B47FD-9BF6-4DA8-97FC-9270B9D64A6C")
objDocument.writeln(" CODEBASE=http:/10.2.3.150:80/plugin/h263ctrl.cab#version=1,7,0,5>")
objDocument.writeln("<PARAM NAME=Url VALUE=http:10.2.3.150:80/cgi-bin/video.vam>")
objDocument.writeln("</OBJECT>")
ElseIf intReturn = wshNo Then
'do nothing
Else
Wscript.Echo "The popup timed out."
End If


objDocument.writeln("<a href=JavaScript:window.close()>Close</a>")

'Exit Procedure
objDocument.Close
wscript.Quit


**************************************************************************************************

I can't figure out what/how to change it to view a rtsp://10.2.3.150:554/live1.sdp feed

Any ideas?
 
This is where the URL should go

objExplorer.Navigate "about:blank"


I hope that helps.

Regards,

Mark

No trees were harmed in posting this message, however a significant number of electrons were terribly inconvenienced.

Check out my scripting solutions at
Work SMARTER not HARDER.
 
That just tries to go to that RTSP url but IE can't open it.I believe parameters are required but not sure what params or where. I think in the ObjDocument section.
 
VBScript is nothing more than a means to automate a process. So, if you were to view things manually what would you do? I think your script and process are likely a lot more complicated than they need to be.

I hope that helps.

Regards,

Mark

No trees were harmed in posting this message, however a significant number of electrons were terribly inconvenienced.

Check out my scripting solutions at
Work SMARTER not HARDER.
 
Currently the only way to view it is to go through the D-Link interface. I'm looking at the source they for it but no luck figuring it out. I am trying to create the script b/c we use these cameras for video conference TVs and only want to view the live video feed and not all the D-Link info. These are end users kicking off these cameras so we have them all as scripts they just double click to start for each TV.

This works on our older cameras but not on this new one.

Here is the source from the D-Link webpage if this helps any...

**************

<script>
//2010.12.21 modified
//*****object tag must be alone between script tag.*****
if(browser_IE)
DW('<OBJECT CLASSID="CLSID:'+AxUuid+'" CODEBASE="/VDControl.CAB?'+AxVer+'#version='+AxVer+'" width="0" height="0" ></OBJECT>');
else
{
if(mpMode == 1)
var RTSPName = g_RTSPName1;
else if(mpMode == 2)
var RTSPName = g_RTSPName2;
else if(mpMode == 3)
var RTSPName = g_RTSPName3;

var o='';

if(g_isIPv6)
//because ipv6 not support rtsp.
var host = g_netip;
else
var host = g_host;

o+='<object id="qtrtsp_object" width="0" height="0" codebase=" ';
o+='classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" type="video/quicktime">';
o+='<param name="src" value=" />';
o+='<param name="autoplay" value="true" />';
o+='<param name="controller" value="false" />';
o+='<param name="qtsrc" value="rtsp://'+host+':'+g_RTSPPort+'/'+RTSPName+'"/>';
o+='</object>';
//alert(o);
DW(o);
}
ALC(1000);
</script>.
<object id="qtrtsp_object" width="0" height="0" codebase=" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" type="video/quicktime"><param name="src" value=" name="autoplay" value="true"><param name="controller" value="false"><param name="qtsrc" value="rtsp://10.2.3.150:554/live1.sdp"></object>
<param name="src" value="<param name="autoplay" value="true">
<param name="controller" value="false">
<param name="qtsrc" value="rtsp://10.2.3.150:554/live1.sdp">
</object>
 
>This works on our older cameras but not on this new one.

Are you sure an RTSP stream can be viewed in Internet Explorer? A quick search implies it may require a plugin to be installed, such as VLC
 
I am not sure on the RTSP stream. I was thinking along the lines that if it was viewable in D-Links web page GUI that it could be viewed my way as well, but you may be correct that an additional plugin is needed.
 
I got it to work with VLC installed locally. Thanks!

If intReturn = wshYes Then
objDocument.writeln("<OBJECT classid=clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921")
objDocument.writeln(" codebase= objDocument.writeln(" width=800 height=600 id=vlc events=True>")
objDocument.writeln(" <param name=SRC value=rtsp://USER:pASSWORD@10.2.3.150/live1.sdp />")
objDocument.writeln(" <param name=ShowDisplay value=True />")
objDocument.writeln(" <param name=AutoLoop value=False />")
objDocument.writeln(" <param name=AutoPlay value=True />")
objDocument.writeln(" <embed id=vlcEmb type=application/x-google-vlc-plugin version=VideoLAN.VLCPlugin.2 autoplay=yes loop=no width=640 height=480 target=rtsp://10.2.3.150:554/live1.sdp ></embed>")
objDocument.writeln("</OBJECT>")
ElseIf intReturn = wshNo Then
'do nothing
Else
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top