Looking for a command line tool that converts a .wmv file into .mpg

I need a simple command line executable that allows me to convert a wmv file into an mpg file like this:
wmv2mpg inputfile.mwv > outputfile.mpg

I cannot find it on internet. I tried installing mencoder but I cannot get it to work.

Thanks.

Try ffmpeg.
And specifically for the Mac, ffmpegX.

i use ffmpeg a lot. Just do "sudo port install ffmpeg" (assuming you use macports).

(it understands from the extension of your second file that you want an mpg and does the job)

if you only want to see these movies install Flip4Mac, allows you to play Windows Media (wmv) with QuickTime.

Unless they've changed something since I've used ffmpegX, it seemed a little iffy with the WMV format. I recall it usually losing the audio stream or squinching the video track or something along those lines. The Flip4Mac route is probably best, though for full conversion you have to shell out a little $$, as it is the Microsoft endorsed, approved and maintained means of viewing and manipulating WMV in Mac OS X.

Not too long ago there was VirtualHub by Techspansion, but neither of those are any longer with us. VH did a pretty good job of converting WMV to MPG; there were only a few I ever used it on that it had problems with, and I suspect this was because they were encoded in a version of the wmv codec too new (or too weird) for the ffmpeg, mencoder and other core utils it used behind the GUI to do the job.

BZT