December 20, 2006

The Atheist Christmas Show

Man, that took a while.

As I explained last week, it all started when Val called me up and asked her to make her pregnant, and tricked me into performing in the Minnesota Atheists' Christmas Show. So I went and did that, and had a marvelous time. Val and her friend Danielle and I got along famously and had a lot of laughs putting on this little skit. That's Danielle to the left, as the Angel.

At the end, Val performed her bellydance, and I filmed it with my digital camera, and that's where all the trouble began.

Unfortunately Val is tall, so in the course of first photographing and then filming her dance, I turned my camera sideways, forgetting that while rotating photos is easy, I didn't know how to rotate movies.

Figuring out HOW to rotate the movies is what kept me from blogging all week. I mean, it's not like I had a lot of spare time. With Christmas fast approaching I spent a couple of nights this week shopping. And yesterday I received a call from a home computer client who needed his network reconfigured - that kept me quite busy.

(Actually he was very lucky he called me. He was moving from cable to DSL, and wasn't aware that while the cable box was a simple modem, his new DSL box was actually a firewall. He already HAD a firewall (because his cable box had been a simple modem), so when he hooked the two firewalls together they became very confused. All the moreso because they both used the same address. Fortunately for him, I experienced the same issue when I switched to Visi.com for my ISP, and having resolved it was quickly able to also resolve his configuration problems. The Geek Squad? Don't think so.)

ANYwho, I had little time to try to figure out my problem, but when I did I quickly became frustrated. I could find a tool to switch from my camera's Quicktime format to AVI. I found a tool to rotate movies. But no matter what I did, I couldn't end up with an upright AVI file that worked on a vanilla Windows box. I could get the upright AVI's to play on my Linux system (which has more sophisticated video tools), but I wanted a video that ANYONE could click on and watch, without getting error messages.

Finally, tonight, I found the final piece of the problem. Now I can convert Quicktime to AVI, AND I can rotate the movie upright, AND the resulting movie actually plays. Yay! You click on Val there to try it out. You know you want to.

For anyone staggering into this blog as a result of a Google search on just this topic, here's what I found:

To translate Quicktime to AVI on Linux:

mencoder -ovc copy -oac pcm -o file.avi file.mov

To rotate the movie 90 degrees counterclockwise:
mencoder  file.avi -o file-ccw.avi -oac copy -ovc lavc -ffourcc DX50 -vf rotate=2

The big trick in that latter command is the command -ffourcc DX50. What was happening, you see, is that when the movie was rotated, the program was changing the label on the encoding method from "jpeg" to "FMP4". Apparently FMP4 is just one of many names for an encoding system more commonly known as DX50. The totally non-intuitive command -ffourcc DX50 forces the mencoder program to stick the label DX50 rather than FMP4 on the rotated image. It's that tag which is read by Windows Media Player to figure out if it knows how to decode the video, so using the more common tag makes it work.

Mind you, when you translate the damned file, it doesn't change the encoding label at all -- which makes no sense to me at all. I mean, you're translating the file from one encoding method (Quicktime) to another (AVI), but you DON'T change the coding label? Then you're simply rotating a movie, but keeping the same coding method (AVI), but then you change the coding method??

Anyway I finally got it figured out, so now you can watch my friend Val bellydance til your bellyaches.

Along the way, I learned a lot about video encoding. Primary lesson: it's way complex! A good, free Windows utility that I found is called Rad Video Tools. It could do many amazing things, but was too complex for me to figure out. Besides since I store my files on a Linux box, I wanted a Linux solution.

That solution is a program called "mencoder," which is the de facto standard for video manipulation. Unfortunately, like much about Unix geekery, it is wholly unfriendly. For example, here's the first version of the mencoder command that worked, to an extent:


mencoder .mov -oac lavc -ovc lavc -of mpeg -mpegopts
format=dvd:tsaf -vf rotate=2,expand=853:640,scale=640:480,harddup -srate
48000-af lavcresample=48000 -lavcopts
vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:
vbitrate=5000:keyint=18:acodec=mp3:abitrate=192
-ofps 30000/1001 -o .mpg

Does that make sense to you? Doesn't to me, either. I finally stumbled across the answer on a SUSE Linux discussion forum, although I found the -ffourcc solution elsewhere.

So having done all that, I can tell you, the Atheist Christmas Show was a lot of fun. For anyone who had the patience to wade through that whole explanation about the solution process, here is your reward: a short album of photos from the Atheist Christmas Show. Enjoy!

Posted by Albatross at December 20, 2006 11:34 PM | TrackBack
Comments
Post a comment









Remember personal info?