I recently came across a plug-in for the XMBC Application to view CCTV cameras for an automated system that will take snapshots every five to ten seconds every time someone rings the doorbell. So, I thought to myself if I can take this and modify the code enough for it to work with my IP Camera, it would be AWESOME!
I use XBMC to watch my local media as well as other feeds such as AnimeFTW. After doing some research and learning how the code is built with Python, I took the task of reading over every line of code. I have little knowledge about this programing language but like everything else, I love to learn new things and challenge myself. I added and modified the code to work with the Surveillance equipment that we sell here at SecurityCameraKing.com.
After I modified the code, I found myself having an issue with the Interval code, as it was creating an issue when trying to display the image. I fixed this issue and called it Version.2 😉 (Bug Fixed!)
I also noticed that the original coding took only snap shots and display them at a minimum of five to six seconds. Again, I ended up messing everything up. Bummer! I had to start from scratch but this gave me another idea. I can try this again and see if i can also do the same with the video feed from the camera. I went ahead, fixed the issue, and noticed that no matter how small the number for the Interval I could not go under three to four seconds. It would display the same rate so I left it at three seconds.
Plug-in was successful AND operational!
Here is how you would add your information to work with our Surveillance equipment. Of course you need to have your Apple TV 2 Already jail-broken; you can use Season Pass to do this they have a great tutorial. If you have not jail-broken your Apple TV 2, please do so and come back here.
The Equipment I am using is the 1.3 Megapixel Dome IP Camera from SecurityCameraKing.com
And of course XBMC Frodo V12.2
Click the Image cluster below to download XBMC for your device.
If you do not already use an FTP/SSH program, you can download to your Computer either Filezilla (Windows) or Cyberduck (Macintosh)
Filezilla: Download FileZilla Here
- Find and make a note of your ATV2’s IP address. You can find this by exiting XBMC, and in the normal ATV2 menu go to Settings > General > About. Then look for “IP Address” and use the numbers listed there. It will be something like 192.168.1.3, or something similar that has 4 groups of numbers.
- Open the FileZilla client and input the following information into the boxes near the top of the FileZilla window:
- Host: enter the IP address of your ATV2 (e.g. 192.168.1.3)
- Username: mobile
- Password: alpine (this is the default. If you changed the password then enter whatever you changed it to)
- Port: 22
- Hit the “Quick Connect” button. If a dialogue box pops up which states that “The server’s host key is unknown,” just check the box next to “Always trust this host, add this key to the cache”, and then click “OK”
- The files and folders on your ATV2 should now be listed in the “Remote site” frames on the right-hand side. The frames on the left-hand side contain the files, folders, and drives on the computer you are working from. It should look like this:
- Navigate to the folder /private/var/mobile/
- Transfer the add-on zip file into this folder by dragging and dropping from the left-hand panels, or from an Explorer/Finder window*
- In XBMC go to the AddOns manager and choose to “install from zip”
- Select the “Home Folder”
- Find and select the zip file you want to install
* NOTE: if you find, in step 6, that you cannot upload the file, try logging in again using the username “root”. After you have completed the transfer SSH into your ATV2 (UN: root, PW: alpine) and run the following command to restore file permissions
Cyberduck: Download Cyberduck Here
- Find and make a note of your ATV2’s IP address. You can find this by exiting XBMC, and in the normal ATV2 menu go to Settings > General > About. Then look for “IP Address” and use the numbers listed there. It will be something like 192.168.1.3, or something similar that has 4 groups of numbers.
- Open Cyberduck and click on the “Open Connection” button in the top-left corner of the window. Enter the following information into the relevant boxes, and then click the “Connect” button.
- Drop down menu: select “SFTP (SSH File Transfer Protocol)” from the list.
- Server: enter the IP address of your ATV2 (e.g. 192.168.1.3)
- Username: mobile
- Password: alpine (this is the default, if you’ve changed the password then enter whatever you changed it to)
- example:
- If a dialogue box pops up stating “unknown host key for [IP address],” then check the box next to “Always”, and then click the “Allow” button.
- Navigate to the folder
/private/var/mobile/ - Transfer the add-on zip file into this folder by dragging and dropping from an Explorer/Finder window*.
- In XBMC go to the AddOns manager and choose to “install from zip”
- Select the “Home Folder”
- Find and select the zip file you want to install
* NOTE: if you find, in step 5, that you cannot upload the file, try logging in again using the username “root”. After you have completed the transfer SSH into your ATV2 (UN: root, PW: alpine) and run the following command to restore file permissions
On your XBMC Application
- Open the XBMC Application and Browse to the System Tab
- Browse to the Add-ons Button
- Choose Install from Zip File
- Select the “Home Folder”
- Once you have installed the Zipped Plugin you can browse to the Programs Tab
- There you will see the Plugin Called “CCTV Camera Overlay”
- To add you camera’s information, access the settings menu on the Plugin by pressing the right arrow key on your remote.
- In the URL Pane use the following code
http://xx.xx.xx.xx:9989/onvif/media_service/snapshot?channel=0&subtype=0
(The xx.xx.x.xx is your IP. Leave the Username / Password Blank)
- Then go to Behavior to select your Image size, Interval (minimum 1Sec) and Duration in which the script will be running.
- Here is a screenshot of it working.
If you experience any issues, make sure your IP Is correct and do the following:
Go into your IP Camera’s WEB GUI and go to Setup, then on the left you will see Camera. Click on the arrow to reveal your Camera Settings then select Video and finally Snapshot
Below you will see the correct settings.
* Note: the Interval if changed here has to match the settings on the Plugin.
Voila! You can recall your camera with this plugin while you are using your XBMC App in your Apple TV or any device that XBMC is compatible with.
If you would like to see a video demonstration on the exact steps I have detailed above, click on the video below
After I went through all this hassle, I was not convinced from just having 3-second snapshots and feeling as if i was in the old days watching a cartoon reel – in this case a really slow cartoon reel. So once again i did some research and started with the RTSP feed the can be utilized to stream the video from a camera. I tried many plugins that were already out there that claim to do this, at least to handle the video format. It struck me I can just simply try something simple. This was the first thing I thought but I wanted a Plugin. It is as simple as this code here
rtsp://xx.xx.xx.xx:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
Where the xx.xx.xx.xx is your Camera’s IP Address. I went ahead and did the following: I created a file using notepad with the following code inside of it and named it camview.strm. I uploaded the file to my Apple TV using the same method as before, then you would go to Video Tab and choose the file and a soon as the XBMC app recognized the stream it showed up on the screen and it even let me surf for other content while playing the camera feed in the background.
As I was creating the streaming file for the XMBC, I wondered if i could make it even easier for everyone. I went and teamed up with one of our Web Developers, Damon Delcoro, and we built a Generator that will get you both the .RTSP File and the .STRM file. The .STRM is for your XBMC application or Plex and the .RTSP is for Applications such as Quicktime Player and any player or service that will utilize this format, this will also help many people that are trying to stream their IP Camera to services like http://www.ivideon.com/.
https://www.securitycameraking.com/calculator-rtsp-generator.html
I also spent most of my Sunday writing code for an app so that our customers could accomplish this in their Roku Boxes. After I was 60% done with everything I was able to upload and view a camera but still had some bugs and while I was researching to fix all of these I came across a forum where someone had already started this before, I tried to find that code with no luck. The developer sent me a PM and pointed out he had already finished the Application and that was the reason the code was no longer out there. It was in the Public Side of the Roku apps and not in the Private. He pointed out that he had two different apps: one for Screenshots and another that would save up to 64 IP Camera Addresses, same as what i had found out for the XBMC Plugin. The Application is called WebCam One and WebCam One Plus. The WebCam Plus Application will not support live video, but does add a Web interface for entering cam addresses.
Credit Goes to everyone that gave me Ideas such as looking into the Roku Player, and Damon Delcoro for taking his time to not only build this generator, but making it user friendly.