Operating system and graphics card: any
Short description of error
Any video file format combination with video and audio codecs can be selected, but not all work.
Exact steps for others to reproduce the error
The encoding UI panel when selecting a Movie File Format allows different Formats (Flash, Matroska, Ogg, ...), Codecs (PNG, Theora, H.264, DV, ...) and Audio Codecs (PCM, FLAC, Vorbis, MP3, ...) to be selected in pretty much any combination. The (video) Codec is only hidden for Formats that only support one single Codec.
The same is true for the Python API, any combination of values for ffmpeg.format, ffmpeg.codec and ffmpeg.audio_codec can be set (ffmpeg = context.scene.render.ffmpeg).
One failing combination for example is setting H264 as Format and FLAC as Audio Codec. Another example is Quicktime as Format and Theora as Codec.
The problem is that FFMPEG has no API that tells us whether a specific combination works and encoding doesn't fail either. It outputs a file that simply cannot be played back (trying with VLC for example). So the big question is how to deal with this problem? Leave it up to the users to figure out possible combinations? Hardcode possible combinations in the UI or lower at RNA level so that Python API users are also "protected"?