It is currently Sun Dec 16, 2018 4:08 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: IP camera wiewer ...
PostPosted: Thu Dec 06, 2018 8:40 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 521
Location: Belgium
Hi everyone,

After they broke in by my mother and a few weeks later by my sister at home ...
I decided to install some IP cameras and to connect them to a PC running win,
internal camera via wifi, and two external cameras via LAN (CAT5) cables.
this two cameras are connected to a HUB and PC.

Is there a way to create a IP connection via PB 5.70, and view in a real time steaming window,
and store the images on a HDD ?

thanks,
marc

_________________
Greetings from Pajottenland - Belgium
PS: sorry for my english I speak flemish ...
www.marc-systems.be


Top
 Profile  
Reply with quote  
 Post subject: Re: IP camera wiewer ...
PostPosted: Thu Dec 06, 2018 10:02 pm 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4051
Location: Germany
How large is your HDD ?

If you only want to store the stream it should be no problem.
But I think it is enough to fetch every 5 second a picture and store it.
In this way you can also show the pictures directly in PB.

For the stream you need to embed/involve VLC or ffmpg.

But you will get a lot of traffic on the net.

In our company we installed a complete own network infrastructure for the cams,
because else they slow down the normal user network.


Top
 Profile  
Reply with quote  
 Post subject: Re: IP camera wiewer ...
PostPosted: Thu Dec 06, 2018 10:18 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1454
Hi marc_256,

I know you're familar with PureBasic Interface to OpenCV, but have you tried connecting your camera via OpenCV's RTSP, particularlly using the FFMPEG functions; see the example cv_RTSP_writeframe_FFMPEG.pb. Combine this with the example cv_webcam_zone_tracking.pb, could make for a powerful application.

Another option might be to use the WebGadget, capturing the RTSP stream, drawing its contents to an image. Depending on the cameras manufacture, it should come with a configuration tool built-in to the firmware.

Cheers!

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: IP camera wiewer ...
PostPosted: Fri Dec 07, 2018 5:57 am 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 521
Location: Belgium
Hi infratec,

I will also extend in my company the existing alarm system with some cameras,
and I bought a exterior HDD of 2 x 2TB in RAID 1 mode.
With a separated LAN for the cameras.
And you are write every 5 sec is OK to send via WIFI,
and streaming only if there is an alarm.
Yes, I was looking to VLC ...



Hello JHPJHP,

"I know you're familar with PureBasic Interface to OpenCV"
I think you are the best man who is familar with OpenCV :wink:

Oh, yes I will see for it,
I like to use PB so I can control some stuff myself.
I gone work on it this WE ...
thanks for the tip.


greetings,
marc

_________________
Greetings from Pajottenland - Belgium
PS: sorry for my english I speak flemish ...
www.marc-systems.be


Top
 Profile  
Reply with quote  
 Post subject: Re: IP camera wiewer ...
PostPosted: Fri Dec 07, 2018 12:38 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Sep 17, 2015 3:39 pm
Posts: 127
this code has not been tested!!

Code:
;///////////////////////////////////////////////////////////////////
;!!warning this code has not been tested, And use at your own risk!!
;///////////////////////////////////////////////////////////////////

InitNetwork()

ip.s = "192.168.1.22" ;ip camera
Port = 8091 ; port camera
path.s = "/videostream.cgi" ; path of request
authentification.s = "yourauth==" ; your authentification!

workmemory = AllocateMemory(1024*1024*2) ;memory to receive image data

c= OpenNetworkConnection(ip,Port)
If c
  SendNetworkString(c,"GET " + path + " HTTP/1.1" + #CRLF$ +
                      "Host: " + ip + ":" + Port  + #CRLF$ +
                      "Connection: keep-alive"  + #CRLF$ +
                      "Authorization: Basic " + authentification  + #CRLF$ + #CRLF$ ,#PB_Ascii) ; send request to get image
 
  Repeat
    ec = NetworkClientEvent(c)
    If ec = #PB_NetworkEvent_Data
      rs = ReceiveNetworkData(c,workmemory,1024*1024*2)
      req.s = PeekS(workmemory,-1,#PB_Ascii);get request
     
      ShowMemoryViewer(workmemory,rs)
     
      imagesize = Val(StringField(StringField(req,2,"Content-Length: "),1,#CRLF$))
      imageaddress = workmemory + rs - imagesize
     
      ;;........
     
    EndIf
  Until ec = #PB_NetworkEvent_Disconnect
EndIf


_________________
interested in Cybersecurity..


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye