MythTV and a Security Camera

I had an old tv capture card that I thought didnt work, turns out only the tuner didnt work.. the composite input worked fine. So i bought a cheap $30 security camera from harbor freight put it on my front porch and hooked it to my myth box.. Ive got it setup pretty well with myth so I thought I would share..

First of all, i have my camera setup to record motion.. I use a free program called ZoneMinder, get it at it works great and I can also watch live images of the cam through its web interface.. so I can also have a little window open up on my computer in my bedroom.

The next task was picture-in-picture, ya I know myth has built in picture and picture for multiple cards but the problem is that it only works when watching tv.. dosent work when listening to music or watching a video file or movie.
so I wrote some scripts so no matter what I am doing I can pull up the camera.

here is what I added to .lircrc so when I press the EAX button my remote it either opens or closes the window.
You will need "irexec" installed.
        prog = irexec
        button = eax
        repeat = 4
        config = /usr/local/bin/

and here is, i'll explain it below



scampid=(`ps aux|grep mplayer|grep geometry|sed s/"mythtv   "//`)
if [ "$scampid" != "" ];then
        kill -9 $scampid
        scampid=(`ps aux|grep mplayer|grep geometry|sed s/"mythtv   "//`)
        kill -9 $scampid
if [ "$scampid" == "" ];then
        mplayer -tv driver=v4l:norm=ntsc:input=1:width=352:height=240 \
        -double -display :0.0 -geometry 100%:0% tv://

that may need edited, what the first line does is very ugly but simple.. you will need to change "mythtv" to the username you run myth under, dont take out any of the remaining white space. Then do the same for the other line like the first one.

Basically what it does is check to see if the security camera window is already open, if so it kills it and exits. If the window is not open it opens a window in the top right corner of the screen tuned into the composite input from my capture card.

Its an ugly hack but it works great for me,
If im listning to music I can instantly open a live feed from my camera without interupting listening to my music.. The same goes for watching video files, tv, dvd's or anything else..

One last tip, you can setup ZoneMinder so it will play a sound when an alarm goes off, I have it setup to play a file that sounds like someone knocking on a door.. The only trick is that it only works on a machine monitoring it via web interface.. so what I do is always keep the window open on my pc in my room since those speakers are always on. So in effect when someone comes walking up to my door I am notified in advance and I can quickly popup a window to see who it is. But wait until you have ZoneMinder tweaked enough that you dont get many if any false alarms.

  • School guard fired for using security camera to watch cheerleaders
  • How IP-based Video Surveillance Works -- Way Beyond Analog
  • X10 to the Rescue! Remote-control Units Help Country's Biggest Student Film Festival
  • Background Statistics
  • Multi-Guard PC - Based Surveillance System Remote Access Demonstration
  • 'Mob rule' at girls' school leads to 40 suspensions
  • Anti-war allies shrug off trade fears
  • IP Camera & IP Speed Dome
  • Caught on cam
  • Big Brother goes for IP security cameras
  • Defense agency found using unsecure WLAN security camera
  • Security Camera Articles