Official website

Monday, February 18, 2013

DVR system by using an IP camera

Most IP Cameras on the market, even the cheap ones, has a built-in alarm system that notifies via e-mail, upload image to ftp or send an http request when motion is detected (additional example). But what if we want to capture video instead?

In this example we're going to use the http notification feature that camera provides, to send a command to Jubito server.

Login to camera's interface, go to Alarm tab, check the motion detection and send alarm notification by http check box. Then enter the HTTP URL in a RESTful style like this...

http://<host>:<port>/<instruction>
e.g. http://192.168.1.92:5744/ip-cam


Now we have to create the instruction set ip-cam but first we need to make sure that camera's IP address is declared in the trusted zone.

UPDATE: Check this post to see how to add trusted clients by the UI, without editing the AppConfig.xml.

However, I leave the paragraph below as is, in case you want to edit the file and see things behind the scenes
.
Edit the AppConfig.xml file, jump to the system settings and add the IP address of the camera or any other device you might want to access Jubito, delimited by semicolon. Also make sure you have setup a TCP socket that accept data to a specified port (5744 by default) by filling the localHost (Jubito server address) and localPort tags as well. Then save and close file.

<!-- SYSTEM SETTINGS -->
  <System>
    <Alerts>
      <MailHeaders>
        <MailFrom>noreply@xxx.net</MailFrom>
        <MailTo>xxx@gmail.com</MailTo>
        <MailSubject>Alert from Jubito</MailSubject>
      </MailHeaders>
    </Alerts>
    <Comm>
      <!-- Addresses that allowed to post notifications to socket specified -->
      <Trusted>192.168.1.10; 192.168.1.11</Trusted>
      <!-- Socket for accepting network messages via telnet, ip cameras etc -->
      <localHost>192.168.1.92</localHost>
      <localPort>5744</localPort>
      <!-- Web Server -->
      <Hostname>xxx.dyndns.org</Hostname>
      <httpPort>8080</httpPort>
      <!-- Microcontroller -->
      <ComPort>/dev/ttyACM0</ComPort>
      <BaudRate>9600</BaudRate>
    </Comm>
    <Others>
      <YahooForecastFeed>http://weather.yahooapis.com/forecastrss?p=GRXX0004&amp;u=c</YahooForecastFeed>
    </Others>
  </System>

Once you set it up you should enable the socket.


Let's assemble our ip-cam instruction set. Go to Control Panel/Instruction Sets/Add New Instruction Set. Under name enter the ip-cam. The Action part is a little bit tricky because the camera will always send notification when motion is detected but in our case we need to record a video only when we're out. Here comes the evaluation function that will check our status. The action will look like this...

{ evalBool("%whereami%" == "absent"); rec sendmemail; ; }

Read more on Evaluation

The above action evaluates over the %whereami% function and trigger rec and sendmemail instruction sets when condition is true.


What remains is the rec and sendmemail implementations. The rec will be a trigger of our recording software, in this case ffmpeg. Go back and Add New Launcher. Type rec as a name and set the action...

Using ffmpeg

./'ffmpeg' '-t 00:00:20 -i "http://<cam ip>:<port>/videostream.asf?user=admin&pwd=xxx" "/home/%user%/Videos/IP-Cam/cam-%calendarday%-%calendarmonth%-%calendaryear%_%hour%-%minute%.asf"'

Using vlc (there aren't ffmpeg packages for Raspberry Pi and Banana Pi and need to be compiled from source. Instead you can use vlc)

./'cvlc' 'http://<cam ip>:<port>/videostream.asf?user=admin&pwd=xxx --run-time=20 :demux=dump :demuxdump-file=/home/%user%/Videos/IP-Cam/cam-%calendarday%-%calendarmonth%-%calendaryear%_%hour%-%minute%.asf vlc://quit'


Dot-slash (./) that precedes, is required when we call a third party program.

Finally, we make the sendmemail launcher the same way. Add New Launcher, enter sendmemail as a name and judo mail send <from> <to> `<subject>` `<body>` as action which is the API for sending e-mails. APIs does not require the dot-slash (./) indicator. Learn more about at instruction set anatomy.


Example action
:
judo mail send xxx@gmail.com xxx@gmail.com `Security Breach` `Security Breach @ %date% - %time24%`


That's it, we have successfully created our DVR system!
For dropbox synchronization follow this post.

28 comments:

  1. Nice post...... Information about Digital Camera are really important for picture clarity . To get more information related to this system contact here IP Camera and get high class information

    ReplyDelete
  2. IP camera makes use of internet protocol for the transmission of video or images which are clicked by a camera or group of cameras through the internet. The captured data can be easily copied and saved through various computer programs thus preventing the need for video tools and extensive surveillance tapes. Most commonly the IP camera is simply referred to as internet camera.
    This post is very helpful .Thanks a lot for this post that share with us . You can get more information here:
    http://www.spysecurityshop.nl

    ReplyDelete
  3. Shard’s IP Camera Installation, wireless cameras and cloud cameras allow you set up a security system without the need to run wires around your home or business.

    And

    We provide Phone Systems to businesses across the UK, working with world-class manufacturers to offer a full range of telephony systems that can be tailored to your needs. We cater for businesses of any size, and offer a diverse product range from basic two-user phone systems through to multi-feature systems.

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. It's really amazing and great information share with us. Best DVR Security System provider by ThirdEyeVision.com.

    ReplyDelete
  6. wireless cctv camera in pakistan- Our quality in PC Hardware, Windows Operating Systems and CCTV structures guarantee snappy, monetarily skillful strategies.

    ReplyDelete
  7. Thank you for such a fantastic blog. Where else could anyone get that kind of info written in such a perfect way? I have a presentation that I am presently working on, and I have been on the lookout for such information.

    RFID Based Access Control System

    ReplyDelete
  8. Amazing information you delver regrading DVR system by using an IP camera. After reading your post any easily understand how much security camera helpful in present time.

    ReplyDelete
  9. CCTV cams are also getting in to advancement as of other technological items, now there are moving cctv cameras available in the market, better night vision cams are not a part of our daily life. Another type of security cam is Home Theater College Station TX 77845 helps you better protect your home.

    ReplyDelete
  10. Great post ! There is some really great information on this blog.Thankx for sharing!
    china mobile dvr manufacturera

    ReplyDelete
  11. Recovery controls have more advanced or complex capability to respond to access violations than a corrective access control. Complete business security

    ReplyDelete
  12. This blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful.
    CCTV Security Chennai

    ReplyDelete
  13. I would like to appreciate this nice article. Thanks for sharing such nice information. You can find best CCTV camera supplier : Hidden camera manufacturers

    ReplyDelete
  14. Security is must to save your lives and very important things which are connected with you. We are dealing in various instruments which help to save casualties in daily life. Lets take a look for the Cctv full kit, Cctv suppliers Manchester , Cctv camera system, 8ch cctv DVR , 8 channel cctv security system , HD cctv camera or Hikvision ptz , Hikvision DVR, Hikvision NVR and Cctv for sale.

    ReplyDelete
  15. Nice to read this article.... Thanks for sharing this information...
    cctv camera suppliers in chennai 

    ReplyDelete
  16. don't put the
    user credentials into the cookies. Hikvision Suppliers

    ReplyDelete
  17. I must say this is the best post. Thankyou and have a great service related to CCTV Installation and this Advice for all affordable price.

    ReplyDelete
  18. Some were installed in the yard and one was installed in Red Rum's own stable. kit camere supraveghere

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. Its very informative blog! Thanks for sharing it. These tips are really going to help me.

    ReplyDelete
  21. Thanks for sharing your views. CCTV cameras are very important in safety and night vision do cctv cameras can help in more ways. Good points mentioned by you. Thanks.

    ReplyDelete
  22. The locksmith services are really important for your safety too)

    ReplyDelete
  23. Hi Dear,

    i Like Your Blog Very Much..I see Daily Your Blog ,is A Very Usefull For me.


    You Can see also my services.....


    We offer security cameras services in London. Bison security provide latest technology HD CCTV camera In construction site, home security & fire alarms.


    Visit Now - Security cameras
    -----------

    ReplyDelete
  24. Hi Dear,

    i Like Your Blog Very Much..I see Daily Your Blog ,is A Very Usefull For me.


    You Can see also my services.....


    Bison security provide CCTV camera system in London. We have hikvision HD CCTV camera for Security solutions are available as sale or rental packages.

    Visit Now - CCTV camera system
    -----------

    ReplyDelete
  25. hi

    thank you for great posts

    farshid ghasemi
    from imenshop CCTV company iran
    دوربین مدار بسته

    ReplyDelete