FFMPEG An Intermediate Guide/WMV

The Windows Media Video and Windows Media Audio codecs are staples of the Advanced Systems Format, in which Microsoft sought to find leading codecs on the market at the time of introduction. While both codecs have been outclassed over time, WMV is still an accepted format by YouTube to upload files, and projects like FFmpeg are able to encode to earlier versions of it. The format and its background contrasted with Microsoft's previous format AVI, in which Microsoft aimed to push for development of new and original codecs. At the time, this move resulted in conflicts on different systems, so with the development of ASF, Microsoft instead adopted the leading video and audio codecs at the time. The factors for including these codecs were determined by a) how fast it could be encoded to, b) how performant systems were during decoding, and c) resulting quality.

It should be noted that any material encoded into ASF using software not authorized by Microsoft violates their patent rights. Where organizations like Xiph are permissive of their formats being used, Microsoft went the way of Fraunhofer in 2000 when they asked a developer who had reverse engineered the format to stop. The developed software in question was VirtualDub, and the author had complied shortly after.

So, if you must encode to ASF using FFmpeg, do not publish your resulting material. Use other codecs if you possibly can.

With WMV input
You can stream copy codecs that can't be encoded to by FFmpeg by doing this command:

ffmpeg -i input -vcodec copy -acodec copy output

This will copy both the video and audio.

With other input
With supported encoders, you can do:

ffmpeg -i input -b 1500k -vcodec wmv2 -acodec wmav2 output

Notice the  flag. At most 480p video, the output is slightly pixelated but still easily viewable. This creates Windows Media Video 8 video and audio file streams, because the encoder for Windows Media Video 9 is not completely working.

Make sure you include the  flag or the default will not be   and will not be included in the output video. If the input audio has more than two channels (like surround sound), the encoder cannot handle more and will throw a "Too many channels" error. Manually set the number of channels to 2 with the  flag.