+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Member
    Join Date: May 2009
    Location: United States
    Hi people.

    I'm doing a lot of MPEG2 to Xvid conversions using (good quality) source files from my DVR or digital camcorder. When converting I can choose to achieve either a target bitrate or a target filesize. Opting for one determines the other - irrespective of the selected video resolution. Though I am well aware that selecting a higher video resolution will leave less bits/pixel for the encoding process which eventually leads to "lower" quality...

    In case you don't know what I'm referring to: By bits/pixel I mean the value that one can calculate by using this formula:
    Code:
    [bits/pixel] = (bitrate[in kb/s] * 1000) / (width * height * frames/s)
    In GSpot this value is displayed as "Qf" (frame quality in bits/pixel-frame).

    My question is: Can I use the bits/pixel-value as an indicator of quality when encoding my MPEG2-files to Xvid? Can I use it to quickly determine a "good" combination of bitrate and resolution? If so, what is a good value (or range of values) to aim for?

    Also, if you deem the bits/pixel-value as inappropriate to determine quality then how do you proceed when selecting a matching bitrate/resolution-combination? I'm looking for a (quick) way to do this without compression-tests which I find very time-consuming when doing a lot of conversions.


    I'm looking forward to some insightful replies.
    ~ Regards.


    (By the way, to avoid discussion about the video content (if possible in this context) consider that my source files do not contain still images or extreme motion.)
    Quote Quote  

  2. Member
    Join Date: Dec 2005
    Location: none
    Bits per pixel is only the very vaguest of quality indications. Look at the videos in this post:

    http://forum.videohelp.com/topic357646-60.html#1903520

    Compare their bits-per-pixel values. Which would you rather watch?

    Keep in mind that resolution is a part of quality. Bits-per-pixel doesn't take this into account. For example, if you have a video that's 640x480 and another video that's 64x48 with the same bits-per-pixel rating the larger one will look far better when viewed full screen because of the greater resolution.

    If you're interested in quality just use constant quality encoding. You'll always get the quality you want. The file will turn out whatever size (bitrate) is necessary to deliver that quality.
    Quote Quote  

  3. Member
    Join Date: May 2009
    Location: United States
    Thanks for the reply, jagabo. The link to the video-comparison is quite interesting and it pretty much eliminates bits/pixel as an indicator of quality...

    You are right, I am - first and foremost - interested in quality (although I don't have "endless" disc-space). What exactly do you mean by "constant quality encoding"? Is that 1-pass encoding with a predefined quantizer? If so please enlighten me here: I always thought that 2-pass encoding delivers the best quality because of the source file-analysis that takes place in the first pass.

    I always used 2-pass to encode my videos so do you have any recommendations on what value to use for the quantizer in 1-pass (considering the MPEG2 source files)?

    Also, this might be a bit off-topic but how much of an influence do B-frames have on quality/size?
    Quote Quote  

  4. Originally Posted by Information
    Is that 1-pass encoding with a predefined quantizer?
    Yes.
    ...what value to use for the quantizer in 1-pass
    Up to you, but I use 3 usually for XviDs. I'm not jagabo, though, and can't speak for him.
    Quote Quote  

  5. Member
    Join Date: Dec 2005
    Location: none
    I usually use q=3. Sometimes q=2. At q=3 you can see a little macroblocking if you look at enlarged still frames. But it's not really noticeable at normal playback speeds. At q=2 you get almost no macrblocking but the files sometimes get nearly as big as the DVD source (so why bother) and bitrates can get too high for some playback devices.

    With Target Quantizer (constant quality in a mathematical sense) mode you select the quality. Xvid uses whatever bitrate is required at each frame to deliver that quality. The final average bitrate (and hence file size) is unknown until the encoding is finished.

    With 2-pass VBR you specify an average bitrate. The encoder has to examine the video first to determine which frames require more bitrate and which require less. Then during the second pass it allocates bits based on what it learned during the first pass and delivers the requested average bitrate. You don't know beforehand what the quality will be at that bitrate, simply that it's the best quality Xvid can give you at that bitrate.

    When the two methods deliver the same average bitate the quality is pretty much identical. You want to use 2-pass VBR encoding when you need a fixed file size (like 700 MB to fit on a CD). That way you get the best quality for that file size. If your main interest is maintaining a certain quality level, and your not too concerned about file size, then you should use Target Quantizer encoding.

    ------------

    B-frames reduce the bitrate requirement in two ways: they are encoded at a higher quantizer (lower quality) and they are bi-directionally encoded.

    The idea behind encoding them at a higher quantizer is that you will not notice a frame or two of lower quality as long as the picture is cleaned up again by the following P or I frame. I find this to be the case as long as you don't overboard with the higher quantizers (the standard settings are fine).

    Bi-directional encoding usually makes very little difference from what I've seen. If you set Xvid so that b-frames use the same quantizer as I and P frames the bi-directional encoding only makes a tiny difference in file size (target quantizer mode) or quality (bitrate mode).
    Quote Quote  

  6. Member
    Join Date: May 2009
    Location: United States
    @manono: Thanks for chipping in. The more opinions the better.

    @jagabo: Thanks for the detailed and insightful reply. It helped a lot in my understanding of 1-pass/2-pass encoding. I will look more into constant quality encoding from now on.
    Quote Quote  

  7. Video Restorer lordsmurf's Avatar
    Join Date: Jun 2003
    Location: Want my advice? PM me.
    Eliminating bits/pixel would be a mistake.

    That's negligent, and it's why so many DVD recorders do 720x480 at 3-hour bitrates, which looks like blocky crap. If they were to use the guideline of bits/pixel in the overall consideration process, that would have never happened.

    Comparing 640x480 to 64x48 is a fallacy example in this case. Considered realistic comparisons, such as 640x480 to 480x480.

    Professional video encoders always keep this in mind. If you don't believe me, pick up most of last year's issues of Broadcast Engineering, as it was discussed multiple times in encoding articles.

    It's not the only consideration, but it is in the mix when making decisions on compression.
    Quote Quote  

  8. Member
    Join Date: Dec 2005
    Location: none
    Originally Posted by lordsmurf
    Comparing 640x480 to 64x48 is a fallacy example in this case.
    It's an extreme example to make a point. Not a fallacy. It's entirely true.
    Quote Quote  

  9. Originally Posted by lordsmurf
    It's not the only consideration, but it is in the mix when making decisions on compression.
    I should hope it's not the only consideration. It's useful as a guideline, but that's about all. I find it surprising that professionals would rely on it at all when much better methods are available to help determine the encoder settings.
    Quote Quote  

  10. Member edDV's Avatar
    Join Date: Mar 2004
    Location: Northern California, USA
    Professionals usually work in a limited set of resolutions (e.g. 1920x1080, 1280x720, 720x480) and fixed channel bit rates, so bits/pixel is helpful for setting or comparing say multiple subs on an ATSC channel. At least it is a starting point for bit rate allocation.

    For example, a typical PBS local broadcasts a 720p primary and two 480i subs. Equal weighting of bit rate per pixel would result in average allocation as follows:

    Primary 1280x720/59.94 = 921600x2 pixels/frame, 72.8% x 19.28Mb/s = 14.0 Mb/s

    Sub 1 704x480/29.97 = 337920 pixels/frame, 13.6% x 19.28 = ~ 2.6 Mb/s
    Sub 2 704x480/29.97 = 337920 pixels/frame, 13.6% x 19.28 = ~ 2.6 Mb/s

    From there average bit rate can be skewed per sub as desired. The better equipped stations will have bitrate sharing (statistical multiplexing) to share variable bit rates across the subs.

    A QAM channel has approximately 36Mb/s to share over subs.
    Recommends: Kiva.org - Loans that change lives.
    http://www.kiva.org/about
    Quote Quote  




Similar Threads

  1. Staxrip: "Constant Quality" vs. "Exact File Size"
    By FallenAngelII in forum Video Conversion
    Replies: 1
    Last Post: 9th Aug 2007, 18:40
  2. REMOVE Phillips DVP-642 "angle" indicator
    By gumbico in forum DVD & Blu-ray Players
    Replies: 35
    Last Post: 28th Jun 2007, 13:55
  3. Replies: 2
    Last Post: 13th Nov 2006, 17:13
  4. How can I tell if my .avi source video is "square pixel"??
    By christopheramos in forum Newbie / General discussions
    Replies: 6
    Last Post: 10th Aug 2006, 00:03
  5. problem with vhs has "corrupted" bits
    By victoriabears in forum Newbie / General discussions
    Replies: 2
    Last Post: 30th Aug 2004, 00:00
About   Advertise   Forum   RSS Feeds   Statistics   Tools