Content - Creating the SecuritySpy Podcast
 
In our article on adding SecuritySpy content to your iTunes media server we mentioned the use of a custom Podcast imported into iTunes to provide access to the live video streams captured by SecuritySpy.  This article provides a step-by-step process for creating the Podcast XML file.

Requirements:
To get started we’ll assume you’ve already setup SecuritySpy to access video from one or more cameras.  You’ll also need a text editor handy - TextEdit will do the job but we prefer BBEdit from BareBones Software.

To serve the Podcast.xml file to iTunes you’ll need a webserver.  It doesn’t matter if the webserver is on your local network (for instance Personal Web Sharing) or on the internet (for instance hosted on .Mac).  For this tutorial we’ll assume you’re using Personal Web Sharing and storing the files in your home directory Sites folder (ie /Users/yourusername/Sites).

Step 1 - Configure Security Spy
The serving of video content to be displayed on your media clients is handled by SecuritySpy, so you’ll need to open SecuritySpy on your camera server to do the initial configuration.  The video serving functions in SecuritySpy are accessed through the ‘Broadcasts’ option, which you’ll find in the ‘Window’ menu.

 From the Broadcasts dialog, click ‘Add...’ to create a new Broadcast.

Specify the camera you wish to broadcast.

Choose the video codec and quality of the broadcast stream.  If you’ve got a fairly decent Mac as your SecuritySpy server you can probably make use of H.264 as the codec, but on my older G4 I find that MPEG-4 Video provides the best compromise between video quality and processor requirements on the server.

Choose a Broadcast method.  If you’re just broadcasting over a LAN you’re best off using Multicast as it reduces load on the server.  If you’re broadcasting to remote clients (or over a VPN) you may need to use Unicast and specify the IP address of your client.  Note that you’d need to create a separate broadcast for each potential client under this method.

At this point you should have settings that look roughly like the image below, with separate entries for each of the cameras you wish to access from your media clients:






















2. Create The Streaming ‘Movie’

In order to access the video streams from within iTunes you’re going to need to create a ‘Movie’ file pointing to the Broadcast that iTunes can import.  Thankfully SecuritySpy makes this task easy with the ‘Create SDP File...’ option.  Simply use this to create an SDP file for each of your camera broadcasts, being sure however to rename the file with a ‘.mov’ extension rather than ‘.sdp’.

At this point you can test that your cameras are streaming correctly by opening the .mov files you just created using Quicktime on any of your client machines (or even the server itself).  If all is working correctly Quicktime will connect to the camera stream much like any other streaming video source (Stevenote anyone?).

In order to continue to the next step, you’ll finally need to copy the working .mov files into your webserver directory.

3. Create the Podcast XML File

Now that we’ve got a .mov file that points to our camera streams, we can create a Podcast XML file that can be imported by iTunes as a valid Podcast.  Note

The easiest way to do this is to create a new file called Podcast.xml, open it in your preferred text editor and copy the sections of text below:

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<title>___YOUR_SECURITY_CAMERAS____</title>
<link>http://___URL_OF_PODCAST_XML_FILE___</link>
<description>Security Cameras via SecuritySpy.</description>
<generator>iWeb 1.1.2</generator>
<ttl>60</ttl>
<itunes:subtitle>Security Cameras via SecuritySpy.</itunes:subtitle>
<itunes:summary>Security Cameras via SecuritySpy.</itunes:summary>

Replace the content in the <title></title> section with the name of your Podcast (how the link will appear in FrontRow), and the <link></link> section with the URL of your Podcast XML file.  If you’re just using Personal Web Sharing the URL should be something like http://your.server.address/~yourusername/Podcast.xml.

Next paste the following code for each camera you wish to access from the Podcast:

<item>
<title>___YOUR_CAMERA_NAME___</title>
<link>http://www.buildamediaserver.com</link>
<guid>http://www.buildamediaserver.com</guid>
<pubDate>Wed, 19 Jun 2007 18:20:00 +1100</pubDate>
<description>&lt;a href="http://___URL_OF_PODCAST_XML_FILE___"&gt;___YOUR_CAMERA_NAME___&lt;/a&gt;</description>
<enclosure url="http://___URL_OF_PODCAST_XML_FILE___" length="919" type="video/quicktime"/>
<itunes:duration>994:12:19</itunes:duration>
<itunes:subtitle>___YOUR_CAMERA_NAME___</itunes:subtitle>
<itunes:summary>___YOUR_CAMERA_NAME___</itunes:summary>
</item>

Change the ___YOUR_CAMERA_NAME___ sections to the name of your camera (again, this is what will appear in FrontRow).  Change ___URL_OF_PODCAST_XML_FILE___ to the URL of the .mov file for this camera (again, if you’re using Personal Web Sharing this will be your.server.address/~yourusername/cameraName.mov).

Repeat the <item></item> code for as many cameras as you have configured in SecuritySpy.

Finally, conclude the Podcast.xml file with the following code:

</channel>
</rss>
You should now have a webserver directory that contains the completed Podcast.xml file plus a separate cameraName.mov file for each camera you wish to access.

4. Import Into iTunes

Now that the Podcast XML file is complete, you’re ready to import the podcast into iTunes.  Depending on how you want to access the cameras from within FrontRow you can either subscribe to the Podcast on your iTunes server (so the Podcasts will appear under Videos > Shared Videos > your Server > Podcasts in FrontRow) or on each individual client (Videos > Podcasts in FrontRow).

From within iTunes, select ‘Subscribe to Podcast’ from the ‘Advanced’ menu, and enter the URL of the Podcast.xml file on your webserver:



If all goes well, you should see your cameras appear in iTunes as a new Podcast:



 5. Test The Cameras!

Assuming nothing has gone wrong so far (and we haven’t buggered up the instructions), you should be able to select any of the Podcast ‘chapters’ representing one of your security cameras and see the camera stream start playing within iTunes.  Once that works, you should be able to select the Podcast from within FrontRow and have the cameras play back on your media clients.http://www.itunes.com/dtds/podcast-1.0.dtdhttp://your.server.address/~yourusername/Podcast.xmlhttp://www.buildamediaserver.comhttp://www.buildamediaserver.comshapeimage_1_link_0shapeimage_1_link_1shapeimage_1_link_2shapeimage_1_link_3
Build A Media Server: How-Tos
Last Updated 20 June 2007