CCTV Articles

Using a Jailbroken Apple TV / Roku Player to view your IP Camera

AppleTV2-
As you know, the Apple TV 2 has been Jailbroken for quite a while now and as a geek I often look for ways to pull features from all my electronic devices that will make the device more interesting and get my money’s worth.

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

XBMC Logo

Click the Image cluster below to download XBMC for your device.

XMBC Download Page

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

  1. 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.
  2. 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
  3. 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”
  4. 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:
    Filezilla Screenshot
  5. Navigate to the folder /private/var/mobile/
  6. Transfer the add-on zip file into this folder by dragging and dropping from the left-hand panels, or from an Explorer/Finder window*
  7. In XBMC go to the AddOns manager and choose to “install from zip”
  8. Select the “Home Folder”
  9. 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

chown -R mobile:mobile /private/var/mobile/Library/Preferences/XBMC/userdata

Cyberduck: Download Cyberduck Here

  1. 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.
  2. 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:

    Cyberduck Example

  3. 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.
  4. Navigate to the folder
    /private/var/mobile/
  5. Transfer the add-on zip file into this folder by dragging and dropping from an Explorer/Finder window*.
  6. In XBMC go to the AddOns manager and choose to “install from zip”
  7. Select the “Home Folder”
  8. 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

chown -R mobile:mobile /private/var/mobile/Library/Preferences/XBMC/userdata

On your XBMC Application

  1. Open the XBMC Application and Browse to the System Tab
    XBMC System Tab
  2. Browse to the Add-ons Button
    XBMC Addons
  3. Choose Install from Zip File
    XBMC Install Zip File
  4. Select the “Home Folder”
    XBMC Home Folder
  5. Once you have installed the Zipped Plugin you can browse to the Programs Tab
    XBMC Programs Tab
  6. There you will see the Plugin Called “CCTV Camera Overlay”
    XBMC CCTV Camera Overlay
  7. To add you camera’s information, access the settings menu on the Plugin by pressing the right arrow key on your remote.
    XBMC Addon settings
  8. 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)
    XBMC addons image URL
  9. Then go to Behavior to select your Image size, Interval (minimum 1Sec) and Duration in which the script will be running.
    XBMC Behavior
  10. Here is a screenshot of it working.
    XBMC Screenshot 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.

Correct Settings

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.

XBMC Configure

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/.

http://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.

Leave a Reply