Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Video broadcasting via lan in VB.NET 2010

i tried doing it by embedding a media player but its not doing with it.

i think it needs something more i.e

[Update]

i just downloaded it from a website but it says its a demo version what can i do to make it genuine

and its a encoder code for video broadcasting

VB
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.Filter = "FLV (*.flv) |*.flv|F4V (*.f4v) |*.f4v|VOB (*.vob) |*.vob|mpg (*.mpg) |*.mpg|avi (*.avi) | *.avi|wmv (*.wmv)| *.wmv|asf (*.asf) | *.asf |mov (*.mov)| *.mov|mp4 (*.mp4)| *.mp4|3GP (*.3gp)| *.3gp"

        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            ListBox1.Items.Add(OpenFileDialog1.FileName)
        End If


    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim iIndex As Integer
        iIndex = ListBox1.SelectedIndex

        If iIndex <> -1 Then
            ListBox1.Items.RemoveAt(iIndex)
        End If

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim iCount As Integer
        Dim i As Integer

        iCount = ListBox1.Items.Count


        ListBox1.Items.Clear()

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        AxVideoBroadcast1.StopBroadCast()
        ListBox2.Items.Clear()
        Dim strfile As String
        Dim iresult As Integer

        For Each strfile In ListBox1.Items
            AxVideoBroadcast1.AddVideo(strfile)
        Next

        AxVideoBroadcast1.AudioBitRate = Convert.ToInt32(txtaudiobitrate.Text)
        AxVideoBroadcast1.VideoBitRate = Convert.ToInt32(txtvideobitrate.Text)
        AxVideoBroadcast1.FrameRate = Convert.ToInt16(txtframe.Text)
        AxVideoBroadcast1.Port = Convert.ToInt16(txtport.Text)
        AxVideoBroadcast1.TimeOut = Convert.ToInt16(txttimeout.Text)
        AxVideoBroadcast1.VideoWidth = Convert.ToInt16(txtwidth.Text)
        AxVideoBroadcast1.VideoHeight = Convert.ToInt16(txtheight.Text)

        iresult = AxVideoBroadcast1.StartBroadCast()

        If iresult <> 0 Then
            MessageBox.Show("broadcast failed")
            Exit Sub
        End If

        txttotaldur.Text = AxVideoBroadcast1.GetTotalDuration().ToString()

        If CheckBox1.Checked Then
            AxVideoBroadcastPlayer1.Connect("127.0.0.1", Convert.ToInt16(txtport.Text))
        End If


    End Sub

    Private Sub AxVideoBroadcast1_ClientConnected(ByVal sender As System.Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_ClientConnectedEvent) Handles AxVideoBroadcast1.ClientConnected
        ListBox2.Items.Add(e.strClientIP)
    End Sub

    Private Sub AxVideoBroadcast1_ClientDisconnected(ByVal sender As Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_ClientDisconnectedEvent) Handles AxVideoBroadcast1.ClientDisconnected
        Dim iIndex As Integer
        iIndex = ListBox2.FindString(e.strClientIP.ToString())

        If iIndex <> -1 Then
            ListBox2.Items.RemoveAt(iIndex)
        End If

    End Sub

    Private Sub AxVideoBroadcast1_Playing(ByVal sender As Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_PlayingEvent) Handles AxVideoBroadcast1.Playing
        txtCurPos.Text = e.iPos.ToString()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        AxVideoBroadcast1.StopBroadCast()
    End Sub
End Class


What I have tried:

i tried adding a media player along with some other components but its not doing.
Posted
Updated 7-Feb-16 9:39am
v3
Comments
CHill60 7-Feb-16 9:07am    
We can't see your screen or your HDD, nor read your mind. We can't help you without seeing your code. Use the Improve question link to add some detail to the "What have you tried" section
KAAAAATE 009 7-Feb-16 9:59am    
ohhk sir
KAAAAATE 009 7-Feb-16 10:06am    
i just downloaded it from a website but it says its a demo version what can i do to make it genuine

and its a encoder code for video broadcasting

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.Filter = "FLV (*.flv) |*.flv|F4V (*.f4v) |*.f4v|VOB (*.vob) |*.vob|mpg (*.mpg) |*.mpg|avi (*.avi) | *.avi|wmv (*.wmv)| *.wmv|asf (*.asf) | *.asf |mov (*.mov)| *.mov|mp4 (*.mp4)| *.mp4|3GP (*.3gp)| *.3gp"

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
ListBox1.Items.Add(OpenFileDialog1.FileName)
End If


End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim iIndex As Integer
iIndex = ListBox1.SelectedIndex

If iIndex <> -1 Then
ListBox1.Items.RemoveAt(iIndex)
End If

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim iCount As Integer
Dim i As Integer

iCount = ListBox1.Items.Count


ListBox1.Items.Clear()

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
AxVideoBroadcast1.StopBroadCast()
ListBox2.Items.Clear()
Dim strfile As String
Dim iresult As Integer

For Each strfile In ListBox1.Items
AxVideoBroadcast1.AddVideo(strfile)
Next

AxVideoBroadcast1.AudioBitRate = Convert.ToInt32(txtaudiobitrate.Text)
AxVideoBroadcast1.VideoBitRate = Convert.ToInt32(txtvideobitrate.Text)
AxVideoBroadcast1.FrameRate = Convert.ToInt16(txtframe.Text)
AxVideoBroadcast1.Port = Convert.ToInt16(txtport.Text)
AxVideoBroadcast1.TimeOut = Convert.ToInt16(txttimeout.Text)
AxVideoBroadcast1.VideoWidth = Convert.ToInt16(txtwidth.Text)
AxVideoBroadcast1.VideoHeight = Convert.ToInt16(txtheight.Text)

iresult = AxVideoBroadcast1.StartBroadCast()

If iresult <> 0 Then
MessageBox.Show("broadcast failed")
Exit Sub
End If

txttotaldur.Text = AxVideoBroadcast1.GetTotalDuration().ToString()

If CheckBox1.Checked Then
AxVideoBroadcastPlayer1.Connect("127.0.0.1", Convert.ToInt16(txtport.Text))
End If


End Sub

Private Sub AxVideoBroadcast1_ClientConnected(ByVal sender As System.Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_ClientConnectedEvent) Handles AxVideoBroadcast1.ClientConnected
ListBox2.Items.Add(e.strClientIP)
End Sub

Private Sub AxVideoBroadcast1_ClientDisconnected(ByVal sender As Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_ClientDisconnectedEvent) Handles AxVideoBroadcast1.ClientDisconnected
Dim iIndex As Integer
iIndex = ListBox2.FindString(e.strClientIP.ToString())

If iIndex <> -1 Then
ListBox2.Items.RemoveAt(iIndex)
End If

End Sub

Private Sub AxVideoBroadcast1_Playing(ByVal sender As Object, ByVal e As AxVideoBroadcastLib._DVideoBroadcastEvents_PlayingEvent) Handles AxVideoBroadcast1.Playing
txtCurPos.Text = e.iPos.ToString()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
AxVideoBroadcast1.StopBroadCast()
End Sub
End Class
Sergey Alexandrovich Kryukov 7-Feb-16 14:55pm    
What is AxVideoBroadcast1? You did not show where it is defined/initialized, what is its type.
If you have some demo version, why not talking to the author/owner?
—SA
Sergey Alexandrovich Kryukov 7-Feb-16 13:14pm    
Media player plays, don't broadcast anything.
What do you mean by "broadcasting"? What should be the clients? You can simply deliver the whole media file using any Web protocol, then most players could use it, including a Web browser with HTML5 page via the video element.
If you need something else, what are the requirements for media streaming protocol? In this case, why not using some available streaming solution?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900