Output vs Format vs Codec: what is the right combination?

Context

My problem started with a partial lack of sound in my rendered file. The WAV audio strips were missing from the output, while the AAC audio from a .mp4 video file was present. Everything is audible when editing.

There are some related questions which taught me that it's a problem of codec selection. This one and its answer motivated my further investigation and my question: I can't render audio with my video

I had the following for the output settings because I thought MP3 is a good selection which would work on all computers (I am using Blender 2.77 on a Ubuntu 14.04 derivative (Mint) and I have libmp3lame installed)

I solved my problem by changing the Audio Codec to AAC.

I am looking for:

1. Explanation of why with MP3 output the WAV sound is missing but the AAC sound is audible
2. Understanding the differences between selections in Output section: MPEG vs H.264 since these seem to be the most common. Other formats are welcome :) (Frame server, XVid, AVI Raw|JPEG).
3. Explanation of Encoding > Format and Encoding > Codec options, in relation to point 2. For example, why are you able to choose MPEG output and non-MPEG format and non-MPEG-non-<format> codec? This is VERY confusing.

I hope I won't be closed as being too broad, I tried to be as specific as possible.

I realise this may not be a blender specific question. Please advise where to look for additional information.

Related questions:

Some of these are experiencing problems similar to mine (lack of sound) and usually due to a misconfiguration of Output and Encoding sections. However, even those that are solved give a very specific answer and are of little help when you're problem is slightly different

Sound works in Blender, but no sound in the final render

This one gives one choice that is working, but no explanation: Rendering Sound In Video Sequencer (duplicate https://blender.stackexchange.com/questions/47816/how-do-i-render-intros-in-blender-with-sound )

This one reports a problem when converting FLAC to MP3. It could be related to my initial problem, since both FLAC and WAV are lossless https://blender.stackexchange.com/questions/38850/script-for-audio-encoding

Can I incorporate audio into my output avi render?

Why isn't audio rendering?

No audio output in rendered video file

VSE: How to render a video with audio?

Maybe: No sound in VSE

• You might probably split your question into three separate linked questions. May 10 '16 at 9:24
• thanks, I'll do that. Here is the one related to the first part: blender.stackexchange.com/questions/52335/… May 10 '16 at 19:46

1 - Explanation of why with MP3 output the WAV sound is missing but the AAC sound is audible
this could be a problem with that particular file, try converting it to mp3 using an external program like ffmpeg or audacity or even an online tool.
or try a matroska container with x264 video codec and mp3 audio codec.

2 - Understanding the differences between selections in Output section: MPEG vs H.264 since these seem to be the most common. Other formats are welcome :) (Frame server, XVid, AVI Raw|JPEG).

3 - Explanation of Encoding > Format and Encoding > Codec options, in relation to point 2. For example, why are you able to choose MPEG output and non-MPEG format and non-MPEG-non-<format> codec? This is VERY confusing.

a container like (mp4,mkv) contains n video streams and n audio streams encoded in a given format with a given codec,a codec is a coder and decoder.
think of a container like a .zip or .rar file
some containers don't allow certain combination of those codecs (like .webm can't have a video stream encoded in h.264 but allows a vp9).

blender offers you presets to make your life easier.
a mpeg-4 (.mp4) with h.264 and mp3 like in your screenshot is a valid combination and the reason h264 is common is because it produces better video quality with small sizes and is well supported by browsers and Operating systems.

• 1 - I tried your suggestion and the conversion works with ffmpeg and the online tool. The matrosk+h264 combination presents the same problems. See the linked question in my comment to this one. 2&3 - thanks, I like the .zip comparison. It still doesn't make much sense why you can encode h.264 in an mp4 container or vice-versa, but I guess it's more flexible this way May 10 '16 at 19:50