×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Viewing live stream IP camera through VB Script

Viewing live stream IP camera through VB Script

Viewing live stream IP camera through VB Script

(OP)
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?

RE: Viewing live stream IP camera through VB Script

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 http://www.thespidersparlor.com/vbscript

Work SMARTER not HARDER.

RE: Viewing live stream IP camera through VB Script

(OP)
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.

RE: Viewing live stream IP camera through VB Script

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 http://www.thespidersparlor.com/vbscript

Work SMARTER not HARDER.

RE: Viewing live stream IP camera through VB Script

(OP)
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="http://www.apple.com/qtactivex/qtplugin.cab" ';
o+='classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" type="video/quicktime">';
o+='<param name="src" value="http://'+host+":"+g_Port+'/qt.mov" />';
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="http://www.apple.com/qtactivex/qtplugin.cab" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" type="video/quicktime"><param name="src" value="http://10.2.3.150:/qt.mov"><param 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="http://10.2.3.150:/qt.mov">
<param name="autoplay" value="true">
<param name="controller" value="false">
<param name="qtsrc" value="rtsp://10.2.3.150:554/live1.sdp">
</object>

RE: Viewing live stream IP camera through VB Script

>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

RE: Viewing live stream IP camera through VB Script

(OP)
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.

RE: Viewing live stream IP camera through VB Script

(OP)
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=http://download.videolan.org/pub/videolan/vlc/0.8....")
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close