Turn an Old Laptop Into a CCTV Camera

download Turn an Old Laptop Into a CCTV Camera

of 7

Transcript of Turn an Old Laptop Into a CCTV Camera

  • 7/25/2019 Turn an Old Laptop Into a CCTV Camera

    1/7

    Turn an old laptop into a CCTV camera

    Make your own motion-detection system

    Look above the screen of a laptop or netbook, and there's a good chance you'll find a pinhole that

    hides a camera.

    If you're anything like us, you haven't used this camera since last Christmas, when you tried to use

    it to connect to your family in Australia then they had firewall problems and you all gave up.

    e're going to put that neglected camera to use in a surveillance system not the kind used by

    !ene "ackman in The Conversation, but a CC#$ for stuff you'd like to keep an eye on, like the

    garage door or your rare %arry &anilow records.

    e're using one&inder. It runs alongside the Apache webserver, monitoring camera feeds and

    making them available through a web browser, but that's only the start. It can be e(panded into a

    full home security system, complete with offline recording, motion detection and multiple camera

    )ones, all of which can be run from your Linu( laptop or netbook.

    #he first step is to get it working with a single camera the one sitting above your screen.

    Project requirements

    A Linux PC

    *ou can use either a netbook with a built+in Linu(c+ompatible camera or a C with a webcam.

    e've used -buntu ./, but any recent version of Linu( should work fine for this pro0ect.

    A webcam

    If you don't have a netbook or laptop, an e(ternal webcam attached to the C will still do.

  • 7/25/2019 Turn an Old Laptop Into a CCTV Camera

    2/7

    1 Troubles!ootin"

    #he key to a successful one&inder installation is having a working camera before you start.

    one&inder can't troubleshoot video input it can only process what Linu( has already configured.

    #he vast ma0ority of cameras will be set up automatically, either when you install your distribution

    1in the case of a screen's bevel camera2, or when you connect them to the -3% bus. If a camera has

    been detected and a driver installed, the system will create the 4dev4video/ virtual device on your

    filesystem.

    *ou can check for it with the command line or a file manager. *ou might find it has a slightly

    different number, or no number at all, especially on older systems, but to test the camera, you need

    to make sure it's grabbing video data.

    *ou can do this with the !nome application Cheese, although it will need to be installed manually

    on the latest version of -buntu. *ou can use it to take photobooth+like images with the camera and

    add realtime effect to the video without any other configuration, but we prefer the austerity of $LC,

    which also needs to be installed.

    #his can stream video footage directly from the camera 0ust select '5pen capture device' from the

    6ile menu and make sure the video device name is '4dev4video/'.

    If the video works, you can start installing one&inder. If not, you'll need to check your system

    logs 1type dmes"2, but you'll probably have to track down custom firmware and a tool to load it into

    your camera.

    If all else fails, you can use a cheap -3% webcam or look into investing in a I+enabled version.

    6rom $LC, you need to make a note of the settings it's using to play back the video. *ou can seethese by going to '#ools 7 &edia information' and selecting 'Codec details'. &ake a note of the

    resolution and the codec being used you'll need these when we add the camera to $LC.

  • 7/25/2019 Turn an Old Laptop Into a CCTV Camera

    3/7

    # $nstall %oneMinder

    -buntu ./ includes almost up to date packages of one&inder. e recommend installing these

    rather than tracking down the latest packages so you don't have any problems installing further

    dependencies. 8ust search for ')oneminder' in the new -buntu 3oftware Centre and click 'Install'.

    About halfway through the installation will appear to stop, but what's really happened is that a

    re9uester window has appeared behind the 3oftware Centre and is asking for input. 3witch to this

    using the '&inimise window' icon on the top left.

    #he first re9uest is asking for a password for the root &y3:L account. &y3:L is used as the

    database for all the non+video data, and the root password is needed to create a database, and for

    administration.

    *ou'll then be asked for the mailname of your system. *ou can keep this and the following

    9uestions at their default values.

    -nlike the old -buntu package manager, 3ynaptic, it's not always obvious when the 3oftware

    Centre is installing dependencies, but you can check what else was alongside one&inder by

    switching to the '"istory ; Installation' view. *ou should see many packages installed, including

    Apache and "4 sites+enabled4///+default with your favourite te(t editor as an administrator 1try

    preceding it with 'sudo nano' if you don't have one2. Look for ?ocument@oot and change this to

    &usr&s!are&'oneminder, then do the same with ?irectory&(ar&www&7 by changing the&(ar&www

    part.

    e also need to add the user who's running the web services to the group that can access the video

    device. *ou can do this from the command line by typing sudo usermod -a -) (ideo www-data.

  • 7/25/2019 Turn an Old Laptop Into a CCTV Camera

    4/7

    'Video' is the group created by -buntu for accessing the device and 'www-data' is the username

    used by Apache. *ou can check the group has been added correctly by typing sudo id www-data,

    and the output should look something like the following= uid*++,www-data "id*++,www-data

    "roups*++ ,www-data.//,(ideo'.

    Bow type sudo ser(ice 'oneminder restart1tab completion works here2, followed by sudo ser(ice

    apac!e# restart.

    Load http=44localhost into a web browser, and you should see the one&inder web interface.

    + Add a camera

    ?on't be put off by the sparsity of the interface there's plenty of power behind those frugal

    buttons.

    #he first thing we need to do is add our camera to the configuration. Click the 'Add new monitor'

    button. #his will open another small window with five tabs.

    5n the first tab, change the name for the monitor to something descriptive this will help if you

    decide to add any further cameras to your configuration later on. %elow this, keep the source type

    set to 'Internal' and the function set to '&onitor'.

    Bow switch to the second tab, labelled 3ource. In the first field, ?evice ath, enter the address of

    the video device we used earlier. 6or the ma0ority of installations, this is going to be 4dev4video/.

    #he capture method needs to be $ideo for Linu( version > and the device channel is normally /,although this is where we need to take our settings from $LC.

  • 7/25/2019 Turn an Old Laptop Into a CCTV Camera

    5/7

    #he device format should be either AL or B#3C, but if one doesn't work, try the other.

    Choose a capture palette from the menu that best corresponds to the codec used by $LC 1ours was

    *-$>/2 and enter the width and height as the resolution from $LC too. 3ave the settings with the

    button at the bottom of the window and you should see your monitor listed in the main window.

    #he colour of each field in this table is important, and if anything is coloured red, that means it's notworking. #his is most commonly seen in the 3ource column, when an I camera is no longer

    available or you've got the wrong device name in the monitor settings page.

    *ou can check that it's working by clicking its name in the first column. #his will open another

    window containing the video stream from your device.

    / Motion detection

    #he point of a monitoring system like this is that you don't have to waste hours watching footage.

    *ou want to be told if something happens, and one&inder does this by enabling motion detection

    for your monitor.

    #his is hidden in the source configuration page we used before, and can be opened by returning to

    the main table and clicking on your monitor's device in the 3ource column. Look for the 6unction

    menu on the first page. It should read &onitor, and we want to change this to &odetect. 5ther

    options include @ecord and &orecord.

    @ecord uses no motion detection, but records snippets of input at set interval. &orecord is acombination of motion detection and record. &ake sure the Dnabled flag is set.

  • 7/25/2019 Turn an Old Laptop Into a CCTV Camera

    6/7

    ith &odetect set, save the settings. #he colours for that monitor will be different, and the function

    should say &odetect. If you click on the monitor, you'll still see the input from your camera, but

    motion detection is now running.

    6rom now on, if the system detects any significant difference in the video view, it will trigger an

    internal alarm and record the event to a buffer. #ry it with your hand. #he state will change to Alarm

    and an event will be added to the list under the stream.

    hen you click the name of an event here, another window appears, and from this you can play the

    video that was recorded from the buffer before the disturbance to a period of stability afterwards.

    *ou can fast forward, rewind and skip to time slices.

    0 (ent mana"ement

    !oing back to the table view, you'll see that each event is also registered in the

    hour4day4week4month columns, and you can click on the numbers within these to show a filtered list

    of events corresponding to your time scale.

    6rom the event management window, you can choose to archive events, e(port, delete and edit

    them, although the last option is only for adding te(t notes. *ou can also use the 6ilters button to

    specify criteria for events, with a timeline view that can be used to highlight which part of the

    image triggered the event.

  • 7/25/2019 Turn an Old Laptop Into a CCTV Camera

    7/7

    Clicking on the red line of the event will open the playback window. If you want to be informed

    remotely when an event is triggered, open the 5ptions window from the main table view. -nder the

    Dmail page you'll be able to enter your address and server details so that you can be informed as

    soon as something is detected.

    It can also upload the events, along with the video, to an 6# server, which is useful if you want

    things backed up before a burglar finds your laptop.

    6ortunately, now you've created the ultimate e(pandable home CC#$ monitoring system, it will

    never come to that.

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++