Using ActiveX to record a video in VB

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
markshanks101

Using ActiveX to record a video in VB

Postby markshanks101 » 09 Jun 2006 06:34

Hi,

I'm in a university department, and we use VB to control an experimental setup. We have a video camera that records the person, and I currently use the VLCPlugin to show the video feed. It works well for this.

However, we would also like to be able to record the video that is also being displayed, and ideally have the VB program control when to start and stop the recording of the video. Getting this to work has been difficult.

I have worked out that if a shortcut has the following parameters it will record:

"C:\Program Files\VideoLAN\VLC\vlc.exe" --intf wx
dshow:// :dshow-vdev="Videum Video Capture"
:dshow-adev="" :dshow-size="" :sout=#transcode{vcodec=mp2v,vb=1024,scale=1}:duplicate{dst=std{access=file,mux=ts,url="c:\test.avi"}}


However, I don't know how to do this command in VB. I currently just set the MRL property to point to the video source before running the VB program. However, if I try and add the code to record as well, eg:

dshow:// :dshow-vdev="Videum Video Capture"
:dshow-adev="" :dshow-size=""
:sout=#transcode{vcodec=mp2v,vb=1024,scale=1}:duplicate{dst=std{access=file,mux=ts,url="c:\test.avi"}}

Then the control will display as usual, but a file isn't even made.

What am I doing wrong? How can I send commands to start and stop recording from the ActiveX control from within VB?

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 10 Jun 2006 20:11

you need to pass the command line arguments as an array of strings to the activex control as per following example

Code: Select all

Dim Vopt(12) As String Vopt(0) = ":dshow-vdev=""""" Vopt(1) = ":dshow-adev=""""" Vopt(2) = ":dshow-size=""""" Vopt(3) = ":dshow-caching=400" Vopt(4) = ":dshow-chroma=""""" Vopt(5) = ":dshow-fps=25.000000" Vopt(6) = ":no-dshow-config" Vopt(7) = ":no-dshow-tuner" Vopt(Cool = ":dshow-tuner-channel=0" Vopt(9) = ":dshow-tuner-country=0" Vopt(10) = ":dshow-tuner-input=1" Vopt(11) = ":sout=#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ogg,url=""D:\toto.ogg""}}" Call Me.VLCPlugin.addTarget("dshow://", Vopt, VLCPlaylistMode.VLCPlayListInsertAndGo, -666) Me.VLCPlugin.Play

soccer
New Cone
New Cone
Posts: 1
Joined: 30 Oct 2006 13:30

Capture does not work under VB6

Postby soccer » 06 Nov 2006 14:52

The following sample does not work under VB6.
There is no display window opened and the destination file stays empty.
The used ActiveX is from vlc 0.8.4a.
Does anybody see the problem?

Code: Select all

Dim vlc As VLCPlugin Dim opt(5) As String Set vlc = New VLCPlugin opt(0) = ":sout=#transcode{vcodec=mp4v,vb=1024,scale=1}" opt(1) = ":duplicate{dst=display,dst=std{access=file,mux=ts,dst=""C:\Temp\dest01.mpeg""}}" opt(2) = ":dshow-vdev=""Cameo Grabster 200""" opt(3) = ":dshow-adev=""""" opt(4) = ":dshow-size=""""" Call vlc.playlistClear Call vlc.addTarget("dshow://", opt, VLCPlayListInsert, 0) vlc.play


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 66 guests