Solved Looking for a VBScript to Stream & Record using VideoLan.

December 2, 2016 at 11:18:34
Specs: Windows 7
I want to go from a "Batch File" to a VBScript to add to my HTA set of tools I'm creating.

My Batch File Code is:
start "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --run-time=10 rtsp://10.10.12.105/rtsp/CAM6a.mp4
' --sout="#duplicate{dst=display, dst=std{access=file,mux=mov,dst="C:\Temp\CAM6a.mp4}" vlc://quit

And I want to convert this to a VBScript - My code so far is:
Set objShell = CreateObject("Wscript.Shell")
objshell.Run "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" & "" "rtsp://10.10.12.105/rtsp/CAM6.mp4"

MsgBox "You're Streaming & Recording IP Address 10.10.12.105"


See More: Looking for a VBScript to Stream & Record using VideoLan.

Reply ↓  Report •


#1
December 2, 2016 at 11:20:10
My goal is to add this to an HTA, I've created, and a basic VBS/HTA will be used on other pc's without installing additional software

Reply ↓  Report •

#2
December 2, 2016 at 16:19:40
✔ Best Answer
Okay. Hope it works out for you. Just a warning, but HTAs are largely depreciated so don't expect much documentation on MSDN.

Also, your shell.Run line doesn't look right, but if it doesn't throw an error, who am I to judge?

How To Ask Questions The Smart Way


Reply ↓  Report •

#3
December 2, 2016 at 16:35:58
I must not be stating this correctly - I want to convert the batch code below to a VBScript:

My Batch File Code is:
start "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --run-time=10 rtsp://10.10.12.105/rtsp/CAM6a.mp4
' --sout="#duplicate{dst=display, dst=std{access=file,mux=mov,dst="C:\Temp\CAM6a.mp4}" vlc://quit

My VBScrip isn't working, I need help fixing my VBS code below:
Set objShell = CreateObject("Wscript.Shell")
objshell.Run "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" & "" "rtsp://10.10.12.105/rtsp/CAM6.mp4"

Please help me correct the VBS to work properly - THANKS


Reply ↓  Report •

Related Solutions

#4
December 2, 2016 at 19:36:38
objShell.Run """C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"" --run-time=10 rtsp://10.10.12.105/rtsp/CAM6a.mp4"

How To Ask Questions The Smart Way

message edited by Razor2.3


Reply ↓  Report •

#5
December 2, 2016 at 19:59:36
Thanks, I need to be able to have a timed recording " - - run-time=10" and I want to display the output and save the output to a file. My Batch file does this. My issues are within the VBS - I don't know how to setup the script with ALL the Batch file attributes.

I don't script for a living, I splice and can work a batch file...So How or what do I need to do to have the same results in a vbs?

How do I need to setup this batch line of code in a VBS format, what am I doing wrong?
start "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --run-time=10 rtsp://10.10.12.105/rtsp/CAM6a.mp4
' --sout="#duplicate{dst=display, dst=std{access=file,mux=mov,dst="C:\Temp\CAM6a.mp4}" vlc://quit

I appreciate your help.


Reply ↓  Report •

#6
December 2, 2016 at 20:18:02
Just keep adding on like you would a batch file. So long as everything's within the outer double quotes, and you double the double quotes within your string, there's not much difference between what you're doing with the batch and what you're doing in the VBScript.

How To Ask Questions The Smart Way


Reply ↓  Report •

#7
December 3, 2016 at 00:57:30
This worked in my tests. I thought it would be easy, ha ha!
' begin vbscript
public sub ronz(vid)
vid10="c:\temp\"&vid
set v=w.exec("c:\progra~1\videolan\vlc\vlc.exe --play-and-exit --run-time=10 "&vid&" --sout="&"""#duplicate{dst=display, dst=std{access=file,mux=mov,dst="&vid10&"}""")
'-------- end vbscrpt -- begin hta:
<html>
<a onclick=ronz("a.mp4")><img src='x.jpg' width='190'></img></a>

ps: thanks R2! I would never have known the difference on the shell vs exec. VBscript seems to be dropping rapidly from the "mainstream" in favor of jscript - probably due to MS/windows-independence or something like that.

message edited by nbrane


Reply ↓  Report •

#8
December 3, 2016 at 08:00:39
Honestly HTA's aren't much more than local HTML pages with an added "HTA:APPLICATION" tag and no sandboxing. You're better off going with JScript, since then you can use random JavaScripts you find for reference.

I like to avoid WshShell.Exec. If the program has more than 4KB of output, it'll stop and wait for your script to read the output. If your script tries to read the output, the read won't return until the request is fulfilled or the process exits. Since you don't have a way to see if output's waiting and you don't have a non-blocking read, you risk having things stall out every time you call Exec().

How To Ask Questions The Smart Way


Reply ↓  Report •

Ask Question