שתף באמצעות


Show IP Camera Stream on WebBrowser. VB,NET 2015

Question

Tuesday, August 15, 2017 1:54 PM

Hi. Firstly sorry for my bad English.
My problem is that I need to see the IP camera stream in my WinForm.
Currently, I can see the complete web interface, but I need to see only the video part.

* Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown*
*        Dim myUri As UriBuilder = New UriBuilder("http://xxx.xxx.xxx.xxx")*
*        myUri.UserName = "xxxxxxx"*
*        myUri.Password = "xxxxxxx"*
*        WebBrowser1.Navigate(myUri.Uri)*
*  End Sub*

I would greatly appreciate your help
Thank you very much for your attention.

All replies (5)

Tuesday, August 15, 2017 1:59 PM ✅Answered

The webbrowser is a reuse of the IE installed with windows on your computer.

That is showing camera streams with the plug ins installed for that. 

Success
Cor


Tuesday, August 15, 2017 2:10 PM

Thanks for your answer. So how could I be able to visualize the stream from the form?


Tuesday, August 15, 2017 6:19 PM

It seems that the camera returns a webpage which shows the video

If you right click on your browser and tell view page source, then you (if it is not made invisible) mostly see all the code which is used. 

Be aware that is not VB. 

Success
Cor


Wednesday, August 16, 2017 1:48 AM

Hi CM16,

Based on your description, you want to view IP Camera Stream on WebBrowser control. But Internet Explorer is  the base for the web browser component in win forms. In turn by default it will not understand the MJPEG file format so will ask you to download the file. I find one thread that talking this problem, may be helpful to you.

https://stackoverflow.com/questions/38744090/vb-net-viewing-ip-cam-using-webbroswer

Best Regards,

Cherry

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Wednesday, August 16, 2017 10:52 AM

Thank's for the response Cherry. I solved my problem using Aforge.

(https://www.google.com.ar/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjax42dydvVAhUEEJAKHakdDBgQFgglMAA&url=http%3A%2F%2Fwww.aforgenet.com%2F&usg=AFQjCNFayhixaYZt2DEKgbIzft_Xj48vmg

I was wrong about the selected method to resolve it.

Thank's everyone for the help.

My CODE:

Imports AForge.Video

Public Class form1

    Private Sub form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
        
        Dim sourceURL As String = "http://xxx.xxx.xxx.xxx/video1.mjpg"
        Dim mjpeg As MJPEGStream = New MJPEGStream(sourceURL)
        mjpeg.Login = "user"
        mjpeg.Password = "password"
        VideoSourcePlayer1.VideoSource = mjpeg
        VideoSourcePlayer1.Start()

    End Sub