VC-1/WMV9 on Mac OS X/PowerPC
Windows Media Video 9 (WMV9) has been the root of many issues for Mac users in dealing with media playback for a long while now. Due to its prevalence on people’s desktop computers, a lot of small video clips that float around the web often carry the .wmv extension, and the playback of these files is something that should ‘just work’. You’d think it would, especially given that Microsoft produce a copy of Windows Media Player for Mac OS X that ‘supports’ this format. But that isn’t the whole story…
Windows Media Player for the Mac can decode streams of WMV9 video, but it cannot handle the format in an AVI container. Unfortunately, a lot of video files out there use WMV9 video streams with MP3 or other audio streams, a combination that is out of spec for a .WMV file and the official Windows Media Player for OS X will point blank refuse to play these files.
On Windows, programs like mplayer and VLC can use native DLL hooking on the codec dll files that ship with windows and decode these video streams without having open source decoders for them. This approach also works on x86 Linux, if the owner of the system obtains those .dll files from a Windows PC or elsewhere. When we come to the Mac OS 1, the .dll files wont work because they’re compiled for x86, so hooking them isn’t an option. You can see that this format is pretty much inaccessible at this point on a Mac.
Enter Microsoft’s VC-1 standardisation push, to have WMV9 certified as a video standard for use on next generation HD-DVD’s. In renaming the WMV9 format VC-1 for general use, and submitting technical documentation and a reference decoder, Microsoft finally gave the world a chance to explore and decode WMV9 streams using platforms other than x86. The SMPTE used to offer a copy of the reference decoder to those willing to hand over an e-mail address and name (this appears to have stopped now, and I’m not sure what the current state of restrictions on getting hold of the reference decoder from SMPTE is).
Good news is that recently a patch and other support code has been created to allow the SMPTE reference decoder to be used by FFmpeg, a powerful open source multimedia library used by several players, most notably mplayer. I think you can see where I’m going with this, and hence, some makefile poking around and adjustment later, I have a copy of mplayer built that can decode WMV9 video streams on Mac OS X PowerPC. The decoder runs quite slow (at least it did on the 120fps source media I had lying around to test it on), so its rather handy that along with mplayer, mencoder also uses the decoder, allowing you to transcode from the WMV9 video direct to Xvid, losing as little quality as possible and creating a Mac/PPC compatible file.
Just to prove the point, here’s mplayer decoding one of the Windows Media 10 trailers at 1280×720, 720p HD (I half-sized the video window).
Note that this really wasn’t running at anything near realtime, probably more like ½ realtime. Obviously the main application for this slow, but accurate decoder is for transcoding, and that’s certainly what I’d do with any WMV9 content that I wanted to watch with it. At 320×240 the decoder can just about keep up if it drops frames (and this is on a 1.67GHz PowerBook) so that should give you some idea of the speed.
Being able to work with WMV9 streams on the Mac (conversion, and limited playback capabilities) has been something I’d been wanting to do for a long time, as it was another reason to have a Windows PC lying around. With the advent of the x86 Intel Mac, its possible that no solution could have emerged before the whole situation became a non issue, as .dll hooking will work on the new Intel Macs, allowing them to play back these kinds of streams.
Or PowerPC-based Linux, for that matter. ↩