Problem with size on 5.02 Divx codec in VirtualDub

Discussion in 'DivX / XviD' started by pennynike, Jun 25, 2002.

Thread Status:
Not open for further replies.
  1. pennynike

    pennynike Member

    Joined:
    Jun 23, 2002
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    11
    I followed the guide to creating a Divx file with 5.02, but I keep getting files that are around 1.2 GB to 1.28 GB. I want a file that is 1.4 GB. No matter if I increase the bitrate on the movie, I get the same size. Of course I am using the 2 pass aproach, and yes I followed it correctly. Can anyone help me?
     
  2. dRD

    dRD I hate titles Staff Member

    Joined:
    Jun 10, 1999
    Messages:
    8,312
    Likes Received:
    191
    Trophy Points:
    143
    DivX5 has some serious problems with respecting the bitrate -- problem is not that you would get too big files, but the opposite. And this normally happens only with large bitrates (over 1000kbps) -- somehow the DivX "saturates", e.g. it has achieved the best quality what it thinks is possible to achieve and can't therefor "spend" the rest of the bits you've assigned to it.
     
  3. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    dRD, is there any way around this, or some sort of fix? It sounds like a pretty big problem. Or should I just settle with the smaller file?
     
  4. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    Sorry for the second reply, but lemme ask you something: will encoding at a higher resolution add more quality/make the file bigger? I know it sounds silly that I want to make the file bigger, but if it's bigger than 700 MB it might as well be 1400 or as close to it as possible. How about, if instead of resizing it to 640x272 after cropping, I do it to 720x304? I'm trying to properly encode gattaca onto 2 cd's. I saw on Kazaa a gattaca divx file with a resolution of 720x320. That's not the optimal resolution for the 2.35 aspect ratio, 720x304 is, but can I encode at a higher resolution? The guide only covers resolutions with a width of 640. Can you give me any advice on encoding with a higher resolution?
     
  5. dRD

    dRD I hate titles Staff Member

    Joined:
    Jun 10, 1999
    Messages:
    8,312
    Likes Received:
    191
    Trophy Points:
    143
    Yes, higher resolution would require more data from codec and therefor would result in bigger filesize. You can also increase the audio bitrate to 192kbps or higher (or even go with AC3 audio and mux it with AVI using NanDub after your encoding has finished) to add data to the video file.

    Or alternatively, like I said in other post, you can try other MPEG-4 encoders, namely XviD.
     
  6. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    If I'm going to encode in a higher resolution:

    1) will it necessarily look any better?
    2) what resolution do you recommend? If I had no advice I would pick resizing it to 720x405 and then cropping the 405 (height) to 304. How does that sound?

    There are a couple of problems that I anticipate with that resolution: first of all 640x272 (2.35294:1) is much closer to the "true" aspect ratio of 2.35:1 than is 720x304 (2.36842:1) will that slight difference be noticable? Since I have all that space to spare anyway (trying to fill 2 CDs) should I use an even higher resolution? Will using a higher resolution result in better visual quality? Since I want to share my rips over Kazaa, I'm not going to make the files bigger just so I can fit them fully onto a CD, if there won't be any visual improvement. But as long as there is some improvement, I'd like to make the file bigger. So will a higher resolution make it look better, and if so, what resolution do you recommend?
     
    Last edited: Jul 9, 2002
  7. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    Oh I just realized...720x405 is the resolution before cropping, so this will determine the aspect ratio. Even though I'm cropping it down to 720x304, and this is not *exactly* 2.35:1, it won't distort the image. I'll just have either a little too much black above and below the picture, but the image itself will not be distorted. Thanks for giving me time to figure it out myself...I probably understand it much better because of it :)
     
  8. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    Hmm, but now I have another problem. It's a problem that didn't happen before, I don't know what the cause is, I hope it's not because I installed XviD. I already uninstalled it, but I still have the problem.

    First of all, on the resize filter, there is only one "precise bicubic" option not 3. There used to be three, and I selected the one that said .75 or something. Now there's only "precise bicubic" without any number.

    Here's the other problem. I have three filters. First there's the deinterlace filter. Then the resize filter. When I set resize to 640x360 and hit preview, the image/aspect ration looks perfect. But then when I go to the null transform filter, and hit clipping, it displays the image still in 720x480 (the native resolution of this DVD I think). When I crop it, it seems to need about 60 on top and 60 on bottom, which is not what it needed the last few times I tried to encode it. (Last few times it was 43 on top, 45 on bottom, for a total of 88, which when subtracted from 360, equals 272, as in 640x272, which is what it should be). But the cropping/clipping doesn't display it as if the resize filter was applied, it displays it still in 720x480, so everything is messed up.

    And yes, in the filter order, I made sure "null transform" was after resize. Resize says "Resize 720x480 640x360" (original and final resolutions). But null transform says "640x360" as the resized resolution, which is what it's supposed to say, but when I go to crop it, it's not in that resolution.

    Also, even though I added the deinterlaced filter, when I go to the null transform filter to crop it, the frames aren't deinterlaced. It's like the null transform filter is ignoring the other filters. What gives?

    Any advice?
    =======
    I even tried resizing it to 360x360 just to do something extreme, but when I went to the null transform filter, it still showed it to me in 720x480.
     
    Last edited: Jul 9, 2002
  9. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    Ok, I realized part of the problem, I was using an older version of Vdub.

    But even in the new version, it can't seem to properly manipulate the video when the resolution is resized to 720x405 from 720x480, which according to my math should be a comparable resolution to 640x360 (same ratio of 16:9). And when I do 640x360 it looks good, but if I try a higher resolution like 720x405 nothing seem to work right. Any help?
    ===============
    I don't want to keep adding new posts to the board, and I'm pretty much talking to myself here, so I figure I'll just edit my post to add my latest discovery.

    It seems vdub has a bug. Since I was resizing the image, but I wasn't changing the width (720) it was acting funny. I tried 800x450, 836x414, and even 1600x900 all of which have a 16:9 ratio, and they are all working fine. It seems the problem lies with Vdub and the bug is that if you resize without changing one of the dimensions (or maybe just the width) it won't resize properly.
    ===
    It seems that the ideal resize resolution is 752x423 (exactly 16:9) and after cropping 752x320 (exactly 2.35:1) this is ideal because it is exactly 2.35:1 (unlike 640x272 and others, which are close to 2.35 but not exactly) and also both 752 and 320 are multiples of 16. There's something magical about this resolution, for 2.35:1 aspect ratio films anyway.

    Can anyone confirm or deny anything I'm saying here? Please respond.
     
    Last edited: Jul 9, 2002
  10. sokristi

    sokristi Guest

    I use VirtualDub same way as you (did). Resize to 720x405 and then crop with null transform filter. My experience is that the distortion is only a problem with the preview screen, so what I usually do is make an educated (I've ripped quite a few movies by now:) guess as to how much to crop from top and bottom. I then use the video output screen in VD's main screen to check if I "hit the sweet spot". If not, I'll just return to the filters' setup and do some adjustments.

    If you can't easíly see the output video on the main screen, just use "swap input/out panes" in the "options" section.

    I'm not sure if your enlarging the movie as compared to the native resolution is really good for quality. What are your experiences in this field?

     
  11. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    I think you're right about what you said about increasing the resolution above the native resolution. I just came back from school, to find the XviD encoding complete, and while it's a really great (acceptable) version, I'm not overwhelmed by it. At first I thought it was XviD's fault, despite the good things I read about it, but now I realize it could very likely be because I increased the resolution above the native resolution.

    Right now, XviD is churning out a new one. I see what you mean when you said it only affects the cropping screen, not the actual video, and that's what I suspected, but at that point (yesterday) I was to confused to assume that. My learning curve is very steep...it takes me a while to start understanding something, but after a while I very quickly grasp it.

    Anyway, I see what you mean about taking an educated guess on how to crop it, but I had an even better idea. I resized it to 721x405, which made it display properly in the cropping window, then cropped the 405 height down to 304, and then changed the resize back to 720x405. Such a small difference in width, of one pixel, didn't affect the 304 that I got in cropping it (if you do a substantial resize (more than a couple of pixels) after cropping it, the cropping numbers are changed by taking into account how you resized it).

    So, it should be done about 1 am, I'll be back to report how it went.

    Sokristi, do you use XviD or DivX 5?

    I'm not sure what produces a better result, even though I hear XviD is just as good, but one thing I like about XviD is that you can pick the exact size of the resulting video file (without audio), instead of messing around with bitrate calculators, especially since DivX 5 ignores your bitrate above a certain threshold.

    One thing that's bothering me slightly is
    that XviD doesn't have Quarter Pixel, GMC, or Bidirectional Encoding options, not that I know what any of those things mean, but apparently XviD doesn't employ these techniques, while DivX 5 does, and the afterdawn guide recommends that they be checked off. What are those options exactly, and do they significantly affect video quality?
     
  12. sokristi

    sokristi Guest

    Actually I have been using both XVID and DivX5(.02)
    Possibly the main reason for afterdawn guide to recommend turning B-Frame, GMC and QP off is the fact that at least QP was faulty in earlier versions (5 and 5.01) of DIVx(?)

    I have checked with Doom9 (http://www.doom9.net) as well. His recommendation at this point is "To summarize: You should activate GMC and Bidirectional Encoding, but not Quarter Pixel." From what I've read I believe B Frame/bidir encoding is possibly the most interesting option if your aim is high quality. Xvid will soon include those options. The developers claim they have already written the basic code, only it is still a bit flaky and rather slow, so not included in released versions:)
    For lower bitrates I always go with Xvid, simply because I like the end result better. Xvid is also a bit faster - at least on my computer.
    If you want predictable filesize Xvid is your choice. (When/if Fair Use evolves you may want to go for that in stead.)
    My preferred way of doing things these days - in case you're interested - is:
    Rip movie with Smartripper
    Project file and demux audio to AC3; DVD2AVI
    Convert AC3 to Wav with Headac3he
    Frameserve with VFAPI (convert DVD2AVI project)
    (I'm playing around a little bit wit Avisynth and the MPEG2DEC dll for frameserving. Looks promising; is faster than VFAPI)
    Encode with VirtualDub and either Xvid or DivX5 2-pass. (Mostly Xvid)
    Since most of the stuff I rip is not Danish I usually also produce sub-titles with VobSub for later use with DirectVobSub filter.
    (well, now it's there, even if you're not interested:)
     
  13. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    Sorry I wasn't clear. The afterdawn guide says that GMC QP and bidirectional encoding should all be enabled.

    It says it should be enabled, but XviD doesn't have these features, so am I missing out by skipping these features?
     
  14. dRD

    dRD I hate titles Staff Member

    Joined:
    Jun 10, 1999
    Messages:
    8,312
    Likes Received:
    191
    Trophy Points:
    143
    You're not missing much -- bidirectional is only one that really makes picture look better, but then again, by using XviD, you can produce higher bitrate which should more than make up the difference.

    So, encode clip with XviD and encode it with DivX5 and judge yourself.
     
  15. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    I just finished encoding in DivX 5. The filesize is 894,000 KB. I tried comparing it to the XviD file I encoded which was 1,374,000 KB. To be perfectly honest, I can't see any difference. Generally I have a pretty discerning eye to video artifacts, but I can't tell any difference. In fact, I'm sort of inclined to say the DivX one is better. So maybe the file size limit is smart, maybe DivX knows it wouldn't look any better if it were bigger. Or maybe DivX is just that much better and if the XviD one was 897,000 KB it would be even worse.

    Now, I'm trying to rip the perfect divx/xvid rip, so I'm gonna need your help. There are black bands on each side of the image that I'd like to crop, but I don't really know how, as the guide says I shouldn't and they don't really get into it. Can you explain to me how to do it?
     
  16. dRD

    dRD I hate titles Staff Member

    Joined:
    Jun 10, 1999
    Messages:
    8,312
    Likes Received:
    191
    Trophy Points:
    143
    If you have black bars in right/left sides, I suggest you not to crop them -- this is because

    a) video's width and hight should be multiplies of 16, so you need to crop at least 16px off

    b) If you have anamorphic movie that requires resizing in the guide, the problem is that your calculations (to determine accurate height based on the aspect ratio and width) become more difficult if you crop into some illogical resolution
     
  17. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    When you say anamorphic, do you mean 16:9, because as I understand it, anamorphic means that it can display 16:9 at full resolution (pixels aren't wasted by showing black bars) in other words it can be shown on a 16:9 screen at full screen without loss in quality.

    So I don't think this DVD is anamorphic. Anyway, what will happen wrong if the resolution if not a multiple of 16? according to virtualdub, the restrictions of DivX 5.0.2 is that "Height must be a multiple of 2; Width must be a multiple of 4" it doesn't say it has to be a multiple of 16.

    I checked all the movies that I've ever downloaded, I have about 35 GB, and none of them have black on the sides whether it's 16:9 or 2.35:1 or whatever, none of them have black on the sides. Why should one that I'm making myself?

    There *must* be some way to properly crop the black on the sides.
     
  18. dRD

    dRD I hate titles Staff Member

    Joined:
    Jun 10, 1999
    Messages:
    8,312
    Likes Received:
    191
    Trophy Points:
    143
    Sure, you can crop the black areas, but you need to keep the aspects intact, so just take your calculator and try it. Problem is really that it gets tricky.

    And even that DivX states the restrictions like that, their website, readmes and general knowledge says that it should be multiplies of 16, because hardware acceleration doesn't normally work otherwise and lots and lots of problems might/will/often do occur if you try something else.
     
  19. dRD

    dRD I hate titles Staff Member

    Joined:
    Jun 10, 1999
    Messages:
    8,312
    Likes Received:
    191
    Trophy Points:
    143
    The problem actually is this:

    You have resized your video to match the aspect, OK. Then you start cropping. But the thing is that our guide states the 640 width for reason -- it's a resolution that your computer has and therefor you can change your resolution down to that one and playback the movie without software resize in full screen. But if/when you crop this down to, let's say, 632, you lose this feature. But up to you, totally.
     
  20. kmart

    kmart Member

    Joined:
    Jul 9, 2002
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    16
    I'm really confused about cropping. Will cropping ever change the aspect ratio? I mean, I realize that it is changing the resolution, but doesn't what you crop just get replaced with black, not actually resize the image?

    I get what you're saying, but then why is it that not a single one of the divx that I've collected have black on the sides? There must be *some* way to do it, I mean seriously.
     
Thread Status:
Not open for further replies.

Share This Page