Xvid is producing wrong file sizes...

Discussion in 'DivX / XviD' started by Blighter, Feb 16, 2006.

  1. Blighter

    Blighter Regular member

    Joined:
    May 18, 2004
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    26
    Hey guys,

    I use DGIndex to rip my DVDs, and AVISynth to load them into VirtualDubMod so that they can be encoded into XVid avi format.

    I've encoded about 20 different videos with good results, but with a few of the videos, Xvid is producing AVIs about 50 megabytes larger than what i specified. I've done everything right, my previous encodes are all the right file size within a few kb, but 50 megabytes out is ridiculous. I can't figure out where it's going wrong, i've given the calculator all the right information, and it gives me a result that seems about right. But when Xvid gets round to encoding it, the resulting file is way too large. What's wrong with it?

    Cheers guys,

    Blighter
     
  2. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    You are encoding with 2 passes?
    You have quants set to 1-31?
    Your 2nd pass is larger than your first?
     
  3. Blighter

    Blighter Regular member

    Joined:
    May 18, 2004
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    26
    I do 2 passes, i have quant set to H.264 (dno if that makes sense).
    2nd pass larger than first pass? I'm not sure what you mean - after my first pass it results in 2 files : video.avi (normally ~1.5meg) and and video.pass (normally ~1.5meg, but not same size as video.avi). My 2nd passes are aimed to be around 410000kb but end up being around 460000kb. Does this answer your question?

    Cheers, Blighter
     
  4. Blighter

    Blighter Regular member

    Joined:
    May 18, 2004
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    26
    Don't know if this makes a difference, but in the Zones box, (by default) it normally has a zone at frame 0 with Weight W 1.0, and I always delete this zone. Could this make any difference?
     
  5. Blighter

    Blighter Regular member

    Joined:
    May 18, 2004
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    26
    Also, i think i've figured out why my first pass is like 1.5 meg - the option "discard 1st pass" is enabled and "full quality first pass" is disabled.

    Any ideas?

    Blighter
     
  6. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    I meant the size the first pass would have been. The first pass is encoded at constant quant 2. If you set the 2nd pass to be larger than the first and you have the default setting on 1-31 for quants, then XviD has to insert quant 1's to try and hit the target file size (basically pad the video since quant 1's are generally just a waste). With the default overflow settings it sometimes inserts too many quant 1's, resulting in oversized video.

    If you have the quants capped to 2, then you just get an undersized encode (same size as 1st pass). This is the reason why the default was changed from 2-31 to 1-31. To stop people complaining about undersized encodes. End result? Sometimes you get people with oversized encodes. Still I don't know why you would want the 2nd pass larger than the first. Best way forward is to use a higher resolution if possible.

    Think you will find that you meant H.263, not H.264.
     
  7. Blighter

    Blighter Regular member

    Joined:
    May 18, 2004
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    26
    I'm afraid i don't know that much about encoding, but from what i gather, the "quants" you refer to are the things in the Zone box? Because I always delete them. I'll try it with them on.

    I understand what you're saying about it being oversized...but 50 meg oversized? How much undersized would it be if i changed it to 2-31. Also...how do i change it to 2-31 lol - i'm not quite sure what it is!

    Cheers Blighter
     
  8. celtic_d

    celtic_d Regular member

    Joined:
    Jan 23, 2005
    Messages:
    3,352
    Likes Received:
    0
    Trophy Points:
    46
    Perhaps this explains it better?
    [​IMG]

    How undersized, depends on the size of your first pass. As I said, the first pass is quant 2, so for the 2nd pass capped at quant 2 will also be quant 2's, so basically you should have enabled full qualtity first pass and not wasted your time on the 2nd. As I said the best way forward is to increase the resolution if possible. That way the 1st pass will be larger and hopefully your desired 2nd pass size will now be less than the first. Basically the quality you are aiming for is too low for the filesize. Another option is to use a higher quality quant matrix. MPEG or custom (depending on the matrix) will increase the size per quant.
     
    Last edited: Feb 17, 2006
  9. Blighter

    Blighter Regular member

    Joined:
    May 18, 2004
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    26
    That's quite interesting because i used MPEG quantization instead, and it hit the file size perfectly! I think that's going to be my solution from now on! Cheers Celtic_d!
     

Share This Page