“DropFolders”: AIR 2.0 NativeProcess w/ HandBrake

DropFolders is an upcoming AIR 2.0 Windows-only (for now) application which allows a user to set up multiple presets consisting of watch folders, destination folders, and specific arguments for use in HandBrake. The app then polls the watch folders for new files, builds an internal processing queue, hands each file off to the embedded HandBrake CLI, and moves the new file into it’s proper home (while cleaning up after itself!) when finished.

The application uses some of the really cool APIs exposed through AIR 2.0, including SQLite databases and most importantly the NativeProcess APIs which allow AIR applications to talk with native processes.

Here is a video demonstrating the application in action running on both desktop and a remote server:

The main reason for building this application was to have it run on a server and allow users to transfer files to an exposed shared folder (the watch folder) and not have to worry about encoding and moving files around. It is obviously written to run on the desktop as well- but in case you’d like to set it up on a server, here is how I went about it:

I’m using a Windows Server, so we’ll be setting up our AIR application to run as a Service. That way, it will continue to run and monitor folders even while no one is logged in.

  1. Download Windows Server 2003 Resource Kit Tools
  2. Install WSRT on your server
  3. Open the command prompt and navigate to where you installed the toolkit
  4. Run instsrv DropFolders "C:\{pathToToolkit}\srvany.exe" to create a Service called “DropFolders “
  5. Add the following to your Registry: Run reg ADD HKLM\SYSTEM\CurrentControlSet\Services\DropFolders\Parameters /v Application /d “C:\Program Files\DropFolders\DropFolders.exe” to point the service to the AIR application
  6. I then went into the Service manager to have the thing run with my credentials. Also be sure that the Service will start automatically. You will have to modify based upon your specific environment.
  7. Create whatever system of watch and destination folders you need
  8. Create access to these watch folders through Network Shares or FTP or whatever
  9. Fire up DropFolders and set up your various presets
  10. Close DropFolders, start the Service, and logout
  11. All set!

Once again though; you don’t need to do any of this if running as a normal desktop application. Just install and use.

I’ll be releasing the application onto the AIR Marketplace as soon as AIR 2.0 final goes public.

2 thoughts on ““DropFolders”: AIR 2.0 NativeProcess w/ HandBrake”

  1. Pingback: My work with Adobe AIR 2.0 NativeProcess gets a mention on RIARadio! « In Flagrante Delicto!

Leave a Comment

Your email address will not be published. Required fields are marked *