If you only want the short answer

For video: MP4 container, H.264, CRF around 20, audio at 192 kbps. It plays on every phone, television, browser and editor made in the last fifteen years.

For audio going into a video: WAV while you work, AAC at 192 kbps when you deliver.

For audio on its own: WAV to archive, MP3 or AAC to hand to somebody.

Video settings

Video format is the container and codec combination.

Video CRF is quality. Lower numbers look better and produce bigger files. 18 is effectively indistinguishable from the source, 20 to 23 is the useful range, and 28 is visibly soft on faces. When quality matters and size is negotiable, this is the control to use.

Encoder preset trades encoding time against efficiency. A slower preset spends longer and produces a smaller file at the same quality. For a final deliverable, slow is worth the wait. For a draft, it is not.

Output height sets the size. 1080 is the sane default for almost everything. 720 is worth choosing when a file size limit is tight, because 720p at a given bitrate looks considerably better than 1080p at the same bitrate.

Fit or fill decides what happens when the shape does not match. Fit keeps the whole picture and adds black bars. Fill fills the frame and throws away whatever hangs over the edges. Neither is correct in general, and putting a landscape interview into a vertical frame with fill will cut somebody's head off.

Video audio bitrate (kbps) is the sound inside the video. 192 is transparent for speech and music beds. Going higher is bytes you will not hear.

Audio settings

Audio format, then the controls that apply to it.

Rate control and Quality or Bitrate (kbps). Constant bitrate spends the same number of bits every second whether the sound needs them or not. Variable spends them where they are needed, which is better quality for the same size.

Sample rate (Hz). 48000 is the video standard and what every camera and editor expects. 44100 came from CD. Pick 48000 and stay there unless something specifically wants otherwise.

Bit depth. 24 bit while you work, because it gives you room to lift a quiet recording without dragging up the hiss. 16 bit to deliver.

Channels. Mono for a single speaking voice. It is effectively louder at the same level, it has no phase problems, and nobody has ever complained that narration was not in stereo. Stereo for music.

FLAC compression only appears for FLAC. It is lossless at every setting, so the number only changes file size and encoding time, never quality.

Evening out loud and quiet

Target loudness (LUFS) normalises the whole file to a loudness target rather than to its loudest instant. Peak normalising tells you nothing about how loud something sounds. LUFS does.

-16 integrated works for spoken word on the web. -14 is what most platforms normalise to. See Levels, headroom, and loudness.

Convert once

Every re-encode throws away detail, and the losses compound. Three or four generations of H.264 shows on faces and in gradients.

So do your clipping and combining first and convert at the end, once. Moving a stream into a different container without re-encoding costs nothing, but changing the codec always does. See What is actually inside a video file.

The command

Each editor shows the arguments it is about to run, selectable so you can copy them. When an export does something you did not expect, that is where to look first.