What's a good website or book for understanding Codecs?

Discussion in 'Amateur Video Production' started by Doc, Jan 3, 2005.

  1. Doc

    Doc Guest

    Where could you go to try and fathom the subject of Codecs - the how's and
    why's of them regarding video, compression, decompression, recompression
    etc. etc. I feel like I"m stumbling around half blind working with computer
    video not really understanding these issues.

    Thanks for all input
     
    Doc, Jan 3, 2005
    #1
    1. Advertisements

  2. http://www.fourcc.org has one of the more comprehensive listings
    of codecs and their ID numbers. But not sure exactly what info you
    are looking for?

    Are you having some sort of problem that you think implicates
    codecs? Lots of us work in video for years without giving codecs
    a second thought. They are mostly installed and invoked completely
    automatically.

    Perhaps you could try specific questions that would reveal where
    you are coming from?
     
    Richard Crowley, Jan 3, 2005
    #2
    1. Advertisements

  3. In a nutshell codecs are a way of sharing video files. Codecs are an
    algorithm for encoding the video frames interleaved with audio. AVI stands
    for Audio Video Interleave. The format AVI is a container in which this
    encoded video information is stored, as is the MOV format. Some codecs are
    hardware based, some are software based and some are both hardware/software
    based. Many of the original capture cards for the Windows OS such as the
    Intel Personal Video Recorder, were based on a Brooktree encoder chip for
    video capture. The video could be played back on other Windows systems using
    the Intel Indeo software codec. The Intel Indeo codec is and has always been
    able to also write the video information to both the AVI & MOV containers,
    as are other software based codecs such as Cinepak.

    The data rate of a video file governs the abiltiy of the target device for
    playback. Originally CD drives were only 1X and the data rate for video
    files had to fall into the limitations of that device for playback. In order
    to reach the planned target some concessions had to be made to allow smooth
    playback, i.e. smaller frame resolutions, lower frame rates, lower audio
    rates. This is where compression comes into play - all these factors
    gathered together and crammed into a single stream for playback at the
    lowered target data rate.

    Compression has always had a lot to do with the ability to share video over
    various connection speeds through the internet. Full frame resolution NTSC
    video with CD quality audio uncompressed has a data rate of nearly 30MB per
    second. Even with large amounts of compression that stream would choke over
    a 56K connection. Over the years many different types of codecs have been
    developed in the hope of achieving better quality video at lower data rates.
    This is where MPEG-2 compression outshines all the rest lowering the
    Megabytes to megabits and still offering a high quality picture with sound.
    Unlike many of the non-DV video algorithm's MPEG-2 does not have sub-format
    frame ratio's - which I cover in the next paragraph.

    Understanding codecs and compression/decompression is really not that
    difficult in obvious information - more compression less picture quality,
    less compression better picture quality. It is more difficult to understand
    how to compress the video in order to achieve the target playback you
    desire. And in truth practice makes perfect. There is always a trade-off
    when it comes to passing video over the web, particularly when the users
    have 56K or lower connections. Unless the user has broadband the image has
    to suffer in some way. It has to be compressed to lower data rates and frame
    rates are cut down to 10 or 15fps.

    Most video applications using software based codecs assume a 4:3 ratio and
    the sub-ratio's based upon it, i.e. 640x480, 320x240, 160x120,etc. all
    square pixel ratio's. This is because DV was not around and analog capture
    was done in square pixel 4:3 screen ratio's. MPEG-2 on the other hand
    expects the DV pixel ratio and frame resolution. There is a breaking point
    with any codec in relationship to compression - the more the compression the
    lesser the picture quality. Natually the less the compression the better the
    picture quality.

    Take a look at this video file on my website.
    http://digitalvideosolutions.com/video/Top_Flight.wmv I compressed it with
    the broadband user in mind. The frame resolution is interlaced 720x480 with
    a pixel ratio of D1/DV NTSC (0.9) the audio is 44kHz and the frame rate is a
    full 29.97fps. The file is only 18.5 seconds long. I used Windows Media
    Encoder 9 choosing to keep frame rate, etc. high under the settings of a 2MB
    broadband connection. The file size is 4MB. You could probably do better
    using DivX but still, at it's present compression level it is about 18 times
    smaller than the original DV file which was around 114MB.

    Your target is the determining factor to compression. With higher data rates
    all the software codecs loaded on your Windows system will yield a very nice
    picture. I really don't know what more one can tell you in regard to codecs
    that would make it any easier to know what you end result will be. If you
    are looking for single data rate video with good quality and wide spread
    cross platform playback then MPEG-1 may be the answer you are looking for.
    Take a look at this short MPEG-1 file
    http://digitalvideosolutions.com/video/Wed02.mpeg Even when played back at
    200% the frame size it really doesn't look too bad, and it's just the normal
    MPEG-1 VCD compression level. I hope this helps in some way. I am sure there
    are others with still more pertinent advice or information which I may have
    overlooked or mis-quoted as fact.
    --
    Larry Johnson
    Digital Video Solutions

    http://www.digitalvideosolutions.com
    877-227-6281 Toll Free Sales Assistance
    386-672-1941 Customer Service
    386-672-1907 Technical Support
    386-676-1515 Fax
     
    Digital Video Solutions, Jan 3, 2005
    #3
  4. No, they are not. There are video codecs which compress/decomprocess
    video, and you have audio codecs which compress/decomprocess audio.
    Ok. Note there are more containers (OGM, MKV, etc ...).
    Just curious. Could you give some examples of hardware codecs?
    You mean capture chip? Those don't encode anything, they just capture.
    Compression has nothing to do with frame sizes or frame rates. It has
    to do with smoothing details out.
    No, it doesn't. It is the case for high bitrates and clean video. But
    (in
    general) not if you aim for mid/low bitrates, or you have noisy video.
    sub-format frame ratios? Ok, I will read the next paragraph.
    This is all true of course (I'm not sure about the framerate numbers
    though
    for streaming video). But you can also download it first and then watch
    it.
    No they don't.
    Note that XviD for example can also handle video with par != 1 (since
    six
    months or so).
    No, it's not. The square pixels are correct (assuming you are capping
    avi),
    but you don't need to cap using a 4:3 ratio (768x576, etc.). For some
    drivers
    it's not even possible.
    I thought DV is always 720x576 / 720x480 (not 704x576 for example).
    I haven't watch the video, but I would deinterlace it, then you can use
    a
    lower bitrate.
    VCD sucks, because the bitrate is very low. If you want to use MPEG-1
    use a
    bitrate which is high enough.
    I hope you are satisfied with my corrections :)
    Btw, you might want to hang around at the video forums (doom9 for
    example) a
    bit more. Very useful, also for someone from "Digital Video Solutions".

    Wilbert
     
    Wilbert Dijkhof, Jan 3, 2005
    #4
  5. Actually, most video codecs include the audio stream since
    most of us have become accustomed to "talkies", at least in
    the last 100 years or so.
    Every DV camcorder on this planet has a hardware DV codec. Even
    codecs used for computer processing of video (like Indeo) were done
    in hardware before CPUs were fast enough to do it in software.
    Many of them encode/decode as well. For example you can
    buy high-end video capture/edit systems that include hardware
    encode/decode (aka. "accellerator") boards.
    Compression has everything to do with frame sizes/rates.
    It enables us to preserve the desired size/rate with less
    overhead of bitstream volume.
     
    Richard Crowley, Jan 3, 2005
    #5
  6. Doc

    marks542004 Guest

    Hi,

    CODEC stands for COmpressor / DEcompressor

    Each codec has a different method (generalization for simplicity) of
    compressing the video or audio data contained in a movie.

    Since the audio and video are seperate streams you may use one video
    codec and one audio codec to compress a file.

    Different codecs may provide higher quality or smaller size. Some
    codecs can be choosen to give you a specific transfer rate. e.g
    streaming video, select a window size and codec to provide say 36K
    rates for a dialup link.

    To try some of these things take a 30 second clip.
    output it using the same frame size, use different codecs and quality
    settings. Compare the file sizes and quality on playback. Then look at
    the statistics (if your player provides them ) for the transfer rates
    involved.

    There are a number of sites that list codec names and the fourcc code.
    These are useful if you have a video (or audio) that will not play. You
    can extract the fourcc code and look it up.

    I have not found any good sites that discuss the available codecs and
    compare the benefits of each.

    For preparing video for DVD production the supplied codecs with
    whatever software you are using are probably good enough.

    For web site video look at DIVX or XVID - they seem to have high
    compression rates with good quality.

    Compression and decompression routines are often implemented in
    hardware. Benefit is they run very fast without loading the processor.
    Against that is the fact that you cannot easily change the compression
    routine as standards change. MPEG is often in hardware on better
    capture cards.
     
    marks542004, Jan 3, 2005
    #6
  7. I don't know how you define most, but you can't encode the audio with
    the xvid, divx, 3ivx and many avc encoders.
    Yes, you are right of course.
    Yes, of course. The lower the frame size you choose the more you
    can compress. Perhaps I should formulate it differently 'compression
    itself is not about frame sizes or frame rates'. You can perfectly
    apply compression without distorting the quality too much and without
    reducing frame size or frame rate.

    Of course if you just lower the frame rate you are not compressing
    at all.

    Wilbert
     
    Wilbert Dijkhof, Jan 3, 2005
    #7
  8. On the outset I should probably apologize for assuming the standpoint of NTSC video. I sometimes forget this newsgroup encompasses all the worlds' video standards and their users. Again, for this I apologize. As for you Wilbert I was not satisfied with your statements or assumptions on several subject levels. I won't take any cheap shots at you. I don't play the "eye for an eye" game. I have no desire to belittle you in any way as you attempt to do me.

    First, I will tell you that I am probably in a much better position to know about video (NTSC standard) than many. My father was one of the technician's who developed the NTSC color standard to begin with. From the moment I was born I have been surrounded by video photography and editing equipment on all levels from broadcast gear to home video recorder and camcorders before the general public had access to them. From the very inception of video capture and editing on the computer I have owned the earliest models in both the broadcast and consumer levels. With those devices and the captured video I have spent countless hours experimenting with frame resolutions, frame rates and doing so with nearly every video codec known to man.

    Today my business services the National Geospatial-Intelligence Agency, General Dynamics, and the NASA Langley Research Center - to name a few of our non-Academy Award Winning clients. With that said I will endeavor to ablige your interjections with some down-to-earth logic without personal emotion. I have placed my original statements in italics, Wilbert's in normal type and mine in answers in bold.


    Digital Video Solutions wrote:

    In a nutshell codecs are a way of sharing video files. Codecs are an
    algorithm for encoding the video frames interleaved with audio.

    No, they are not. There are video codecs which compress/decomprocess
    video, and you have audio codecs which compress/decomprocess audio.

    When answering a question on a video related forum I did not think it necessary to engage in discussion of audio codecs. Thank you for bringing it to light that I may be so stupid as to think there are only video codecs in existence!

    AVI stands for Audio Video Interleave. The format AVI is a container in which this
    encoded video information is stored, as is the MOV format.

    Ok. Note there are more containers (OGM, MKV, etc ...).

    Naturally there are other containers. If I were to use "blue' and "red" as examples of colors should it also be mentioned that there are more colors out there? I simply used examples most common to the Windows and Mac OS respectively. But once again not bringing up other examples could be a sign that I have no idea what I am talking about, this is true.

    Some codecs are hardware based, some are software based and some are both hardware/software based.

    Just curious. Could you give some examples of hardware codecs?

    Yes. The dpsVelocity, the NewTek VideoToaster and the Canopus DVRexRT. These are "codec cards" and the video derived from these cards cannot be played back without the respective hardware being present. Well, there is one exception in those I listed - Canopus did release a software version of the codec for playback on other systems. Actually it is only a decompressor since it cannot be used to write new files with the Canopus DV compression algorithm.

    Many of the original capture cards for the Windows OS such as the Intel Personal Video Recorder, were based on a Brooktree encoder chip for video capture

    You mean capture chip? Those don't encode anything, they just capture.

    In todays world where video is written to tape in zero's and one's inside the digital camcorder this may be true to some extent - the chip merely captures. Although the cards mentioned above do have a specific nature of once captured by the hardware in the DV format in that the video needs the hardware, or it is useless to anyone without the hardware. If this isn't encoding then any DV codec from any company - Panasonic, Microsoft, etc. could playback the video files.

    Interestingly the video captured using the Microsoft DV codec for instance can be played back using the DVRexRT hardware. And just for grins I am going to repeat it, the DVRexRT capture video cannot be played back by the Microsoft DV codec. If DV is DV then why is that. If there is no encoding and it's only a simple capture....hmmmm Sounds sort of like the scenerio of an Indeo encoded (compressed) video file that cannot be played back using the Microsoft DV codec. But, what do I know?

    The video could be played back on other Windows systems using the Intel Indeo software codec. The Intel Indeo codec is and has always been able to also write the video information to both the AVI & MOV containers as are other software based codecs such as Cinepak.

    The data rate of a video file governs the abiltiy of the target device for playback. Originally CD drives were only 1X and the data rate for video files had to fall into the limitations of that device for playback. In order to reach the planned target some concessions had to be made to allow smooth playback, i.e. smaller frame resolutions, lower frame rates, lower audio rates. This is where compression comes into play - all these factors gathered together and crammed into a single stream for playback at the lowered target data rate.

    Compression has nothing to do with frame sizes or frame rates. It has to do with smoothing details out.

    If compression has nothing to do with frame sizes or frame rates why is it we cannot do sub-format captures using DV equipment? In the days of the old analog cards like the miroVIDEO DC50 & DC30 sub-format resolutions and frame rates were something that could be done every day of every week. With the compression rate of 7MB seconds file sizes and video length was ever increased by reduced frame resolution and frame rate. When lowering the compression rate to 1MB seconds using lower resolutions of 240x180 or 160x120 and frame rates of 10 to 15fps the picture (in its' natural form) was very good, motion was smooth and video lengths could be much longer within the smaller file sizes. If these factors had nothing to do with compression then what caused this great phenomenon?

    Compression has always had a lot to do with the ability to share video over various connection speeds through the internet. Full frame resolution NTSC video with CD quality audio uncompressed has a data rate of nearly 30MB per second. Even with large amounts of compression that stream would choke over a 56K connection. Over the years many different types of codecs have been developed in the hope of achieving better quality video at lower data rates.This is where MPEG-2 compression outshines all the rest lowering the Megabytes to megabits and still offering a high quality picture with sound.

    No, it doesn't. It is the case for high bitrates and clean video. But (in general) not if you aim for mid/low bitrates, or you have noisy video.

    If the user begins with video that is normal DV compression, and regardless of whether the video has noise in it or not, the data rate is reduced from xMB per second data rate to xmb/ps bit rate. Obviously a savings in disc space and with medium bit rates will give a resultant video which is very much the same in quality as the original. Naturally if one is shooting for lowered bit rates then the picture will suffer, and most of us here realize that video noise cannot be magically removed just because the bit rate or data rate of the video is higher.

    Unlike many of the non-DV video algorithm's MPEG-2 does not have sub-format frame ratio's - which I cover in the next paragraph.

    sub-format frame ratios? Ok, I will read the next paragraph.

    Yes, sub-format ratios. Those smaller frame resolutions mentioned earlier. The one's most of us are familiar with. They are all over the internet and in CD encyclopedia's, CD cookbook's and a thousand other places. Sorry to not give more examples. I know how you crave more than two examples, Wilbert. I would not confuse sub-format with single-field rendered capture or output but leave it at that "single-field". The old analog card did this type of capture and render using only half the field information to create full screen video.

    Understanding codecs and compression/decompression is really not that difficult in obvious information - more compression less picture quality, less compression better picture quality. It is more difficult to understand how to compress the video in order to achieve the target playback you desire. And in truth practice makes perfect. There is always a trade-off when it comes to passing video over the web, particularly when the users have 56K or lower connections. Unless the user has broadband the image has to suffer in some way. It has to be compressed to lower data rates and frame rates are cut down to 10 or 15fps.

    This is all true of course (I'm not sure about the framerate numbers though for streaming video). But you can also download it first and then watch it.

    One of my clients is Lifestyle Software, the website designers for American company's such as, Smuckers, Sara Lee, Nabisco, HP, Hormel, Campbell's Soup and General Mills. Their multimedia department routinely creates video for online presentation of one kind or another using frame resolutions of 320x240 at 10-15fps when audio fidelity must be higher and when audio is mostly the spoken word that is lowered in favor of higher frame rates.

    These concepts have changed with better compression algorithms which are now present in the Windows Media Encoder 9 and others. In previous versions even small video resolutions gauged for just beneath broadband 1MB delivery were pretty artifact ridden at best and the audio screached somewhat. Again, a lot of my first statements were based on what has gone before as apposed to what is now available.

    Most video applications using software based codecs assume a 4:3 ratio and the sub-ratio's based upon it, i.e. 640x480, 320x240, 160x120,etc. all square pixel ratio's. This is because DV was not around

    No they don't. Note that XviD for example can also handle video with par != 1 (since six months or so).

    First, what is available to choose when doing a custom output is not what I was talking about. Preset choices for web and CDROM playback are fixed square pixel 4:3 ratio's. This is the "assuming" part...the programs assume the 4:3 ratio by default.

    Facts are based on mainstream video editing software packages. In Adobe Premiere presets - Multimedia Quicktime or Video for Windows is 320x240 15fps 22kHz 16bit mono audio (square pixel), NTSC Quicktime or Video for Windows is 640x480 29.97fps 44kHz 16bit stereo audio (square pixel), PAL Quicktime or Video for Windows is 768x576 25fps 44kHz 16bit audio (square pixel). The only deviations are for the NTSC Quicktime or Video for Windows at 720x480 DV frame resolution with 48kHz 16bit audio 0.9 pixel (non-square).These settings are the same in Ulead MediaStudio Pro.

    Otherwise there are the other DV settings for either NTSC or PAL both having non-square pixels 0.9 and 1.067 respectively. Any one of these settins will create a matchin video file and regardless of the pixel ratio encoders like Windows Media Encoder will change the ratio to a true 4:3 320x240 for web playback or download delivery, as will most of the others out there. Case and point.

    No, it's not. The square pixels are correct (assuming you are capping avi), but you don't need to cap using a 4:3 ratio (768x576, etc.). For some drivers it's not even possible.

    Again we are back to the differences in the old analog capture scenerio as apposed to the DV capture scenerios. First off "square pixels are correct (assuming you are capping avi)" as you stated it totally false! whether you are "capping avi" or not!! It's not the case of "for some drivers it's not even possible". None of the analog/DV capture solutions allow video captures of anything other than 720x480 or 486 NTSC or 720x576 PAL, and in neither case is the pixel square! We've been over this, and maybe with a little research you would have already known it - D1/DV NTSC 0.9 Pixel, D1/DV PAL 1.067 Pixel. Now, if the card is 'analog only' then 601 video formats may be possible depending on the card.

    MPEG-2 on the other hand expects the DV pixel ratio and frame resolution.

    I thought DV is always 720x576 / 720x480 (not 704x576 for example).

    Again, back to analog video resolutions as they are compared to DV resolutions.

    Take a look at this video file on my website.http://digitalvideosolutions.com/video/Top_Flight.wmv I compressed it with the broadband user in mind. The frame resolution is interlaced 720x480 with a pixel ratio of D1/DV NTSC (0.9) the audio is 44kHz and the frame rate is a full 29.97fps. The file is only 18.5 seconds long. I used Windows Media Encoder 9 choosing to keep frame rate, etc. high under the settings of a 2MB broadband connection. The file size is 4MB. You could probably do better using DivX but still, at it's present compression level it is about 18 times smaller than the original DV file which was around 114MB.

    I haven't watch the video, but I would deinterlace it, then you can use a lower bitrate.

    Deinterlacing the video would not give any marked difference in the data rate of the video, especially when I chose to have a 2MB broadband file as the result.

    Your target is the determining factor to compression. With higher data rates all the software codecs loaded on your Windows system will yield a very nice picture. I really don't know what more one can tell you in regard to codecs that would make it any easier to know what you end result will be. If you are looking for single data rate video with good quality and wide spread cross platform playback then MPEG-1 may be the answer you are looking for. Take a look at this short MPEG-1 file http://digitalvideosolutions.com/video/Wed02.mpeg Even when played back at 200% the frame size it really doesn't look too bad, and it's just the normal MPEG-1 VCD compression level. I hope this helps in some way. I am sure there

    VCD sucks, because the bitrate is very low. If you want to use MPEG-1 use a bitrate which is high enough.

    "If you want to use MPEG-1 use a bitrate which is high enough". Quite ambiguous but again raising the bitrate is adding less compression. Even at normal MPEG-1 settings a very short video file of only 16 seconds is around 4MB in size. Just what is high enough, and what about video noise, etc you mentioned before?

    I hope you are satisfied with my corrections :) Btw, you might want to hang around at the video forums (doom9 for example) a bit more. Very useful, also for someone from "Digital Video Solutions".

    Wilbert

    Well Wilbert, for someone who "hangs around at the video forums (doom9 for example)" it appears that you really don't have a firm grasp on video compression, video resolutions, frame rates or the structure of competitent video analysis whatsoever. When you can stop "hanging around these cool video forums" and grab a set of clients who are actually doing something in the real world of video you can tell everyone how frame resolutions, frame rates, data rates and bitrates have nothing to do with compression.

    Otherwise, I have been there since the beginning and as an internet presence since 1994. In addition, I have the credentials to show the validity of my knowledge, which has extended to the one of the major company's directly involved with the making of the movie "the Matrix". Meanwhile, you have not only watched that movie but probably have also played the video game "on yur XBox dude!"

    It take a true brainless idiot like me to be involved with these major corporations - they just love the "Spicoli" in me! Fur sure!!


    --
    Larry Johnson
    Digital Video Solutions

    http://www.digitalvideosolutions.com
    877-227-6281 Toll Free Sales Assistance
    386-672-1941 Customer Service
    386-672-1907 Technical Support
    386-676-1515 Fax
     
    Digital Video Solutions, Jan 3, 2005
    #8
  9. It never ceases to amaze me the vigor with which ignorance is
    promulgated online. Having been in professional video since 1968, and
    having spent most of my time in hardware and software design for the
    video industry, it is impressive to see someone like Wilbert make such
    pronouncements that are filled with so much misinformation. Clearly, he
    seems convinced that video was born about the time of the desktop
    computer <g>.

    My hat's off to you for setting min straight in a number of areas. I
    generally don't take the time, because (as you may see later) his ilk
    all too often come back with more of the same, and proceed to waste time
    and bandwidth, apparently in the belief that loud screams will overcome
    logic and knowledge.

    Bill
     
    William Meyer, Jan 3, 2005
    #9
  10. Thank you, Bill. I would normally not have taken so much time in answering
    someone like Wilbert, save for the fact there are many out there who may
    take his words to heart and be misled.
     
    Digital Video Solutions, Jan 4, 2005
    #10
  11. My apologies for that. It was not really my intention.
    That's not my point. I thought your were trying to explain topics
    like codecs, compression, etc. to the original poster.

    I'm surprised that in general codecs encode video, audio at
    the same time and interleave them. Your description seems to imply
    that.
    Again, I thought your were trying to explain something. What's wrong
    with pointing out to the OP that there are more containers?
    Sorry, mine comment was a dumb comment. I only wanted to take away
    the impression (to the OP) that compression is only about using lower
    frame sizes or frame rates. Your example did conflict with that.
    I should have worded it differently.
    I agree. But, my objection was that 'MPEG-2 compression outshines
    all the rest', which is only true for high bitrates.
    Ok, I didn't realize that. I agree.
    This was a reaction to your statement "This is because DV was not
    around and analog capture was done in square pixel 4:3 screen
    ratio's.". So you were not talking about DV codecs here.
    Yes, that's what I said.
    Ok fine, if you don't see a difference.
    Yes, indeed. Perhaps you are satisfied with the quality of VCD.
    To me it is blurred to much because of the low (constant) bitrate.
    Sorry, I don't recall this comment about noise?
    Yeah, whatever. Changing the frame size and frame rate is necessary
    for compression? If not, how well do you explain compression to
    the original poster?
    Cool. Imo, the Matrix is one of the best movies around.

    Wilbert
     
    Wilbert Dijkhof, Jan 4, 2005
    #11
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.