Log in

View Full Version : LanczosResize messing up target file size


Wam7
26th June 2003, 11:49
I've recently started using Avisynth 2.5. I capture using VBLE 768x576 and then my script is as follows.

AVISource("24.16&17.VBLE.avi")
Crop(8,76,-8,-76)
Trim(1487,62824)
LumaFilter()
Convolution3d(preset="movieHQ")
UnFilter(-5,-5)
UnDot()
LanczosResize(640,360)


Now ever since I've started using the LanczosResize specifying the desired file size in Xvid 2 pass doesn't work accurately. Before I used the Lanczos rezise I would specify 313,000KB and end up with a final file of around 352meg and a bit rate of of around 1050kbps. Now no matter what number I put in I only get a file size of around 280meg with a bit rate of around 800kbps.

If I don't use the LanczosResize everything is fine. Is the LanczosReize3 in VDub the same thing as this seems to work OK but just takes longer?

I had this problem before but somehow got it work, now for the life of me I can't fathom out a solution

Malevolent
26th June 2003, 18:16
Hmm. I've been struggling with a Futurama episode all day, and now reading your post i just realized i've used Lanczos to resize instead of bilinear that i usually use. The episode is ~22 minutes, and with a script almost identical to yours (resize 384x288-target size 87.5mb) it maxes out @50mb. Not possible.
Xvid settings:

Motion search=6
HSV Good matrix
VHQ=4
Qpel
Chroma
B-Frames:
3
150
100
10

Just trying now if it goes better with Bilinear & some sharpening,
that 50mb result didn't look too good.



:devil:

Wam7
26th June 2003, 18:24
My settings are exactly the same except for No QPel & B Frames settings which are 2,150,75,0.

I would prefer to use the Lanczos to the Bilinear but let me know if that works OK. I will try the default mpeg matrix instead of HVS Good-Picure to see if that gives me the desired size/bitrate (1000+) instead of around 800kbps

manono
27th June 2003, 04:11
Hi-

Before I used the Lanczos rezise I would specify 313,000KB and end up with a final file of around 352meg

I'm not sure I understand. Why would you specify 313,000KB (=306MB) and be happy with 352MB (I'm assuming this is not counting the audio)? My guess is that you're using Packed Bitstream. If so, try unchecking that box and see if it doesn't come out closer to the size you specify. Also, if you installed a new version of XviD recently, make sure you Load Defaults and then reset them the way you want.

If the 352MB was with the audio, and you don't reach your desired filesize now, then perhaps you've maxed out the filesize and quality. To prove that, you could do a one-pass at quant 2 and see if it gets any larger. It has nothing to do with the use of LanczosResize. LanczosResize makes filesizes less compressible and larger, not smaller. I and many thousands of people use it all the time with no problems. Did you run a compress test before encoding to make sure that your filesize was attainable?

To make the filesize larger, try knocking off the B-Frames, and read Acaila's Sticky (http://forum.doom9.org/showthread.php?s=&threadid=24584) on undersized files.

Wam7
27th June 2003, 07:13
Yes you're correct about 306mb not including the audio. That's how Xvid works I believe.

No, I'm not using packed bitstream and I always load defaults when I start VDub.

I will try do a Q2 test but what do you mean run a compress test?

Thanks a lot for the pointers, I'll read Acaila's Divx5 sticky.

manono
27th June 2003, 07:30
Hi-

OK, so the 352 MB final video did include the audio. So I did misunderstand.

A compression test is run through Gordian Knot. It encodes a small portion of the movie (usually 5%) and will give you a good idea of the compressibility of a movie before you do the real encoding. It can save you headaches later on, such as getting lousy results when it doesn't compress well, or undersized files when it compresses too well.

A 1-pass at quant 2 will give you the maximum filesize and quality for the other settings that you use (such as B-Frames, resolution, and filters). You can actually do that when running the first pass by unchecking the "Discard First Pass" box in the Two Pass Tab. The best way for you to increase your filesize (assuming that it's been maxed out), is to cut down on the B-frames, or not use them at all. Next, maybe, would be for you to increase the resolution (but if you're working on a series, you may not want to do that).

Wam7
27th June 2003, 07:47
I'm just doing some test encodes now but tend to agree with you that I may have to increase the res. I don't want to really loose B-frames but it looks like I'll have to do some extensive testing to see what works best. Something you guys have already done! :) Thanks

Malevolent
27th June 2003, 09:29
Don't know what was wrong with my setup, but i couldn't get that beforementioned Futurma episode any better without changing resolution (it maxed @ 60mb without b-frames & no filtering - and i needed some filtering to remove unwanted noise). So i Uninstalled everything av related & then reinstalled, and now it maxes out @ 80mb with my original script. That's perfect, as target size is 87.5mb & audio takes about 14mb.

So Lanczos was definately not the culprit here, it was just a coincidense i started using it. And yes, i did know that it makes files bigger.

On a sidenote: i can't do any comp tests w/Gknot, it gives me 5-6 access violation errors & goes bonk. Since i've only rarely used it anyway, it's no biggie, but it IS a pain to do comp test with a full pass @ 2FPS/s ;) (i'm supersampling, thats why it's so slooooow)




:devil:

manono
27th June 2003, 12:49
...it IS a pain to do comp test with a full pass @ 2FPS

I'm sure if you ask Wam7 nicely, that he'll be happy to trade rigs with you. Kickass, that one.

Wam7
27th June 2003, 14:34
:). Well my 2.53 chip is on the shelf so he can borrow it, as I'm testing a 2.4b for a friend and that only goes to 3.35! ;)

I've done a test without B-frames and HVS-good matrix and the file size is spot on, back to 1029kbps. So your call is right. I will see if I can sneak in the HVS-good matrix now with out it noticing. Is it worth putting B-frames at 1 or playing around with some of the other settings? (Atlhough surely this is now an Xvid issue :))

Please convey my formal apologies to LanczosResize!

lamer_de
27th June 2003, 14:41
@Malevolent:
Where's the sense in supersampling when you use vcd like resolutions? It will most likely look washed out/has stairstepped edges when played at fullscreen anyway.

CU,
lamer_de

Malevolent
27th June 2003, 16:17
@Lamer_de:

Normally there wouldn't be, but in this one episode i got some baaad noise that just wouldn't go away, so i tried with supersampling & it's gone mostly. The result is fine, and the colors & edges are as good as they were. I wasn't blowing it up too much ;) Not that i even could with a 1.3 Athlon...