AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Video Source Not Specified

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Video Source Not Specified

Postby JoeNeed88 » Thu Jun 20, 2019 8:29 pm

So I am testing out AForge for accessing some IP cameras on the network here and have run into a snag. I am using the Sample Source Code from the Framework 2.5.5 zip I found on Google Code.(https://code.google.com/archive/p/aforge/downloads) Everything was converted over to VB from C# and runs fine to a point. I can select the local camera option and what not with images loading fine. However, when I select the JPEG or MJPEG options it errors at the videoSourcePlayer.Start() line shown below:

Private Sub OpenVideoSource(ByVal source As IVideoSource)
Me.Cursor = Cursors.WaitCursor
CloseCurrentVideoSource()
videoSourcePlayer.VideoSource = source
videoSourcePlayer.Start() <------------------ ERROR SHOWS HERE -----------------> System.ArgumentException: 'Video source is not specified.'
stopWatch = Nothing
timer.Start()
Me.Cursor = Cursors.[Default]
End Sub

Now this is most likely an error on my part as I'm not a very strong programmer. I am at a loss as to what step to take next though.. If anyone could assist it would be greatly appreciated.
JoeNeed88
 
Posts: 4
Joined: Thu Jun 20, 2019 8:08 pm

Re: Video Source Not Specified

Postby andrew.kirillov » Fri Jun 21, 2019 7:56 am

This exception is thrown by JPEGStream or MJPEGStream if you did not specify URL for the JPEG/MJPEG stream.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3427
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Video Source Not Specified

Postby JoeNeed88 » Fri Jun 21, 2019 12:54 pm

I have a URL I'm trying to use. I realized the url doesn't have jpeg or mjpeg in it but I still get the same error when I try to use the sample URL provided in the source code.
JoeNeed88
 
Posts: 4
Joined: Thu Jun 20, 2019 8:08 pm

Re: Video Source Not Specified

Postby JoeNeed88 » Fri Jun 21, 2019 6:51 pm

So, I'm past the URL issue but was wondering if there is a method with AForge to automatically set the Username and Password for login on the website when I select the camera.
JoeNeed88
 
Posts: 4
Joined: Thu Jun 20, 2019 8:08 pm

Re: Video Source Not Specified

Postby andrew.kirillov » Fri Jun 21, 2019 7:55 pm

Sorry, did not get what you are trying to do.

What do you mean by setting user login and password automatically? How AForge.NET Framework is supposed to know which one to set?
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3427
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Video Source Not Specified

Postby JoeNeed88 » Mon Jun 24, 2019 4:07 pm

I figured it out, just didn't notice the .Login and .Password options at first. I'll post the little snippet below for anyone else looking for this using VB.net.

Dim mjpegSource As MJPEGStream = New MJPEGStream("IP URL HERE")
mjpegSource.Login = "your username here"
mjpegSource.Password = "your password here"
videoSourcePlayer.VideoSource = mjpegSource
videoSourcePlayer.Start()
OpenVideoSource(mjpegSource)

Also, if your camera is on a web page that has other items on screen but you only want the feed of the camera. You can do this by right clicking the feed, click "Inspect", grab that url next to "src=" and use that for the NewMJPEGStream URL
JoeNeed88
 
Posts: 4
Joined: Thu Jun 20, 2019 8:08 pm




Return to AForge.NET Framework