activeX and Visual Basic .net 2005
Posted: 30 May 2006 10:17
by Zingaro2002
I am looking for some good and simple example (maybe with a complete documentation) 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.
Can you help me?
Any suggestion?
Thanks anyway in advance.
Posted: 28 Jul 2006 02:59
by rezapero
Did you ever get a reply?
Posted: 28 Jul 2006 06:20
by Jack L
I have a form that calls up 2 videos and lets you select between the audios. It takes 3 parameters, address1, address2, and the title.
Hope this helps:
Code: Select all
Public Class Form1
Private Sub AudioSelect_Click(ByVal Index As Integer)
If Index = 0 Then
v2.Volume = 0
v1.Volume = 100
VidFrame1.Visible = False
VidFrame2.Visible = True
Else
v1.Volume = 0
v2.Volume = 100
VidFrame1.Visible = False
VidFrame2.Visible = True
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim CmdLine As String
Dim isOnTop As Long
Dim lngHandle As Long
Dim RetVal As Long
Dim lpClassName As String
Dim argArray(0 To 3) As String
Dim IPAddr1 As String
Dim IPAddr2 As String
Dim tPtr As Integer
Dim whand As Long
Me.SetDisplayRectLocation(400, 20)
lpClassName = Space(256)
CmdLine = Command$()
CmdLine = Trim(CmdLine)
If CmdLine = "-close" Then
lngHandle = FindWindow(vbNullString, "Lep Playback Viewer")
While lngHandle <> 0
RetVal = GetClassName(lngHandle, lpClassName, 256)
PostMessage(lngHandle, WM_CLOSE, 0&, 0&)
lngHandle = FindWindow(vbNullString, "Lep Playback Viewer")
End While
End
End If
VidFrame1.Visible = False
VidFrame2.Visible = False
Me.Text = "LEP Playback viewer"
whand = Me.Handle
CmdLine = Replace(CmdLine, ",", " ")
CmdLine = Replace(CmdLine, " ", " ")
If CmdLine <> "" Then
tPtr = InStr(CmdLine, " ")
IPAddr1 = Microsoft.VisualBasic.Left(CmdLine, tPtr - 1)
CmdLine = Microsoft.VisualBasic.Right(CmdLine, Len(CmdLine) - tPtr)
Trim(CmdLine)
tPtr = InStr(CmdLine, " ")
IPAddr2 = Microsoft.VisualBasic.Left(CmdLine, tPtr - 1)
CmdLine = Microsoft.VisualBasic.Right(CmdLine, Len(CmdLine) - tPtr)
Trim(CmdLine)
IPAddr1 = "udp://@" + IPAddr1 + ":1234"
IPAddr2 = "udp://@" + IPAddr2 + ":1234"
Title.Text = "Record Path " + CmdLine
Else
MsgBox("Program called with improper parameters." + vbLf + vbLf _
+ "Proper call is LEPViewer.exe <IP address 1> <IP address 2> <Recordpath>" + _
vbLf + "You started the program with '" + CmdLine + "'", MsgBoxStyle.Critical)
End
End If
V1.playlistClear()
v2.playlistClear()
V1.addTarget(IPAddr1, Nothing, 8, 0)
V2.addTarget(IPAddr2, Nothing, 8, 0)
V1.Volume = 100
V2.Volume = 0
StartupTimer.Interval = 1000
TimerCnt = 0
StartupTimer.Enabled = True
End Sub
Private Sub AudioSelect1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles AudioSelect1.MouseClick
V2.Volume = 0
V1.Volume = 100
VidFrame2.Visible = False
VidFrame1.Visible = True
End Sub
Private Sub AudioSelect2_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles AudioSelect2.MouseClick
V1.Volume = 0
V2.Volume = 100
VidFrame1.Visible = False
VidFrame2.Visible = True
End Sub
Private Sub StartupTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles StartupTimer.Tick
V1.Volume = 0
V2.Volume = 100
V2.Volume = 0
V1.Volume = 100
VidFrame2.Visible = False
VidFrame1.Visible = True
StartupTimer.Enabled = False
End Sub
End Class
[/code]