Announcement

Collapse
No announcement yet.

Help with Video Compression

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Video Compression

    Hi:
    I'm a newcomer to video editing, and I'm a bit overwhelmed about video formats (both capture and compression)
    I have a general computer science background, so I understand the basic principles.
    I've read many discussions in forums about the convenience of one format over another, but need a little help making up my mind.

    I capture in PAL 352x288 25 fps with a G400 TV. For my home VHS videos, Matrox MJPEG quality (highest 6.6:1) seems perfectly adequate to me, but I would like some sort of compression (interframe) for archival purposes.
    I want to keep (exactly!) the same quality of the Hardware MJPEG and being able to reproduce it on any machine. And, of course a compression rate not exceeding 20 Mb/min.(Are my requirements ridiculous?)
    Having tried Ligos LSX bundled, Xing, Panasonic, I'm not satisfied with the results. They introduce lots of artifacts in the edges
    I'm playing now with YUV2 & Angelpoison MPG4, but it takes me lots of time and I'm thinking that I'm reinventing the wheel.
    Anyway I don't know anything about correct settings for all of those codecs.
    Is there any product that just takes the original MJPEG and applies interframe compression (would be that simple?) without introducing JPEG artifacts in the frames?.
    I'm even considering to sacrifice the real time streamimg playing constraint (i.e. not tied to a constant bit rate)

    Any suggestions and links would be much appreciated.
    Thanks

  • #2
    I won't pretend to be much of an expert on the various types of compression out there but if you're looking for big savings in space by going to a intra-frame(sic) compression scheme - in almost all cases you're going to lose some quality. Now, this depends on how much of lose of quality you can tolerate. If you're aiming to keep the exact(!) same quality as the original MJPEGs (i.e. lossless intra-frame compression); honestly I can't think of anything that would do.

    As for "correct" settings for a codec, this varies depending on the type of content you are trying to compress. In addition, this could also influence what type of codec you'd use for the project.

    For my current projects, I've been finding that Sorenson Quicktime generally produces the "best" results but the time to compress is exceedingly long. Other compression formats like ASF, RealVideo, are very quick in comparison but produce slightly more artifacts and playback issues. YMMV.

    dRfAuSt
    dRfAuSt

    Comment


    • #3
      I like TMPGEncoder for MPEG II and DivX. If you have the playback horsepower DivX will definitely do the best job for the least hard drive space.

      Note that both of these codecs will do a better job with a lossless compression so if you edit in MJPEG make sure you use the lowest compression ratio.
      - Mark

      Core 2 Duo E6400 o/c 3.2GHz - Asus P5B Deluxe - 2048MB Corsair Twinx 6400C4 - ATI AIW X1900 - Seagate 7200.10 SATA 320GB primary - Western Digital SE16 SATA 320GB secondary - Samsung SATA Lightscribe DVD/CDRW- Midiland 4100 Speakers - Presonus Firepod - Dell FP2001 20" LCD - Windows XP Home

      Comment


      • #4
        DrFaust:
        I don't understand what do you mean with "intra-frame(sic)". As far as I know, video compression is achieved in 2 stages: intra-frame (i.e. compressing the frame without regarding the neighbour frames as MJPEG does) AND interframe (which is what I wrote twice so the (sic) part doesn't apply) that takes advantage of similarities between neighbour frames (like fixed or panning background).Which apply first?
        Apart from checking your Latin skills, I've been reading further on this, and I'm just getting more questions instead of answers (deinterlacing, 352x288 is less than VHS, uncompressed YUV capture, MJPEG black borders and so ...)

        Hulk:
        Where do I get the TMPGEncoder? is it freeware?

        Thanks a lot anyway for your answer, but I believe I'll take a while reading this entire forum and trying drivers, codecs, compressors, capture soft, etc. until I found a recipe for plain VHS.
        PS.: It would be great if you post me your configuration (capture soft, capture format, editing soft, compression soft, etc)

        Comment


        • #5
          Last question first. You can get the TMPGEnc MPEG-1/2 encoder here;

          http://www.jamsoft.com/tmpgenc/

          Just make sure you also get the English translation patch or you'll be reading Japanese menus

          MPEG:

          Now for MPEG encoding. There are three types:

          I-frame MPEG:

          this consists totally of bitmaps, just like MJPeg. It offers the highest quality and is more easily edited. It also makes for the largest MPEG files.

          IBP MPEG:

          this consists of I-frames interspaced by P and B frames.

          P frames are mathematically calcuated from the current and next I-frame. This calculation take less space than storing whole video as I-frames only and offers most of the compression of MPEG.

          B frames are also calculated frames, but are calculated by including the previous I-frame as well. These facilitate reverse playback.

          IP MPEG:

          This consists of only I and P frames. It does not do reverse playback very well.

          Collectively an MPEG sequence is called a GOP, or Group Of Pictures. The order they are written in is called the "GOP Sequence".

          An I-frame GOP sequence would look like this;

          IIIIIIIIIIIIIIIIII IIIIIIIIIIIIIIIIII ......

          An IBP GOP sequence would look like this;

          IBBPBBPBBPBBPBBPBB IBBPBBPBBPBBPBBPBB ......

          An IP GOP sequence would look like this;

          IPPPPPPPPPPPPPPP IPPPPPPPPPPPPPPP ......

          These GOP's are typical, but not the only way they can be sequenced. Modifying GOP's falls into art as much as science. Most folks should just use the defaults without good reason and guidanace.

          IBP or IP MPEG's can also be encoded using either a constant bitrate (CBR) or a variable bitrate (VBR). CBR gives higher quality while VBR allows a longer video to be stored in the same sized file. VBR is a nice idea, but doesn't always work well with clips that have a lot of action. Use with caution.

          Delacing:

          Interlaced video is used in both NTSC and PAL video. The odd horizontal scan lines are drawn first then the scan returns to the top of the screen to draw the even lines.

          The whole image is called a frame. Each set of scan lines, odd or even, is called a field. To delace most often means erasing one field and just using the remaining data. Some delacing software has features that smooth any artifacts this may cause by blending data from the earased lines with the remaining data. Most editing software does not do this.

          Delacing is most often used when scaling a video clip down in size, such as when creating a VideoCD file from a full sized capture. Also capturing at a quarter frame size (352x288 PAL, 352x240 NTSC) will by default capture only one frame and be delaced.

          YUY2/YUV

          Uncompressed YUY2 or YUV capture premits the creation of higher quality MPEG's, DivX and streaming video.

          This is because any DCT based compression (the type used in MJPeg, DV and MPEG) applied to a souce clip adds "noise" to the resultant MPEG. This noise is a result of re-compressing already compressed data. This should be avoided whenever possible.

          HuffYUV encoding the YUY2 or YUV signal prior to MPEG encoding does not degrade the signal as it doesn't use the same type of compression. As such HuffYUV is "lossless". It's useful because of the effect it has on the data rate of captured YUY2/YUV files: it halves their size. 704x480 YUY2/YUV files capture at about 21 megs/second. When HuffYUV is applied as the compressor during the capture this drops to 8-10 megs/second, well within the realm of a 7200 rpm ATA66 or ATA100 drive. It can be found at;

          http://www.math.berkeley.edu/~benrg/huffyuv.html

          Black borders;

          The black borders at the left of a Marvel or RR-G's frame are a nature of the beast. They do NOT show on a normally adjusted TV since they are in what's called the "overscan area". Overscan is the practice of broadcasting a larger image than a TV can show on its screen.

          Basically: ignore them unless they show up in your MPEG's. If they do then use the cropping tool in your editor to eliminate them before saving the files out for encoding. This isn't necessary for VCD, SVCD or DVD destined MPEGS as the overscan will hide them when they are played to a TV set.

          Video "sizes":

          If by VHS you mean the full frame size then yes, 352x288 PAL or 352x240 NTSC is less than a full video frame (704x576 PAL, 704x480 NTSC). A full frame would be 480 pixels high. This is why VCD's do not look as good as VHS or full frame video, they are missing a whole video field and therefore half their vertical detail.

          While the width of these frames is also half full size, 352 vs 704, this does not have as much of an affect on perceived quality as halving the height. This is because the color information is spread across 2 pixels horizontally to start with. Halving the width therefore loses no unique color information. It would, however, negatively affect the ability to add detailed graphics to a half width source.

          Dr. Mordrid


          [This message has been edited by Dr Mordrid (edited 29 October 2000).]

          Comment


          • #6
            Thank you a lot Mordrid!
            Most of the subjects I had a rough idea (having read many forums' posts) and your compilation helped very much.
            I'm now trying to capture VHS home movies for editing (for now editing means cutting the boring parts, but I plan to overimpose titles -and maybe render some 3D dinosaurs?-)
            After the edition I want to create a compressed video file suitable for transfer back to VHS without noticeable loss of quality.(and keeping the file in CD's as archive)
            I've already read (all your) previous posts about capture sizes (1/2 frame or full for titles) and HUFFYUV (installed already, but have to change back to vt1.52).
            Seems that this basic task opens a number of questions. I think it's better to start many threads than overloading this one (but if at last you'll be answering all I'd be wrong)
            Let's stick to the original subject:
            If I capture in MJPEG (1/2 frame 352x576), what's the best archive file format (codec & settings) for full VHS quality output to tape.(given the output quality fixed and no encoding time constraints, the best is the smallest size, isn't it?)
            Does lossless capturing make a difference?

            BTW maybe you know someone able to answer my first post? (PAL output for Argentina) http://forums.murc.ws/ubb/Forum2/HTML/005067.html

            Comment

            Working...
            X