Video

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: , , , , , ,

Random Friday links – LOLCat bible, Michael Chabon novel, and a beauty trumpeting Star Wars

Saturday, October 13th, 2007

Exodus 20:7
7. U sez Ceiling Cat bad, I shoot yous wit mah lazer eyes, for I dun liek it. Srsly.
  • A collective of crazy cats on the net have been translating the bible into LOLCat. I’m not mentioning this because it’s all that amusing in content, but because it’s amusing to me that such a thing even exists at all. The LOLCat meme just goes on and on.
  • I decided to buy a copy of the latest Michael Chabon novel, “The Yiddish Policemen’s Union: A Novel”, after reading this interview with the author. A noirish detective novel set in a Yiddish-speaking Jewish homeland in Sitka Alaska. What’s not to like?
  • Beauty pageant contestant Stacy Hedger better have won the talent competition for her exciting dance and stirring rendition of the Star Wars theme on trumpet. See below for evidence of just how much the 80s rocked.

The 10,062

Sunday, August 26th, 2007
Today I captured the last of the footage from the film’s 402 HDCam SR tapes, all shot on the Panavision Genesis camera. The total number of clips I’ve logged and captured 1 for this film: 10,062. That’s got to be some kind of record.
  1. If you don’t know what this post means, what a Genesis is, etc, don’t worry. This post is just a brief bit of gloating. I’ll cover some of the details later. ↩︎

The New Yorker animated cartoons

Sunday, March 25th, 2007

I’m a little disappointed with the New Yorker animated cartoons.

It’s a good idea from a business perspective, twitchily animating short print cartoons and then sticking an ad on the end can’t be a terribly expensive process but could bring in decent revenue.

But after watching a couple of cartoons and not laughing or even smiling, I realized that for me, much of the fun of the New Yorker cartoons (and all other one-panel comics) is that I can scan my attention across them in whatever way and at whatever speed I want and the dialogues and images work together in an organic fashion. These animated versions are very directed, the camera pans across and zooms in on important details to bludgeon the viewer with bits of the drawing that only seem funny to me when I read the cartoon at my own speed in a random-access fashion.

You can see one of the New Yorker Animated Cartoons here.

I’m easily annoyed by musical choices, so I also take issue with the annoying “jazzy” upright bass plucking that opens each cartoon. It’s so smooth and “sophisticated” and makes me imagine an old psychoanalyst dude (albedo 0.60) sitting back in a chaise lounge with a meerschaum pipe watching “expletive-free comedy at the improv in front of a bare brick wall” on A&E. It’s not that it says all the wrong things –it’s probably perfect for their intended audience, it just happens to irritate me, and will continue to do so at least until I slip well out of the 18-34 age bracket. Take some risks with the animation and music, people!

They should get Mr. Odd Todd to try his hand at animating a few of these. Actually, they should have a different internet animator score and animate a different New Yorker cartoon each week, that would be interesting. Cutting the opening credits and opening music down to a glitchy single second would also be a worthwhile move. Credits should not be 20% the length of the total animation.

Speaking of The New Yorker. They have a cartoon caption contest that is pretty amusing (and I’ve entered a couple of times). Radosh.net in response created “The New Yorker Cartoon Anti-Caption Contest“, which asks visitors to come up with the worst possible caption (just not funny, or missing the point) for a given New Yorker cartoon. Pretty brilliant idea. Here’s the winner from the first, Oct 31, 2005 contest:

a truck on stage
“There is a man pinned under this truck who requires immediate medical assistance. Someone please call for an ambulance. Please, before it’s too late.” —Pareene

Kudos to the New Yorker for not crushing the anti-caption contest like a little bug. Looks like there’ve been 91 contests so far without one cease-and-desist letter.

Streaming Media Sucks Donkey Plasma

Tuesday, March 20th, 2007

Net connections are not good from Beijing. How not good? So not good that whenever I try to watch any streaming media clip, such as anything on youtube, the New York Times, Salon.com’s Video Dog, the embedded video clips on Robert Scoble’s blog, etc; On any of these I can only see a few seconds of video at a time with long stretches of still frames while reading text that says “Buffering 6%”, “Buffering 11%”, “Buffering 14%”, etc.

Salon.com’s flash-based media player is the worst of the lot. With many streaming media players, if I get tired of watching the video in 2 second bursts, I can just walk away and read the latest Harry Potter novel, then return, rewind the clip, and watch the now-fully-buffered clip in its entirety. The player for Salon.com’s video dog, if left alone for a bit, apparently erases its buffer and jumps back to the beginning of the clip. Thus, unless I’m prepared to sit there and monitor the buffering of the clip and hit the rewind and play buttons during the window of opportunity, I do not get to see the clip at all.

Speaking of streaming media, “goodbye and good luck” to Calvert DeForest (AKA Larry “Bud” Melman), we hardly knew ye

The existence of this clip illustrates the value of the common archive that occurs when ordinary people are given the ability to record and preserve media, hooray for VHS.

I believe there are reasons to provide streaming media, which I’ll explain below, but any instance of streaming media on a web page should always be accompanied by a link that users can click to download the video as a file.

I wrote to Salon.com a year ago, asking if they would please make their video files available for download, not just as streams. They responded that this was not possible because the videos contain bits of copyrighted media. This is an unnecessary and particularly gutless bit of rationalization. Salon.com is a publication and can easily justify its redistribution of these excerpts of tv shows as commentary, protected as “fair use” under U.S. copyright law. Their stance is both gutless and bizarre –in what way is providing media on which you do not own the copyright any better when provided as a stream rather than a file? I guess we’ll find out for sure if YouTube tries the “but we only provide streaming media” defense in the billion dollar Viacom vs. YouTube lawsuit.

Ranting aside, I admit there is one very good reason to use streaming media on a site. With a good net conection, playback of streaming media starts instantly and requires no download. Not only does playback of streaming media begin just after the user clicks the media, but the better streaming servers (QuickTime, Windows Media) can adjust the bandwidth of the video to match the user’s net speed. It is of course, also possible for playback of certain kinds of downloaded files to begin immediately (QuickTime files), but not with the same level of bandwidth control.

But another reason to use streaming media is dumb and evil. The logic probably goes something like this

If I, the company hosting the video, provide a file to users as a stream and not as a download, then the user can’t keep the file and do nefarious things with it. Thus I keep the level of control I desperately need over the media and its distribution.

Dumb dumb dumb. This begins with the assumption that people who plan to watch the video you provide have criminal intentions that can be thwarted by not providing them with an actual video file. It’s that kind of lack of trust that leads to unnecessary technological stumbling blocks that just make things more difficult for ordinary non-criminal users. And the stumbling blocks are annoying rather than effective –the desired level of control over a stream is barely possible (for the moment it’s possible to surreptitiously download video files from YouTube and some other streaming flash sites, and I am grateful, because otherwise I would never be able to watch these videos).

So while it’s great that users are putting more and more video online, it is unfortunate that much of this video is available only as streaming media, which us reasonably law abiding users can’t put on an ipod, and can only watch in excruciatingly low quality (due to streaming servers’ bandwidth control features) on sub-amazing net connections if at all.

On the bright side, due to the popularity of the iPod and other mp4 video devices (I’m trying to not be a total Apple partisan here), plus the fact that Apple put podcasting features and a free and easy to use podcast directory into their ubiquitous iTunes software (gotta give ’em huge props for that), downloadable video files are becoming much more common. I found a video podcast of the aforementioned Scoble show in the iTunes Music Store’s podcast directory. These are downloadable mp4 versions of the same video clips I could not watch as inline streaming flash video on the Scobleizer blog. The New York Times also puts many of its video clips online in a series of video podcasts, though they inexplicably miss the ones I’d actually like to watch, like the video about Chinese adoptee Cece Nealon-Shapiro’s bat mitzvah, which is only available as a stream.

Everything I’ve said above also applies to audio streams. The Recidivism blog republished NPR’s great Fresh Air interview with Sacha Baron Cohen as an mp3 file. Previously it was available only from NPR’s site as a stream and as that blogger says “Streams are completely useless when I’m trying to use my device (acrylic push-button model) in the car”. A comment on that blog post mentions that NPR has taken the audio stream down, so the existence of this user-hosted mp3 file may be the only way to hear the interview. This is a great example of two reasons why such files should be available for download rather than just as streams: users should be able to listen to such audio clips on the device of their choosing, and interesting files can have more staying power if they are not only hosted as streams that might be taken down at any moment. Imagine the photographic evidence of history that would be lost if all daguerrotypes had only been available for viewing in one building, which then burned to the ground.

China From the Inside

Thursday, January 11th, 2007

I would love to see this new 4-hour documentary about China made for Granada-KQED-PBS-BBC entitled China From the Inside.

From the article:

The footage is vast. Cameras traveled to Tibet; Xinjiang, home to many Muslims; the Kazakhstan border; the Gobi Desert; and the Yangtze River. There are interviews with women activists trying to instill self-confidence among rural women (to try to help stave off a high suicide rate); a National People’s Congress delegate comparing communism with U.S. democracy; a Catholic priest practicing religion in an atheist country; and residents who’ve been displaced by the gargantuan construction of the Three Gorges Dam.
…an environmental activist talks about the polluted Huai River, its cancer-inducing contaminants ravaging the lives of villagers whose photos he displays. In the segment about women, a factory worker in Guangdong Province talking about her day-to-day life: Working the assembly line and prohibited from talking between 6:08 a.m. and 6:08 p.m.

It’s no surprise that the Chinese government was a little concerned about the making of this documentary, but it sounds as though the government minders assigned to this project deserve much respect for making excuses and leaving the set when sensitive topics were being covered. The fact that the documentary’s director had previously made a 4-part documentary entitled “Hell in the Pacific” about the Nanjing massacre by the Japanese probably helped him get reasonably free access to cover sensitive locations, people, and topics.

Thanks to <shamus> for the link.

Not every film featuring puppets is for kids

Monday, September 11th, 2006
a shelf of videos in a Beijing DVD storeAmerica, F@#! Yeah!

I am fairly certain that the film Team America: World Police, which features tons of puppet violence and sex, should never be placed on the Children’s shelf at a video store. However, nobody listens to me here.

I’ve seen this video on the children’s shelf in two different video stores now, so it’s no anomaly. Either Chinese video store employees are making a point of not watching the film, or they have very different standards for what constitutes an acceptable level of beheadings and scatological references in films for children.

Battlestar to Beijing

Thursday, July 6th, 2006
the in-flight map showed that we were passing awfully close to North KoreaMy wish to travel as close as possible to newly missile-riffic North Korea was finally granted.

I had a great time in Minneapolis, and then flew from Minneapolis to Detroit, Detroit to Tokyo, and Tokyo to Beijing. That was the longest period of time I’ve ever spent in the air, and it really wasn’t too bad. I did have to face the dreaded 747 bathroom sink a couple of times, and my computer ran out of battery while I watched a DVD on the longest leg of the flight, forcing me to switch to studying Chinese from a book, but otherwise everything was pleasant, and I needed to study.

The last leg, from Tokyo to Beijing, was on a nice new Airbus A330. This plane featured LCD TVs above and 75W power outlets below every seat. My laptop has an 85W power supply, so in order to power the computer from the plane I had to remove the laptop’s battery (this cuts out the charging circuitry so the computer draws less power from the outlet). In this manner I was able to watch another two episodes of Battlestar Galactica season 2, which is an amazing show.

an image from Battlestar Galactica

A digression is due here to discuss Battlestar Galactica, in case you’ve never heard of it. BG is a new rendition of an 70’s sci-fi TV show, and it airs on the SciFi channel. Rather than push mere nostalgia and kitsch, the creators of the new Battlestar Galactica threw out everything from the old show besides some character and ship names and basic plot elements, and created something new, intelligent, and exciting. It is fun to contrast the new BG with the Star Trek universe –as opposed to the utopian vision espoused by Star Trek, BG feels to have been cut from the real world. Its characters come from a poly-theistic society with many imperfections rather than a perfectly fair “Federation”. There are characters with petty personal issues, depression, commanding officers with drinking problems, terrorists, prisoners, narcissistic science officers, and many characters simply behaving badly. The writers put these folk in impossibly tight situations and the ensuing chaos is delicious. The episodes I just finished watching, entitled “Pegasus” and “Resurrection Ship (Part 1 & 2)” were particularly outstanding. I like the show so much I don’t begrudge the writers for veering into to Philip K. Dick territory with some themes and characters, since frankly they do Dick much better than any film that has been based on actual Dick novels.

Congrats are due to the BG team for their 3 emmy nominations. This show has some of the best writing and one of the best ensemble casts on TV, so I’m a little surprised they didn’t receive any writing, casting, directing, or editing nominations, but nominations in 3 technical categories is nothing to sneeze at.

I don’t think this DVD jacket summary will help sales

Friday, May 26th, 2006
The front cover of a pirate DVD of Wim Wenders Land of PlentyThe front cover.

DVD pirates in China generally put out a decent quality product, at least when they’re copying a DVD that is already on the market. But the English text and credits on the jacket are an afterthought. Nearly always the summary text on the back of the DVD will contain typos, or will refer to the wrong movie, or will be the right text but will simply end in the middle of a paragraph. All of these errors are smile-worthy. But today I was at a music store and saw a DVD of a 2004 Wim Wenders film for sale, and I couldn’t help but laugh and laugh as I read the summary text. I shot photos of the front and back of the packaging, click either thumbnail to see a larger full image.

An excerpt of the summary on the back of a pirate DVD of Wim Wenders Land of PlentyA close-up of the summary on the back. Click image to see the entire summary.

How did such a negative review end up on the DVD jacket?

My guess is that the enterprising folk at the black-market DVD factory first put together a very nice looking DVD cover (full color on card stock, with gold metallic text on the title), placed an enticing summary of the film in Chinese on the back, and then chose to copy and paste a review from the internet that was about the right length to fit in the remaining space. Of course these professionals had to put in the effort to add nice typographical flourishes to the English such as large red caps on the first letter of each paragraph, but reading English is hard, so no effort was made to understand the text –why bother, the customers will only read the Chinese. For their sake, I hope the Chinese isn’t full of the English text’s negative statements, such as:

Land of Plenty is not a film. It is a tombstone for the directorial career of German Director Wim Wenders.

and

horribly weak and superficial stories and scenes

Harsh! I wonder if the writer of those IMDB comments, Anakitsuke Hidetora, would be amused. I know I am.

Assorted Cool Videos

Monday, January 23rd, 2006

A grab bag of fun video clips: