Apple

Where’s Chow? Aperture 3 facial recognition in action.

Thursday, June 3rd, 2010
Where's Chow
I thought this screenshot might amuse. Click the photo to see it at full-size. At the top of the image are photos that include Chow Yun Fat, cropped to just the automatically recognized face. Below a line are photos that Aperture 3 thinks may be the same person. To refine the computer’s idea of what his face looks like and tag more photos with the appropriate name I had to select all Chow Yun Fat photos from the bottom part of the screen and drag them to the top, above the line.

For more info on the facial recognition feature in Aperture 3, check here on Apple’s website.

I have about 16,000 photos in my archive, and though the process isn’t completely automatic, the facial recognition feature made it much more feasible to tag all the people in these photos. Even just the fact that the application can display an entire set of photos cropped and resized to only show faces alone would be a huge help, the fact that Aperture 3 makes decent guesses is a bonus.

Apple’s market cap now exceeds Microsoft’s

Wednesday, May 26th, 2010
If this trend holds, I may have to break out the Windows 7 party favors at my birthday party next week as per my previous blog post on the subject.

Live spreadsheet:

Still studying Cocoa, making progress on iPhone app programming

Tuesday, May 18th, 2010

I’m still working my way through the iPhone application class Stanford put online, specifically the Winter 2010 CS193P course. I’d highly recommend the course for anyone wanting to reinforce their knowledge of object oriented programming concepts, regardless whether they plan to ever write an app for iPhone, iPad, or Mac.

Below is a screenshot of my version of assignment #3 running on my iPhone. Every control on that screen works as expected, it’s pretty neat. Most importantly, I finally understand how and why.

You can find the lecture slide PDFs and other materials on Stanford’s website, and video of each of the class lectures are available as a free podcast in “iTunesU”.

The motorized mixing control surface of the future, on iPad

Saturday, May 15th, 2010

When doing sound mixes, film/video editors often make use of hardware control surfaces like the Mackie Control Universal Pro. Such mixers connect to the editing system via MIDI.
Euphonix Mc Mix
Euphonix’s "MC Mix" hardware control surface. A nice piece of kit, costs $999. It’s a little smaller than the Mackie Universal Controller, a plus in my opinion.
The editor slides the faders on these fancy control surfaces to adjust the volume for each of the edit’s audio tracks during playback. When the editor is not moving the faders, motors built into the control surface move them to match the edit’s pre-existing settings. The automatic movement of the faders can seem a little like something from Poltergeist.

Unfortunately, the motorized movement of these faders can also be noisy, especially the clacking sounds emitted as many faders pop into position at once. This can be distracting when trying to mix a quiet, emotional scene. These controllers are also pretty expensive, starting at about $1000.

Enter the iPad and Saitara Software’s “AC-7 Pro Control Surface”:


(problems with the embedded video above? try this direct link)

The control surface in the video looks very cool to me. It’s silent, can be seen in a dark editing room, appears to function as well as I’d need, and the cost of the app is only $9.99. I’ve played with a friend’s iPad, and know the touch-sensitivity of that screen is accurate and responsive enough that I’d have no problem adjusting several tracks at once with this interface. For those addicted to the feel of hardware faders this might not cut it1, but for me it’d be a big improvement over moving the faders in Final Cut Pro’s “Audio Mixer” window with a mouse. I can’t justify spending $1200 on a set of faders I’d barely touch except a bit towards the end of a project, but $102 ? Hmm.

Ac-7 Pro

Yet another reason to consider an iPad. I wonder how long I’ll hold out? Sigh.

  1. I don’t think this is just a matter of purely subjective preference –one can feel where a hardware fader’s control is in space, and there’s probably a bit of resistance built in so the user can feel when the level has been set at unity without having to look. []
  2. $510 if factoring in the cost of an iPad, which can also be used to access the iPoo social network. []

Let the album art downloads commence

Saturday, May 1st, 2010
I bit the bullet and bought a license for the application “TuneUp”, which is now in the process of going through my entire iTunes Library to fix my track and album names and info as well as download album art for the tracks. It seems to work very well, and a working 20%-off coupon code can be found at the TuneUp developer blog.

Apple’s Market cap to exceed Microsoft’s? Time for a Windows 7 party?

Sunday, April 25th, 2010
Everyone and their uncle seems to be talking about how Apple’s market capitalization1 is close to exceeding that of Microsoft. Apple did pass Microsoft on the S&P 500, but the S&P calculates a company’s value only based on public shares, and over 10% of Microsoft isn’t on the market.

I figured it’d be fun to keep an eye on this little competition. So I threw together the google spreadsheet embedded below. If2 Apple’s market cap exceeds Microsoft’s, the phrase “Bill is still happy.” will change to something more Applelicious, and I’ll copy my former Apple coworker’s idea3 and throw a little party to celebrate the contribution of both companies to the US economy. I’ll use leftover party favors from the Windows 7 party I was selected to host last year and still feel guilty for not having thrown.4

I welcome any suggested changes or additions to the sheet. Enjoy.

Disclaimer: I think Google Spreadsheets are neato. I think stocks are baseball cards, and invest accordingly. Nothing above is meant to be used as stock buying advice, but my brother probably has a 2001 Ichiro Suzuki Rookie Card you could buy.
  1. Market Cap definition from Wikipedia: “Market capitalization/capitalisation (often market cap) is a measurement of size of a business enterprise (corporation) equal to the share price times the number of shares outstanding of a public company.” []
  2. or when :) []
  3. As proof that I was ever acquainted with the man whose startup may be next to rock the S&P, note that I’m just barely visible in the last of the photos in the image gallery on that linked blog post of Sachin’s. []
  4. I didn’t throw my planned Windows 7 party because I was ripped away from my everyday life and transported to Michigan for months to work on a film. it’s the sort of thing that can happen in my business. []

How to use an iPod. A demonstration by Ari and Mirra.

Friday, April 2nd, 2010
1-3
I don’t hear anything. Is this thing on?
3
Ahhhhh. I hear something. Prog rock?


 

iTunes sharing over the internet using Back to my Mac and ssh port forwarding

Monday, February 8th, 2010

I was at work the other week, doing a repetitive task of the sort that provides an opportunity to listen to music. I’d recently purchased an album and had stored it in the iTunes library on my home computer, but had not yet loaded the new songs onto my iPhone. There had to be a way to make iTunes at home share its music to my work computer so that I could listen to the new music. A few internet searches turned up some interesting information as well as a solution.

The crippled feature to be healed and exploited

Apple’s iTunes software has the ability to share selected playlists or entire libraries of music to other computers on a local network running iTunes. This means that if you have a large collection of music on your desktop computer, you can browse and listen to music from its library from a different room, streamed to your laptop. Or if you work in an office, and your coworkers have iTunes running on their machines and set to share, their shared libraries will automatically appear in the left column of iTunes running on your machine and you can play from them. It all works very seamlessly, on a local network. Possibly due to agreements made between apple and the recording industry, the sharing feature only works between computers on a local network, not between computers on the internet at large.

How iTunes sharing works

When a user tells iTunes to enable sharing in that application’s preferences, iTunes advertises that service on port 3689 of the local network using “Bonjour“, the name for Apple’s implementation of the Zeroconf standard. Bonjour is used by iTunes, iPhoto, and other applications to advertise and to find servers on a local network, such as within a home or office.

If a copy of iTunes is running on any other computers that are on the local network, those instances of iTunes will notice the advertisement of an iTunes share on the network, and will display the name of that iTunes share in the left column of the window. The user can then click that shared Library and play songs from it on their computer. The playlists and songs stream over the network from the sharer to the sharee. Unfortunately in my case, iTunes running on my laptop at work couldn’t see the iTunes share served from my computer at home, because my home computer is miles away and not connected to the same local network as my laptop.

Bringing the remote network closer

The following link pointed the way to a solution:1

REMOTE ITUNES SHARING

I recognized a familiar Unix trick in their tip: Port forwarding over a secure shell connection. Of course! If one could make a secure shell connection (abbreviated in the command “ssh”) to a remote computer, one could then do what’s called “port forwarding”, and forward all communications on a port on the remote machine to a port on the local machine. This would transport both the advertisement of the iTunes share and the actual sharing itself from the remote network to the local network. I’d never actually executed port forwarding over ssh before, but I’d heard of it, and between their example and the man page for the ’ssh’ command, it all became clear. The tip first requires that one knows the IP address of the remote computer, and then shows the command to connect to the remote machine, grab any communications on port 3689 (the port used by iTunes sharing), transport it encrypted to the local machine, and repeat it on port 36890 of the local machine. The command looks like this (hover your mouse over any portion of the command to see an explanation of that portion):

$ ssh -fNL *:36890:127.0.0.1:3689 USER@REMOTE-HOST

After that command successfully concludes, the iTunes share on the remote computer will be accessible to computers on the local network, except they won’t be able to see that it’s there. The second command in their document uses OS X’s built-in “dns-sd” command to advertise that there is an iTunes share on port 36890 of the local computer. It is this advertisement that will make the iTunes share appear in the sidebars of any copy of iTunes running on the network:

$ dns-sd -R "Remote iTunes" _daap._tcp local 36890 &

I was confident that this would all work, but for one snag. Like most people, my home computer only has an address on its local network, it doesn’t have its own internet address. The computer is connected to a router. The router has an IP address on the internet and an IP address on the local network and uses what’s called “Network Address Translation” to distribute connections from the outside internet to all the computers on the local network. If I tried to connect to the IP address of my home connection, I’d be connecting to the router, not my home computer with its trove of music. Luckily a solution was within reach.

Locating the remote computer using Back to My Mac

I recently purchased a “MobileMe” subscription, which includes a service called “Back to my Mac“. I’ll let Apple’s marketing folk, who’ve obviously seen Buckaroo Banzai, explain “Back to My Mac” for me:

Wherever you go, there’s your Mac.

Back to My Mac puts any Mac OS X Leopard- or Snow Leopard-based Mac you use within easy reach. MobileMe finds your remote Mac computers over the Internet and displays them in the Finder on the Mac you’re using. So you can connect from anywhere with just a click. Edit and save documents, open applications, and move folders. With Back to My Mac Screen Sharing, you can control your remote Mac as though you’re sitting in front of it.

I have been using the Back to My Mac service to copy files to and from my remote computer from work, and to occasionally take control of my home computer’s screen from work. The service must be punching through the router using port-forwarding and registering a temporary domain name for my home computer which can be accessed from the outside internet. I figured that if I could find out this domain name, it would be worth a try to use it to connect from work to the home computer and set up ssh port forwarding of the iTunes share. A search turned up this article:

10.5: How to use ssh using ‘Back to My Mac’

The writer of that article explains exactly how to determine the Back to My Mac domain name at which one can find their remote computer. When I tried the first method described, it did not work. As it turns out, that method works for short computer names, but my home computer’s name is long, and Back to My Mac truncates it and adds a few random (?) numbers when assigning the domain name. The second method they mention does work. I can easily determine the name assigned to my remote machine by choosing “Shell > New Remote Connection…” in the Terminal application’s menubar. In the “New Remote Connection” window that appears, I choose ’ssh’ in the service column and my remote computer’s name in the ‘Server’ column. There, in the field at the bottom of the New Remote Connection window will appear the command for making a ssh connection to my home computer. It’s not the same ssh connection command that will be used to do port forwarding, but the last portion of it does show me the exact domain name that will resolve to my home computer.

Victory

Whenever I feel the mood, I can now run the following two commands and then sit at work listening to streaming music stored on my home computer:

$ ssh -fNL :36890:127.0.0.1:3689 myComputerName.myMobileMeID.members.mac.com.

$ dns-sd -R "Zach's Remote iTunes FTW" _daap._tcp local 36890 &



Thanks Y’all

Thank yous are due to the writers of:
  1. All the solutions written below involve the use of the Terminal application and the command-line. If you’ve never played with such, give it a shot. Stop kvetching and open /Applications/Utilities/Terminal. You paid for a Unix operating system when you bought your Mac, you might as well try exploring some of its inner awesomeness. []

FCP howto: Use Batch Export to create a directory of still frames from a bin of clips

Wednesday, February 3rd, 2010

If you’ve got a bunch of clips in a Final Cut Pro Browser window, and you’d like to quickly generate a still frame for each clip, you can use the “Still Image” feature of FCP’s ancient “Batch Export” feature to automate much of the process. Here’s how:

Rt Overlays (Ignored By Utest)
1. Choose a representative frame in each clip. (Click any of these images to see them nice and big.

Making Stills From Fcp Step 2
2. Send the clips to FCP’s Batch Export feature and bring up its “Settings” window.

Exporting Stills From Fcp Step 3
3. Choose the destination for the exported files and set Batch Export to create still images.

The result will be a folder full-resolution PNG images, each named after its parent clip, deposited in the chosen destination folder.

I often end up processing directories full of such uncompressed images further using the excellent command-line Imagemagick utilities using the tcsh shell’s1 “foreach” command to iterate through all the images.2 It generally goes a little something like this:

$ tcsh3
% cd directory_of_images4
% foreach foo (*.png)5
foreach? convert -geometry 330x800 "$foo" "$foo:r.jpg"6
foreach? rm "$foo"7
foreach? end8

The result of this command is a set of JPEG-compressed images, one per clip selected in step 2, each resized proportionally to fit within a 330×800 rectangle.

  1. This is also easy to do with OS X’s default bash shell, but I’m more fluent in tcsh. []
  2. You may prefer GraphicConverter, Photoshop, or MS Paint. Imagemagick combined with the command line is mad fast for both image transformations and automatically renaming files. []
  3. Switching to the tcsh for this because I have yet to internalize Bash's foreach syntax. []
  4. If you're unfamiliar with command lines and shells, please note that the "%" character here represents the tcsh command-prompt, the "$" in the previous line represents the typical Bash command-prompt. Don't type these characters in your commands, they're just here for show. []
  5. "foo" is a placeholder of my choosing. There's nothing special about the string "foo". You can replace it with anything you like, such as "image", "placeholder", or "your_mom". Just make sure to use the same string in place of all the "$foo" commands below. []
  6. Each time tcsh iterates through your commands, it will replace the string "$foo" with the filename of an image from the set chosen by "*.png", which is every file in the directory ending in ".png". Adding a ":r" to "$foo" indicates that tcsh should expand the filename but leave off the period and filename extension –in this case "$foo:r.jpg" removes ".png" from the file and adds ".jpg" in its place. The quotes around "$foo" are optional if your filenames do not contain spaces or special characters. []
  7. Removing the original png file because all I ever wanted were the tiny JPEGs. []
  8. One more note from Captain Obvious: If you try to copy and paste any of these commands, be sure not to copy and paste the superscript numbers that lead to these footnotes. []

assistant editor Unix tricks

Monday, January 25th, 2010
It’s time to take apart some Final Cut Pro xml and add some newly received VFX clips to the VFX database. One of these days, I’ll explain all of these steps and how they might be useful in other workflows. For now, enjoy a look at a relaxing vacation from graphical user interfaces and mouse-clicks; A trip to the Terminal. If you have any Unix or XML knowledge, there might be something of interest in here.

Assistant-2:20100125 CAB$ xmlstarlet sel -t -m "//children/clip"\
-v "name" -o "," \
-v "out - in" -o "," -v "in" -o "," -v "out" -o ","\
-v "media/video/track/clipitem/start" -o "," \
-v "media/video/track/clipitem/end" -o ","\
-v "media/video/track/clipitem/file/timecode/frame" -o ","\
-v "media/video/track/clipitem/file/name" -o ","\
-v "media/video/track/clipitem/file/timecode/string" -o ","\
-v "media/video/track/clipitem/file/timecode/reel/name"\
-n 20100123_vfx_received.xml | tee 20100123_vfx_received.csv

52A-2_01_VFX_v1,178,0,178,0,178,,52A-2_01_VFX_v1.mov,,
52A-2_02_VFX_v1,141,0,141,0,141,,52A-2_02_VFX_v1.mov,,
52B-2_01_VFX_v1,152,0,152,0,152,,52B-2_01_VFX_v1.mov,,
53-3A_01_VFX_v4,307,0,307,0,307,,53-3A_01_VFX_v4.mov,,
54-3A_01_VFX_v1,188,0,188,0,188,,54-3A_01_VFX_v1.mov,,
C100_C016_0920LS_03_VFX_v1,102,0,102,0,102,,C100_C016_0920LS_03_VFX_v1.mov,,
C102_C011_0903RU_03_VFX_v1,79,0,79,0,79,,C102_C011_0903RU_03_VFX_v1.mov,,
C102_C011_0903RU_04_VFX_v4,256,0,256,0,256,,C102_C011_0903RU_04_VFX_v4.mov,,
C102_C011_0903RU_05_VFX_v2,200,0,200,0,200,,C102_C011_0903RU_05_VFX_v2.mov,,
C102_C011_0903RU_06_VFX_v2,147,0,147,0,147,,C102_C011_0903RU_06_VFX_v2.mov,,

Assistant-2:20100125 CAB$ cd thumbs/
Assistant-2:thumbs CAB$ tcsh
[Assistant-2:additions/20100125/thumbs] CAB% foreach foo (*.png)
foreach? convert -geometry 330x800 "$foo" "$foo:r.jpg"
foreach? rm "$foo"
foreach? end
[Assistant-2:additions/20100125/thumbs] CAB%

The starting point is a bin of clips in an FCP project. I’ve exported that bin as FCP XML, and have also batch exported the clips inside it as stills (to PNG, the default). The commands above are the meat of the process. Then the comma-separated-value list of clips I generate with the xmlstarlet command gets imported into an openoffice (or Excel) spreadsheet (a step I’ve ommitted here), and is massaged into a csv format for import into a Filemaker Pro database of VFX clips. Finally I import the thumbnails for each clip into the database. Fun stuff, pretty much.