Archive for December, 2007

command-line batch processing of clips with Shake

Thursday, December 13th, 2007
This post is going to be very geeky, and is probably only relevant for those of you who do any film editing or VFX work.

Today I needed to process a few clips with Shake to convert their colorspace from Panalog to linear. Rather than just do a bunch of pointing and clicking in the Shake gui to process each clip, I figured it might be worthwhile to spend a little bit of time scripting now to save a lot of time and finger joint wear and tear later.

I wanted my script to process any clip thrown at it, and to render out the result as a 1920×1080 Apple Prores 422 QuickTime file at 23.98fps. The script would append “_PL” to the filename before the extension to indicate that a panalog conversion had been done, so if the original file was A38.mov, the resulting file after running the command “myscript.sh A38.mov” would be “A38_PL.mov”.

I typed “shake -help |& less” to browse through Shake’s available command line arguments, and to find out how to address the “panalog4lin” macro I would be using to do the conversion.

There were two problems that made this a not-so-straightforward task. The first was that there is no way that I can find to tell Shake what kind of QuickTime file you’d like it to write (most professional users likely have it write out individual Cineon or DPX files for each frame, which would have been a simpler solution but didn’t fit our workflow). I found in the manual how to set Shake’s default QuickTime format, and set it to ProRes 422 1920×1080 in a .h file. The second problem was that Shake only renders out one frame by default unless you tell it the time range you’d like it to render. My script would have to know the duration of a clip to process all of its frames. Luckily I could use Shake’s “-info” flag to determine the duration of a clip.

Here’s the script (looks pretty simple eh?):

#!/bin/tcsh
set duration = `shake "$1" -info |& grep "Duration" | cut -d ":" -f 3`
shake -fi "$1" -t $duration -panalog4lin 1 1 -fps 23.98 -fo "$1:r_PL.mov"

I wanted to apply the conversion to all of the clips whose name contained the string “AT”, so I typed the following at the tcsh prompt:

% foreach foo (*AT*)
foreach? echo "processing $foo"
foreach? myscript.sh "$foo"
foreach? end

I walked away, ates some food, came back, and a set of clips that had been converted to linear space were sitting there waiting for me. Excellent!

Technorati Tags: , , , , , ,

Charge/run an iPod from an extra cell phone battery?

Tuesday, December 11th, 2007
I have an extra cell phone battery or two lying around, and have occasionally been on long flights that would have felt less long if my iPod could have played a few extra hours of video. I’ve noticed there are some commercially available devices that can charge an iPhone for sale on the net, but they are either expensive or are a little bulky due to their use of AA batteries. Wouldn’t it be cool if I could just use small, high-capacity, and cheaply available lithium ion batteries to act as an emergency battery pack for my iPod and other devices that charge over USB?

I’m in the process of thinking this through, and my knowledge of electronics is rudimentary. Here’s my current line of thought:

  1. Whereas, iPods charge from a USB port, and
  2. Whereas, USB provides 5V at 100mA (up to a max of 500mA, thus saith maxim in APPLICATION NOTE 3241 Charging Batteries Using USB Power), and
  3. Whereas, my extra treo battery provides 3.6V (at ?mA), and
  4. Whereas, many auto USB chargers for iPod currently on the market do not work with iPhones,
  5. Now, Therefore, I would likely need to step-up the voltage from my Treo battery, and hopefully get sufficient amperage out of it. I do not know the reason that many chargers on the market do not work for the iPhone/Ipod Touch, but it does look as though other folk have figured it out. I’m going to pore over those ladyada forum postings and try to understand their fix for the problem before I try to build my own adapter.

Anyways, a fun project to think about. I’m at the thinking stage now, will write more if I actually take any action on this.

Overheard in Los Angeles

Saturday, December 8th, 2007
Actress in café, happily greeting a friend: You look different
LA Metro-dandy: Oh, I’m wearing colored contacts and fake glasses.

Overheard by1 Zach at Jennifer’s Coffee Connection, Studio City.

  1. title and format are references to the great site, www.overheardinnewyork.com []

note to Survivor: Sprint phones are unusable in China, nice try

Friday, December 7th, 2007
In the last episode of survivor, Denise, a school lunch lady from Massachusetts, won a reward challenge. After 31 days in the wilderness, she got to visit with her husband, have a nice meal, disgust him with her smell, and win a special prize. Host Jeff Probst announced her additional prize, a Sprint phone, with such rhapsodizing about the quality of the Sprint phone network that he likely needed to wash afterwards. Later, Denise could be seen on a boat, eating chocolate cake with her husband and the 2 other contestants she was allowed to bring along. Mid-bite, the phone rang with a call from Denise’s son|daughter. I call B.S.

Why B.S.? Because Sprint phones are completely unusable in China. Until last year, all phones in China used GSM networks. Sprint’s network uses the other major type of cell phone network, CDMA. China Mobile has relatively recently rolled out a CDMA network, but I’d be shocked if it were compatible with Sprint phones, and even if it were, Sprint would need to have an agreement with China Mobile in order for a Sprint phone to be able to roam in China. I suspect that, after showing the Sprint phone with its prominent logo and plugging the network, they swapped the phone for a GSM model with a Chinese SIM card. Maybe the fact that nothing is exactly as it seems. On TV, even on a “reality” show, is no big revelation, but I found the silliness of pushing a phone that is unusable in China, in China, to be amusing.