Which codecs are most suitable for playback with Windows Media Player on Windows XP?

Since you don't specify anything else, your video stream is set to use q=2-31, 200 kb/s. It results in 673.5kbits average, which is not a lot, at least not for non-h.264 codecs.

Try forcing

  • a certain bitrate with -b:v 1000K for example. With older FFmpeg versions, you can only use -b.
  • a fixed quality level with -qscale 2 for example. Here the value can range from 1 to 31. Sane values for qscale are in the range from 2 to 5 or so. Just try and see what achieves the best result.

The codecs that are really supported on Windows by default are these:

There are hundreds of audio and video codecs in use today. Some have been created by Microsoft, but the vast majority of codecs have been created by other companies, organizations, or individuals. By default, the Windows operating system and the Player include a number of the most popular codecs, such as Windows Media Audio, Windows Media Video, and MP3.

Also see Multimedia file types that Windows Media Player supports for more information.

With FFmpeg, you can try mpeg1video (MPEG-1) or mpeg2video (MPEG-2), or msmpeg4 (MPEG-4 Part II), but I'm not sure if the latter is even universally supported. If you want to play it safe, you're forced to use MPEG-1 or MPEG-2.

I had a similar issue with an aac/h264 .mp4 file which originally played fine in Windows Media Player (Windows 7). After I edited in VirtualDub and saved in .avi format, and then converted back to aac/h264 .mp4 using ffmpeg defaults, it would no longer play in Windows Media Player.

Using MediaInfo to compare the original and final files, I noticed a different encoding profile had been used, and different chroma subsampling settings (4:2:0, final 4:4:4). By re-encoding it with ffmpeg using the following option WMP was able to play the file correctly:

ffmpeg  -i edited.avi -pix_fmt yuv420p fixed.mp4

The FFMPEG wiki recommends the following:

ffmpeg -r 30 -i foo.flv -codec:v mpeg4 -flags:v +qscale -global_quality:v 0 -codec:a libmp3lame foo.avi