From LinuxMCE wiki
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
To add the Motion Wrapper as a device:
- Open your webadmin control panel
- Under Wizard: Devices > Interfaces
- 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.
- Click on Pick device template. This creates the Interface device and displays it on the configuration page.
- 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.
- 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 templateThere 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
- 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.
- 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.
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
- 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.
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.
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.
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.
- 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.
- 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.
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.
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".
Do not forget to replace the Xs with the IP, username and password.
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.
- 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:
- See articles in the Camera Category