VB .Net 03 or 05 ActiveX example code.

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

VB .Net 03 or 05 ActiveX example code.

Postby Mr Guest » 27 Apr 2006 13:48

Just having a few issues.
Simply wanting to use the ActiveX with VB .Net.

Trawling through this forum I have found C# code that works nice but I would prefer VB. Someone did post a VB sample but it does not convert into .Net. Any example code where picking up a direct show from a web cam and recording to disk would be appreciated. Especially in the area of setting the Options array (:sout etc...)

Thanks in advance for any help.

Guest

same question

Postby Guest » 30 May 2006 10:10

I am also looking for some good and simple example using VLC activeX inside a VB .net 2005 program.

I am trying (in my program) to preview streming video coming from a video capture (connected to a cam) and transcode it to an mpeg4 file.

Have you found something useful?
Thanks anyway.

kaanuki

Postby kaanuki » 04 Jun 2006 03:17

Using VB 2005 Express Edition, you can go to...
TOOLS > CHOOSE TOOLBOX ITEMS > COM COMPONENTS[tab] > Select the VIDEOLAN ActiveX component.

Now the component is in your toolbox. simply drag it to your form and you can edit its properties directly from the Properties window (including the mrl).

Works like a charm!

-kaan-

Zingaro2002
Blank Cone
Blank Cone
Posts: 47
Joined: 30 May 2006 09:58

Postby Zingaro2002 » 07 Jun 2006 18:12

Thank you kaanuki!!!

I did as you suggested and now I have (in my form) a AxVLCPlugin1 control.

Now the problem is:
how can I play an .avi file?
how can I capture from my video capture device to an mpeg4 avi file?

Can you post or suggest some Visual Basic 2005 code to do such "simple" (not for me) things?

Many thanks in advance!!!

P.S: what is MRL?

Zingaro2002
Blank Cone
Blank Cone
Posts: 47
Joined: 30 May 2006 09:58

Postby Zingaro2002 » 07 Jun 2006 19:10

I try to answer to my first question:

PLAYING AN AVI FILE

Private Sub btnPlay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlay.Click
Dim MRLstring As String = Strings.Trim(txtDaRiprodurre.Text)
AxVLCPlugin1.addTarget(MRLstring, Nothing, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, -666)
AxVLCPlugin1.play()
End Sub

Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
AxVLCPlugin1.stop()
End Sub

Private Sub btnPauseResume_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPauseResume.Click
If AxVLCPlugin1.Playing Then
AxVLCPlugin1.pause()
Else
AxVLCPlugin1.play()
End If
End Sub


txtDaRiprodurre is a textbox where user writes the complete path to the .avi file to play (blank spaces are deleted with Strings.Trim function).

To understand addTarget method take a look here:

viewtopic.php?t=11627&

Hope it helps.

Just a problem: when I stop playing and choose another file to play and press play again, the file that is played is always the first one that was played... WHY???

Thanks again to kaanuki and to Quovodis (in the other post I linked here above).

P.S: how can I capture from my video capture device to an mpeg4 avi file using an installed compressor-codec (such as DivX)?

lalit_dubey
New Cone
New Cone
Posts: 3
Joined: 14 Jun 2006 13:10
Location: India

Registration failed

Postby lalit_dubey » 20 Jun 2006 08:01

Hi ,

I was trying to add this active X control in tool box as stated but i observed error that self registration of axvlc.dll is failed.
Even though i had latest version of VLC.

Where can i find the latest active x to use.
Lalit N Dubey
At Digisign Technologies India pvt Ltd

myangga
Blank Cone
Blank Cone
Posts: 25
Joined: 03 Feb 2006 11:23
Location: Est

Postby myangga » 29 Jun 2006 08:37

hi
did you select the activeX during the install ? 'cause it's not default.
bye

JamesAMichael
New Cone
New Cone
Posts: 1
Joined: 24 Jul 2006 17:15
Contact:

Playing Multiple Files

Postby JamesAMichael » 24 Jul 2006 17:20

@Zingaro2002

I have found that when I replace the line

Code: Select all

AxVLCPlugin1.addTarget(MRLstring, Nothing, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, -666)
with

Code: Select all

AxVLCPlugin1.addTarget(MRLstring, Nothing, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, 0)
You should be able to get it to play more than one file, I have found that this caused the stop button to have the same problem, but you can just disable the stop button if you find you have any problems with it. Hope this helps.

Zingaro2002
Blank Cone
Blank Cone
Posts: 47
Joined: 30 May 2006 09:58

Postby Zingaro2002 » 25 Jul 2006 09:53

Thank you JamesMichael!

And what about capturing from a video capture device to an mpeg4 avi file using an installed compressor-codec (such as DivX)?

jmfvossen

Re: VB .Net 03 or 05 ActiveX example code.

Postby jmfvossen » 27 Jul 2006 01:21

Just having a few issues.
Simply wanting to use the ActiveX with VB .Net.

Trawling through this forum I have found C# code that works nice but I would prefer VB. Someone did post a VB sample but it does not convert into .Net. Any example code where picking up a direct show from a web cam and recording to disk would be appreciated. Especially in the area of setting the Options array (:sout etc...)

Thanks in advance for any help.

    rezapero

    Re: VB .Net 03 or 05 ActiveX example code.

    Postby rezapero » 27 Jul 2006 03:39

    I need to control the VLC activeX component from inside Powerpoint.
    Honestly... don't laugh.

    I inserted the ActiveX component and created a button.
    The hero() subroutine is a macro linked to the button.

    The following code compiles and runs
    Sub hero()
    Dim strMRL As String
    MsgBox ("hero")
    strMRL = "C:\hero.mpg"
    Original.MRL = strMRL
    Original.Play
    End Sub

    Now I want to use the powerful yet troublesome addTarget method to be able to control the streaming of the file.
    The following code compiles but does not run. I get a runtime error 5 Invalid procedure call or argument.

    Sub hero()
    Dim strMRL As String
    MsgBox ("hero")
    strMRL = "C:\hero.mpg"
    Original.addTarget uri:=strMRL, Options:="", Mode:=VLCPlayListAppend, Position:=0
    End Sub

    For the option field I tried vbEmpty and Nothing...
    NADA - the same run time error occurs

    So I also kindly request a VB project that illustrates the various examples of playing and streaming.

    Thanks
    Just having a few issues.
    Simply wanting to use the ActiveX with VB .Net.

    Trawling through this forum I have found C# code that works nice but I would prefer VB. Someone did post a VB sample but it does not convert into .Net. Any example code where picking up a direct show from a web cam and recording to disk would be appreciated. Especially in the area of setting the Options array (:sout etc...)

    Thanks in advance for any help.

      digizar
      Blank Cone
      Blank Cone
      Posts: 19
      Joined: 09 Oct 2006 14:09
      VLC version: 0.8.2
      Operating System: win, linux
      Location: moved from NL to Germany, to Bad-Soden-Salmuenster, Spessart
      Contact:

      Postby digizar » 07 Nov 2006 20:08

      Just a problem: when I stop playing and choose another file to play and press play again, the file that is played is always the first one that was played... WHY???
      By this time you probably solved that issue.
      So just to keep the thread consistent:
      the file is (still) contained in the playlist.
      obj.playlistClear () should help.
      Since 1962 in IT-Business -with the big BLUE IBMs-
      (I am 67 now, still in business better than ever),
      12 years experience of MS-V-Studio,
      A few handful of years experience in Línux/Unix.
      Lots of years of experience in microcontrollers.
      See the personal website.


      Return to “Web and scripting”

      Who is online

      Users browsing this forum: No registered users and 10 guests