Difference between revisions of "IP Cameras"

From LinuxMCE
Jump to: navigation, search
(Some tips on finding your cameras proper url.)
 
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category: Hardware| ]]
+
[[Category:IP Cameras| IP Cameras]]
[[Category: Cameras]]
+
{| align="right"
[[Category: Tutorials]]
+
  | __TOC__
 +
  |}
 +
 
 +
See [[Monitor surveillance cameras]]
 +
 
  
 
==Introduction==
 
==Introduction==
IP cameras, a.k.a. "network cameras", are digital cameras that have a built-in web server. This allows the camera to be accessed by any computer on the same network using a web browser. Video is streamed to the web browser from the camera without additional equipment.  In a LinuxMCE system, IP cameras are easy to setup, but require some extra manipulation to get them to record.
+
An IP camera, also called network camera, is a digital camera that has a built-in web server capable of serving streams of images that appear as live video. <br>
 +
Once connected to a network, the images from the camera can be accessed by any computer on the same network using a common web browser, without the need for additional equipment. The live video is streamed from the camera to the web browser. <br>
  
=IP Cameras and Motion Wrapper=
+
LinuxMCE can tap into an IP video stream and make the videos available throughout the system. <br>
  
 +
IP cameras can be easily incorporated in a LinuxMCE system. In this article, you will get all the instructions necessary for you to do add, configure, and troubleshoot IP cameras.
  
IP cameras can be used under the Motion Wrapper to enable it to detect motion and alert based on that function.
+
{{p}}
  
==To add Motion Wrapper and IP Cameras.==
+
==IP Cameras and Motion Wrapper==
  
* Open your webadmin control panel and on the left pane at the bottom click on "Show Device Tree".
+
IP cameras can be used under the Motion Wrapper to enable it to detect motion and send alerts.
  
* In the left pane Click on "core/hybrid".
 
  
* On the right pane near the top, click on "Create Child Device", then leave everything blank and click "Pick Device Template" button.
+
=== To add Motion Wrapper and IP Cameras ===
  
* Click the pull down box under "Device Template" and find the template labeled "Motion Wrapper", select this item and click "Pick Device Template"
+
==== Add the Motion Wrapper interface to the system ====
 +
LinuxMCE includes the device [[motion|Motion Wrapper]], which is a wrapper for the open source project [http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome Motion]. The [[motion|Motion Wrapper]] serves as the interface between LinuxMCE  and Motion. <br>
  
* Now on the right pane, click "Create Child Device" again.  Enter your IP Cameras IP address and MAC address here, then click "Pick Device Template"
 
  
* Click the pull down box under "Device Template" and use "Generic Analog Camera", then click "Pick Device Template"
+
To add the Motion Wrapper as a device:
  
* Now on the right window pane, scroll down to the bottom and find the field named "Configuration".  This is where you put your cameras URL normally used by your web browser, to view your cameras video feed.  My examples are based on Axis based IP Cameras.
+
# Open your [[LinuxMCE Admin Website|webadmin]] control panel
<pre>
+
# Under Wizard: Devices > Interfaces
netcam_url http://<you.cameras.ip.addreess>/mjpg/video.mjpg
+
# At the bottom of the page, click on '''Add device''' <br> - ''Device Category'': '''Surveillance Video Interfaces''' (NOT Surveillance Cameras, that is in the pripherals category)<br> - Click the pull down box under ''Device Template'' and find and select the template labeled '''Motion Wrapper'''.
netcam_userpass username:password
+
# Click on '''Pick device template'''. This creates the Interface device and displays it on the configuration page.
</pre>
+
# Under "Action" on the right side, click on '''Advanced'''.
* Now click save at the bottom, reload your router, now on your mce interface go to "Security" -> "Generic Analog Camera" and see if it's working.
+
  
==Some tips on finding your cameras proper url.==
+
This installs the device Motion Wrapper in LinuxMCE. Once installed, the procedure does not need to be repeated and child devices can be added at will.
  
* Try to use ftp to connect to your camera. The username and pass is usually whatever you set up on the web interface of the camera.  Traverse the folders to find your html documents folder.  Typically, your looking for a .jpg or .mjpg file to point the Motion Wrapper to.  For example, these are the possible links on an Axis 2100 IP Camera.
+
;Note: You can also replace steps 1&2 with <br>on the left pane at the bottom click on '''Show Device Tree'''<pre> My Devices > CORE > Create Child Device > Pick device template</pre>There is no step 5 when using this method. You can start creating the child device.
 +
 
 +
{{p}}
 +
 
 +
==== Add the IP camera ====
 +
 
 +
===== Add the IP camera as a Generic Analog Camera to the Motion Wrapper =====
 +
# Now on the right pane, click '''Create Child Device''' again. 
 +
# Enter your IP Cameras IP address and MAC address here,
 +
# click '''Pick Device Template'''
 +
# Click the pull down box under ''Device Template'' and use '''Generic Analog Camera''',
 +
# click '''Pick Device Template'''
 +
# Now on the right window pane, scroll down to the bottom and find the field named '''Configuration'''.  This is where you put your cameras URL normally used by your web browser, to view your cameras video feed.  My examples are based on Axis based IP Cameras.<pre>netcam_url http://<you.cameras.ip.addreess>/mjpg/video.mjpg</pre><pre>netcam_userpass username:password</pre>
 +
# Now click '''save''' at the bottom
 +
# RESTART your router
 +
 
 +
Now on your LMCE interface, go to "Security" -> "Generic Analog Camera" and see if it's working.
 +
 
 +
{{p}}
 +
 
 +
===== Adding IP Cameras as a Generic Motion IP camera under Motion Wrapper =====
 +
# From '''[[LinuxMCE Admin Website]]-->Advanced-->Configuration-->[[Devices]]''' Open '''CORE''' and then Click on '''Motion_Wrapper'''
 +
# From the top right frame press '''Create Child Device'''
 +
## Enter a description (or leave blank for default one), fill in the '''IP Address''' with your IP Camera's IP, and the '''MAC''' field with your IP Camera's MAC address.
 +
## Press '''Pick Device Template'''.
 +
## In the "Device Template ***" section, select the template '''Generic Motion IP camera'''
 +
## Click '''Pick device template'''. This opens the camera's configuration page
 +
### In "Device Info", select the "Room" where your IP Cam is located
 +
### Scroll down to the '''Device data''' section.
 +
#### '''Path''' : set the path to your IP Camera current snapshot, it has to be a '''jpg''' or '''mjpg''' file
 +
#### "Protocol" : set the protocol to '''http''' or '''ftp''', default is http
 +
#### "TCP Port" : set the port on which your IP CAM it's feeding the images
 +
#### "Username" : set the username required to access your IP Cam
 +
#### "Password" : set the password required to access your IP Cam
 +
#### "Noise" : noise level for motion detection, default to 32
 +
### Click '''Save'''
 +
## Scroll up to the top menu and, on the left, select '''Wizard > Restart'''
 +
### Click on '''[[quick reload router|Quick Reload Router]]'''
 +
### Wait for the router to reload
 +
## Now scroll up to the top menu and, on the right, select '''Security > View cameras'''
 +
### Select the check box for the camera
 +
### Click '''Preview checked cameras'''
 +
# For the corresponding button to show, regenerate your orbiters.
 +
 
 +
{{p}}
 +
 
 +
== Adding Axis IP cameras to Motion ==
 +
To get all the features offered by Motion (motion detection,recording,etc...), you need to run your IP Camera under motion.
 +
Your camera can be auto detected, and device generated for it, but it might NOT be under Motion as parent. This is the case for the Axis camera.
 +
 
 +
Here is a quick and not so clean workaround for adding an IP camera device under Motion:
 +
 
 +
# Add Generic Analog Camera #66 Device
 +
# Change Configuraton field to add data for IP camera
 +
 
 +
Example for Axis camera :
 +
 
 +
netcam_url  http://192.168.0.90/axis-cgi/jpg/image.cgi?resolution=640x480
 +
netcam_userpass username:password   
 +
 
 +
Omit the last one if you don't have a access password specified.
 +
 
 +
{{p}}
 +
 
 +
== Tips on finding your camera's URL ==
 +
 
 +
# Try to use ftp to connect to your camera. The username and pass is usually whatever you set up on the web interface of the camera.   
 +
# Traverse the folders to find your html documents folder.  <br>Typically, you're looking for a '''.jpg''' or '''.mjpg''' file to point the Motion Wrapper to.   
 +
 
 +
For example, these are the possible links on an Axis 2100 IP Camera.
 
<pre>
 
<pre>
 
/jpg/image.jpg (Works fine using the wrapper)
 
/jpg/image.jpg (Works fine using the wrapper)
Line 41: Line 114:
 
/cgi-bin/mjpg/video.cgi (Again, could not get it to work)
 
/cgi-bin/mjpg/video.cgi (Again, could not get it to work)
 
</pre>
 
</pre>
 +
{{p}}
 +
 +
== Installing an "external" network camera ==
 +
 +
This section describes how to install an IP camera as a [[Motion]] device.
 +
 +
<span style="color:red">'''''Note: These instructions are for when the camera is plugged into a router on the external network, as opposed to a switch on the internal network. Not ideal, but it is sometimes necessary due to [http://forum.linuxmce.org/index.php?topic=10134.0 this aforementioned problem].'''''</span>
 +
 +
# Install motion wrapper (if it is not installed already). <br>In web admin (type "192.168.80.1" in a browser of your choice), click '''Show devices tree''' (very bottom of left-hand pane)<br>click on '''CORE''' and then '''Create Child Device'''. <br>Then press the '''Pick device template''' button, which will open a new window. <br>Under "''Device Template''", select '''Motion Wrapper''' and press the '''Pick device template''' button.
 +
# Plug your camera into the external router. In your router admin page (accessed via 192.168.1.1 in my case) find out what IP was assigned. Type this IP into your browser and have a look through the options. Set the username and password. I also set a static IP just in case it tries to change itself. I also specified the camera's IP on my router so that no other device could take it (belt and braces).
 +
# In LMCE web admin ("192.168.80.1" into a browser), go to '''Wizard''' -> '''Devices''' -> '''Surveillance Cameras'''. <br>Click the '''Add Device''' button at the bottom of the page. This will open a new window.
 +
# In the window that just opened, pick '''Generic Motion IP Camera''' from the drop-down menu in the ''Device Template'' section. <br>Press the '''Pick device template''' button.
 +
# Find the new camera in '''Wizard''' -> '''Devices''' -> '''Surveillance Cameras'''. Change the description to something more obvious if you so wish and select a room.
 +
# Change the '''Path''' field to match your camera's URL as indicated in the previous section. In my case, I used "http://192.168.1.XXX/videostream.cgi?user=XXXXX&pwd=XXXXXX". <br>Do not forget to replace the Xs with the IP, username and password. <br>Add "80" to the '''TCP Port''' field. Press '''Save'''.
 +
# Press the '''Advanced''' button. Check the IP and MAC address in the "Device Info" section. If it's not the same as the MAC and IP you saw in the camera's utility, change it. Click '''Save'''.
 +
# Do a '''Reload & Regen''', and that should be it.
 +
 +
This camera can now be used as a motion sensor and/or for recording movement (recordings are stored in "/home/cameras/XX" where XX is the device number of the camera, and last for 5 days I believe). A scenario will hopefully be automatically generated.
 +
 +
Repeat the above procedure for any additional cameras.
 +
 +
;Note: The old issue of Motion dying after reloading/restarting the Core has been fixed. It is no longer necessary to restarted it manually by doing a "<code>sudo /etc/init.d/motion restart</code>". This issue has been reported http://svn.linuxmce.org/trac.cgi/ticket/904 & http://svn.linuxmce.org/trac.cgi/ticket/715 You can read about the resolution there if you'd like to. {{p}}Very occasionally I have found that the scenarios sometimes require a little bit of tinkering. If there is no image displayed when you click on the scenario, look in Wizard -> Scenarios -> Security scenarios, select the scenario in question, select "Advanced Wizard" in the "Edit scenario using wizard" section, and just check that the number in the "#2 PK_Device (int)" field corresponds with the camera's Device #; if it does not, change it. Reload & Regen.''
  
==For the motion detection and alerting==
 
  
* I only briefly looked at this capability before writing this article.  Feel free to add on to it, or i'll come back and post my findings after inkering with it.
+
{{p}}
  
 +
== LinuxMCE compatible IP Cameras ==
  
 +
For a list of IP security cameras that have been tested with LinuxMCE, see:
  
==Available IP Cameras==
+
* See articles in the [[:Category:Cameras|Camera Category]]
  
Include here a list of IP security cameras that have been tested with LinuxMCE.
+
{{p}}
{| class="wikitable" width="300" style="text-align:center; background:#efefef; width:75%; border:1px solid black"
+
|+ IP Security Cameras
+
|-
+
| [[Axis Network Cameras]]
+
|-
+
| [[D-Link Network Cameras]]
+
|}
+

Latest revision as of 08:21, 23 October 2012

See Monitor surveillance cameras


Introduction

An IP camera, also called network camera, is a digital camera that has a built-in web server capable of serving streams of images that appear as live video.
Once connected to a network, the images from the camera can be accessed by any computer on the same network using a common web browser, without the need for additional equipment. The live video is streamed from the camera to the web browser.

LinuxMCE can tap into an IP video stream and make the videos available throughout the system.

IP cameras can be easily incorporated in a LinuxMCE system. In this article, you will get all the instructions necessary for you to do add, configure, and troubleshoot IP cameras.



IP Cameras and Motion Wrapper

IP cameras can be used under the Motion Wrapper to enable it to detect motion and send alerts.


To add Motion Wrapper and IP Cameras

Add the Motion Wrapper interface to the system

LinuxMCE includes the device Motion Wrapper, which is a wrapper for the open source project Motion. The Motion Wrapper serves as the interface between LinuxMCE and Motion.


To add the Motion Wrapper as a device:

  1. Open your webadmin control panel
  2. Under Wizard: Devices > Interfaces
  3. At the bottom of the page, click on Add device
    - Device Category: Surveillance Video Interfaces (NOT Surveillance Cameras, that is in the pripherals category)
    - Click the pull down box under Device Template and find and select the template labeled Motion Wrapper.
  4. Click on Pick device template. This creates the Interface device and displays it on the configuration page.
  5. Under "Action" on the right side, click on Advanced.

This installs the device Motion Wrapper in LinuxMCE. Once installed, the procedure does not need to be repeated and child devices can be added at will.

Note
You can also replace steps 1&2 with
on the left pane at the bottom click on Show Device Tree
	My Devices > CORE > Create Child Device > Pick device template
There is no step 5 when using this method. You can start creating the child device.



Add the IP camera

Add the IP camera as a Generic Analog Camera to the Motion Wrapper
  1. Now on the right pane, click Create Child Device again.
  2. Enter your IP Cameras IP address and MAC address here,
  3. click Pick Device Template
  4. Click the pull down box under Device Template and use Generic Analog Camera,
  5. click Pick Device Template
  6. Now on the right window pane, scroll down to the bottom and find the field named Configuration. This is where you put your cameras URL normally used by your web browser, to view your cameras video feed. My examples are based on Axis based IP Cameras.
    netcam_url http://<you.cameras.ip.addreess>/mjpg/video.mjpg
    netcam_userpass username:password
  7. Now click save at the bottom
  8. RESTART your router

Now on your LMCE interface, go to "Security" -> "Generic Analog Camera" and see if it's working.



Adding IP Cameras as a Generic Motion IP camera under Motion Wrapper
  1. From LinuxMCE Admin Website-->Advanced-->Configuration-->Devices Open CORE and then Click on Motion_Wrapper
  2. From the top right frame press Create Child Device
    1. Enter a description (or leave blank for default one), fill in the IP Address with your IP Camera's IP, and the MAC field with your IP Camera's MAC address.
    2. Press Pick Device Template.
    3. In the "Device Template ***" section, select the template Generic Motion IP camera
    4. Click Pick device template. This opens the camera's configuration page
      1. In "Device Info", select the "Room" where your IP Cam is located
      2. Scroll down to the Device data section.
        1. Path : set the path to your IP Camera current snapshot, it has to be a jpg or mjpg file
        2. "Protocol" : set the protocol to http or ftp, default is http
        3. "TCP Port" : set the port on which your IP CAM it's feeding the images
        4. "Username" : set the username required to access your IP Cam
        5. "Password" : set the password required to access your IP Cam
        6. "Noise" : noise level for motion detection, default to 32
      3. Click Save
    5. Scroll up to the top menu and, on the left, select Wizard > Restart
      1. Click on Quick Reload Router
      2. Wait for the router to reload
    6. Now scroll up to the top menu and, on the right, select Security > View cameras
      1. Select the check box for the camera
      2. Click Preview checked cameras
  3. For the corresponding button to show, regenerate your orbiters.



Adding Axis IP cameras to Motion

To get all the features offered by Motion (motion detection,recording,etc...), you need to run your IP Camera under motion. Your camera can be auto detected, and device generated for it, but it might NOT be under Motion as parent. This is the case for the Axis camera.

Here is a quick and not so clean workaround for adding an IP camera device under Motion:

  1. Add Generic Analog Camera #66 Device
  2. Change Configuraton field to add data for IP camera

Example for Axis camera :

netcam_url  http://192.168.0.90/axis-cgi/jpg/image.cgi?resolution=640x480
netcam_userpass username:password    

Omit the last one if you don't have a access password specified.



Tips on finding your camera's URL

  1. Try to use ftp to connect to your camera. The username and pass is usually whatever you set up on the web interface of the camera.
  2. Traverse the folders to find your html documents folder.
    Typically, you're looking for a .jpg or .mjpg file to point the Motion Wrapper to.

For example, these are the possible links on an Axis 2100 IP Camera.

/jpg/image.jpg (Works fine using the wrapper)
/mjpg/video.mjpg (Works fine using the wrapper)
/cgi-bin/jpg/image.cgi (I could not get this one working under the wrapper)
/cgi-bin/mjpg/video.cgi (Again, could not get it to work)



Installing an "external" network camera

This section describes how to install an IP camera as a Motion device.

Note: These instructions are for when the camera is plugged into a router on the external network, as opposed to a switch on the internal network. Not ideal, but it is sometimes necessary due to this aforementioned problem.

  1. Install motion wrapper (if it is not installed already).
    In web admin (type "192.168.80.1" in a browser of your choice), click Show devices tree (very bottom of left-hand pane)
    click on CORE and then Create Child Device.
    Then press the Pick device template button, which will open a new window.
    Under "Device Template", select Motion Wrapper and press the Pick device template button.
  2. Plug your camera into the external router. In your router admin page (accessed via 192.168.1.1 in my case) find out what IP was assigned. Type this IP into your browser and have a look through the options. Set the username and password. I also set a static IP just in case it tries to change itself. I also specified the camera's IP on my router so that no other device could take it (belt and braces).
  3. In LMCE web admin ("192.168.80.1" into a browser), go to Wizard -> Devices -> Surveillance Cameras.
    Click the Add Device button at the bottom of the page. This will open a new window.
  4. In the window that just opened, pick Generic Motion IP Camera from the drop-down menu in the Device Template section.
    Press the Pick device template button.
  5. Find the new camera in Wizard -> Devices -> Surveillance Cameras. Change the description to something more obvious if you so wish and select a room.
  6. Change the Path field to match your camera's URL as indicated in the previous section. In my case, I used "http://192.168.1.XXX/videostream.cgi?user=XXXXX&pwd=XXXXXX".
    Do not forget to replace the Xs with the IP, username and password.
    Add "80" to the TCP Port field. Press Save.
  7. Press the Advanced button. Check the IP and MAC address in the "Device Info" section. If it's not the same as the MAC and IP you saw in the camera's utility, change it. Click Save.
  8. Do a Reload & Regen, and that should be it.

This camera can now be used as a motion sensor and/or for recording movement (recordings are stored in "/home/cameras/XX" where XX is the device number of the camera, and last for 5 days I believe). A scenario will hopefully be automatically generated.

Repeat the above procedure for any additional cameras.

Note
The old issue of Motion dying after reloading/restarting the Core has been fixed. It is no longer necessary to restarted it manually by doing a "sudo /etc/init.d/motion restart". This issue has been reported http://svn.linuxmce.org/trac.cgi/ticket/904 & http://svn.linuxmce.org/trac.cgi/ticket/715 You can read about the resolution there if you'd like to.

Very occasionally I have found that the scenarios sometimes require a little bit of tinkering. If there is no image displayed when you click on the scenario, look in Wizard -> Scenarios -> Security scenarios, select the scenario in question, select "Advanced Wizard" in the "Edit scenario using wizard" section, and just check that the number in the "#2 PK_Device (int)" field corresponds with the camera's Device #; if it does not, change it. Reload & Regen.




LinuxMCE compatible IP Cameras

For a list of IP security cameras that have been tested with LinuxMCE, see: