Produce Windows compatible video with OSS (update)

Back in April 2006 I published a short article on how to produce a Microsoft Windows Media Player (MSWMP) compatible video file with open source tools. A few weeks ago I noticed that a file I just converted with my method produced an error during playback in MSWMP.

After some trial and error I found these Mencoder settings to be working:
mencoder name_input_file -oac mp3lame -lameopts preset=64 -ovc lavc -lavcopts vcodec=msmpeg4v2:keyint=5:vbitrate=850:mbd=2:mv0 -ofps 24 -o output_filename.avi

This produces an avi file containing a video compressed with the msmpeg4v2 video codec and the lame mp3 audio codec. It should play with any MSWMP version.

However, if you want to stream this file with a Windows Media streaming server it won’t play. For Windows Media streaming the video has to be put in an asf container instead of an avi container. These Mencoder settings should have done the trick:

mencoder name_input_file -oac mp3lame -lameopts preset=64 -ovc lavc -lavcopts vcodec=msmpeg4v2:keyint=5:vbitrate=850:mbd=2:mv0 -ofps 24 -of lavf -lavfopts format=asf:i_certify_that_my_video_stream_does_not_use_b_frames -o output_filename.asf


But that didn’t work. Maybe Mencoder asf muxing is buggy. I don’t know. Fortunately there are other methods. You can find the VLC solution in my original article. With FFmpeg you can use these settings:


ffmpeg -i name_input_file -vcodec msmpeg4v2 -acodec mp3 -f asf output_filename.asf

More on FFmpeg Windows compatibility can be found here: http://ffmpeg.mplayerhq.hu/compat.html.

I you want to see an example please click below. This video from BBC News (originally in RealVideo, how Ironically) is transcoded with: ffmpeg -i ~/bbc_microsoft.avi -vcodec msmpeg4v2 -acodec mp3 -f asf bbc.asf

Leave a Reply