Before trying to understand what's involved in lossy compression, we should start with a better description of what it is and how we decide when to use it, what kind of compression fits our needs, and what settings to use.
What Is It?Whenever you see the word lossy you should assume that a transformation is taking place, and information will be lost in the process. Compression obviously means making a smaller file. While you can achieve a significant decrease in size using lossless compression techniques, a two hour movie would still take up around 35 DVDs unless some detail is approximated. Unless quality or editing requirements outweigh size restrictions it's almost always necessary to use lossy compression to drastically reduce size. With newer HD video it's more important than ever.
When To Use ItObviously the purpose of lossy compression isn't to lower quality (which is what happens since it's lossy) so it must be compression. So the most basic answer is use it when you need to have a smaller file size. For example, if we consider 24 bit RGB to be uncompressed that would mean over 100GB for 1 hour of video (with no accompanying audio). At 4.37GB each, DVDs wouldn't store much. The other side effect of leaving video uncompressed is ridiculous transmission requirements. At over 200Mbps it couldn't be streamed over most home (or corporate) networks. It can also cause problems for storage hardware, which isn't designed to be read and written to as quickly as uncompressed video would require.
The primary reason for most people is the most obvious. Use it when your destination formats requires it. If you're making a DVD-Video disc you'll need to encode to MPEG-2. If you're recording with a miniDV camcorder you'll be encoding with DV or with a newer HDAVC camcorder you'll automatically get HDAVC.
What Kind Of Compression?Once you've determined you need to compress video you need to decide what kind of compression is appropriate. The first consideration will obviously be destination format requirements. If you're encoding for a DVD you'll be using MPEG-2 because that's what a DVD player can play.
Assuming you need to choose between different lossy compression formats you'll want to think about what you're going to be doing with it. Whether it's interlaced, how much space it will take on a hard drive or other media you're fitting it to, whether you'll need to edit it later, and what software will need to read it are all legitimate considerations. You may find that a particular lossy compression format fits most of your needs, and use it almost exclusively or you may decide that each case should be decided independently.
SettingsIt's impossible to make across the board generalizations about the best settings for even a single program, let alone all compression software. What you can say is that matching settings for your source when encoding and decoding will always give you the best results.
Any time you create a digital representation of an image or series of images you're encoding. This applies to saving uncompressed video from an analog source in a digital format as well as encoding to XviD for an HTPC. Encoding just means it's stored in a code that some software or device will later be able to decode (read and interpret). Encoded video can be compressed, uncompressed, lossy or lossless.
Most lossy encoding is done to alter a file that's already been encoded in some digital format. That's the definition of transcoding. Transcoding starts with digital (ie encoded) video and changes the encoding. The most common examples of this are DVD backup programs that remove bits from video streams, and are commonly referred to as transcoders. However, since most video processing is already digitally encoded already, almost everything you do with it involves transcoding. This includes encoding MPEG-4 video to DVD and compressing DVD-9 backups to DVD+/-R or CD size in various formats.
Codec stands for Compresssor/Decompressor and it means software or hardware that can compress (encode) and decompress (decode) a particular format.