Podcast Producer Commands

At the end of the day, Podcast Producer is a fairly straight forward solution. You have a nice little GUI application that users can use to publish Audio, Video, Screencasts or files to an rss feed. Using that rss feed you can then integrate that data with a number of other solutions, including those I’ve discussed over the last few days. You can also use Podcast Producer to remotely fire up bound cameras and begin Podcast Producer workflows, which means you don’t even need to be at a conference, in a shareholders meeting or in a classroom to capture video from cameras.

But the real power and flexibility to Podcast Producer comes from the ability to programatically interface with the sandbox that Apple has provided in the form of Podcast Producer. Workflows are a collection of actions that run when you submit a podcast. This can include leveraging ruby to integrate complicated workflows or it might even be using the command line interface on clients in your own applications. It all starts with a simple command, podcast. To get started with the podcast command let’s first just list the assets that your computer has at its disposal. These can include workflows, cameras & servers. These can be listed using the –listworkflows, –listcameras & –listservers options respectively.

When you run the list commands you’ll need to authenticate into your Podcast Producer server in order to list the objects that are on the server. To do so, in addition to the list options you’ll also need to provide a –server, –user and –pass option, following each with the correct value for the obvious setting, as you can see here:

podcast –server www.krypted.com –user charles –pass secretpassword
–listcameras

The list options each display objects that are housed on or connected to the Podcast Producer server.  Each laptop that Apple distributes has a camera. You can also plug in most standard cameras and use them with Podcast Producer, assuming that your computer is able to see the video feed on the camera. Once you have a camera installed on the computer you can then “bind” it to a Podcast Producer server, which gives users the ability to remotely stop and start captures.  To bind a camera we’re first going to run the podcast command with the –devices option as follows:

podcast –devices

This will show you all of the devices on your computer capable of being bound to a Podcast Producer server. This is similar to the drop down lists displayed in the Podcast Capture GUI tool.  Once you have the name of the camera that you’d like to bind you will use the podcast command with the appropriately named –bind option to, well, bind the camera to the server.  Again we’ll include the server address and credentials that we are binding the camera to in our command:

podcast –server www.krypted.com –user charles –pass secretpassword –bind ‘0xfd40000005ac8501′

Once you have your camera bound, run the list option again and you can then start capturing a podcast from it by using the –start option followed by the name the server uses to reference that camera.

podcast –server www.krypted.com –user charles –pass secretpassword
–start “ConferenceRoom”

We could also have indicated a –delay value, in seconds, that would have provided us with how long before the camera would start the recording once the signal to do so has been received.  We could also have specified an –audioonly option, which would only record audio.  By default, podcast will use the default audio device indicated in your System Preferences, although you can specify the deviceID from the –devices output to indicate a different audio input source (eg – microphone).

While you are recording, the file will be stored in the /var/pcast/agent/recordings directory.  Once you have started a capture you can then –pause, –resume, –cancel and –stop the camera.  When you –stop the recording, you will also want to include a –metadata option followed by the path to a property list that includes the available metadata for the podcast you are publishing and the –workflow to be assigned to the podcast.

podcast –server www.krypted.com –user charles –pass secretpassword –stop “ConferenceRoom” –metadata ~/ConferenceRoomMeeting10012009_metadata.plist –workflow “Meetings”

The –metadata option and the ability to stop, start and publish into workflows allows for integration with a number of other solutions, including Final Cut Server and various third party capture tools.  These often have the ability to control quality, something you can easily feed back into Podcast Producer using the output from the other tool.  Quality is applied per device connected to a device that is “bound”. Run the podcast command using the –getconfig option to see the quality settings for each device connected to a specific computer:

podcast –getconfig

You can alter the quality for some devices. To start, run the podcast command with the –presets option as follows:

podcast –presets

This is going to go ahead and list all of the preset settings that you can easily use to configure the devices. You can then set the configuration using the –setconfig option to set the preset for a given device, following it with the appropriate key. For example, we’re going to switch from the default format for videos, MPEG4 to using uncompressed video by using the Best video preset instead of the Good video preset:

podcast –setconfig Capture=Video:Best

To then change it back we would use the following command:

podcast –setconfig Capture=Video:Good

Because as quality of recordings and their length increase, you may incur a backlog of recordings waiting to be processed by a server there may be a time when you want to check the status of an upload.  To do so use the –list_uploads option:

podcast –list_uploads

You can also submit files (common when bringing in assets from other solutions) instead of live video recordings:

podcast –server www.krypted.com –user charles –pass secretpassword –submit –file ~/Movies/file.mov –workflow ‘Meetings’ –metadata ~/Desktop/todaysmeetingmetadata.plist

Again, if you’re leveraging podcast as a sort of API and you’re going to be generating this programatically then you’ll also likely push your metadata fields into the appropriate format in the property list that we had on the Desktop, maybe storing it in a temp location instead.  The metadata format is

<?xml version=”1.0″ encoding=”UTF-8″?>

<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>

<plist version=”1.0″>

<dict>

<key>Author</key>

<string>NAME OF AUTHOR</string>

<key>Comment</key>

<string>COMMENTS GO HERE.</string>

<key>Copyright</key>

<string>COPYRIGHT INFO GOES HERE</string>

<key>Description</key>

<string>DESCRIPTION GOES HERE

</string>

<key>Keywords</key>

<string>KEYWORDS OR TAGS GO HERE</string>

<key>Title</key>

<string>TITLE OF PODCAST GOES HERE</string>

</dict>

</plist>

Because the above information is in a standardized format then if you have another solution or a script you can use a tool such as plistbuddy to programatically generate the metadata files from other sources, thus trading metadata between solutions.  For example, a very simplistic way to watch that feed would be using the curl command:

curl http://www.krypted.com/feed

If you’d rather use Podcast Producers engine to work with files offline then you can do so as well.  In the /usr/libexec/podcastproducer directory there are a number of commands that can be used to work with video files, allowing you to do anything that you can do within a Podcast Producer workflow.  Additionally, most of these are wrapped into the pcastaction command in /usr/bin.