View Full Version : low compression - high quality - xvid question
smallbrain
9th April 2007, 09:41
low compression - high quality - xvid question
Dear listers,
concerning high quality encodings I am wondering if I follow the right strategy.
My source video is 8,75 Gigabytes. As it should fit on one DVD-R my target size is around 4700 000 000 Bytes.
Target use is my computer.
Compatibility target is xvid-only, MPEG4 is not needed.
Therefore I am using the unrestricted profile using the target size above.
Doing a two-pass-encoding and keeping a full quality first pass shows me a 1,84GB first pass.
Obviously, the target is approx. 2,5x bigger than the full quality first pass.
Does it make sens to have xvid encode such a big video compared to first pass size by just applying a target size?
I assume that in typical cases targets are smaller than first pass size.
Do you recommend special xvid settings that reproduces most of the quality of the source given such a big target?
Any kind of reply appreciated.
Thank you.
foxyshadis
9th April 2007, 09:58
Check out the >90% presets in the presets thread (http://forum.doom9.org/showthread.php?t=119399). You get a higher quality custom matrix and b-frames, which will boost size and detail retention. Even then it might not hit your target, but whatever you get out of it will most likely be beyond your threshold to compare quality differences (anything higher is mainly suited to editing & recompression).
hellgauss
9th April 2007, 10:09
You will probably don't notice differences between a 1.84GB file and a dvd5 file.
However here some fast tips for rising quality a bit, with very higher filesize. Click 'load default' in the vfw interface, then
1)Remove bframe
2)Remove trellis quantization
3)Use a custom matrices (or change h263 matrix in mpeg if you don't want to use a custom matrix, that gives more quality at high bitrate than h263)
4)I don't know if it applies to this case (i need to know more about source type and how it is preprocessed), but don't downsize the source. Use AspectRatio switch in xvid to set the proper AR, don't resize.
EDIT 5)Use quarte pixel
Then do a 2pass encoding with target size or 1pass fixed quant q=1.8 or less (less q=higher filesize).
Teegedeck
9th April 2007, 14:17
I go with foxyshadis on this one. ;)
1)Remove bframe
Crude, but effective.
2)Remove trellis quantization
Definitely won't help.
3)Use a custom matrices.
Good idea, but which one? I would recommend SixOfNine or even EQMv3EHR.
4) don't downsize the source. Use AspectRatio switch in xvid to set the proper AR, don't resize.
YES! Exactly!
EDIT 5)Use quarte pixel
Yes.
1pass fixed quant q=1.8 or less (less q=higher filesize).
Definitely won't help. The occasional quant=1 won't make it look better. Quant=1 is a waste of space that doesn't help quality at all.
Better use the >90%-preset; it's easier and gives you about the best picture-quality attainable with XviD.
Rule #1 is of course - as hellgauss said - 'DON'T resize!'.
Manao
9th April 2007, 15:46
If you don't resize, please, don't use QPel either. It really hurts the quality.
Instead of wanting to fill 4.7 GB with one movie, why don't you try to put two of them ?
Sharro
9th April 2007, 18:06
If you don't resize, please, don't use QPel either. It really hurts the quality.
Manao you're here for way long time and been always a good source of knowledge... could you better explain that statement about QPel ?
Searching for QPel in the forum is pain and I can't find threads supporting what you say.
All the best,
Sharro
Sharro
9th April 2007, 18:11
Teegedeck
Better use the >90%-preset; it's easier and gives you about the best picture-quality attainable with XviD.
Rule #1 is of course - as hellgauss said - 'DON'T resize!'.
If you're targeting such a big filesize the 90%-preset used with Heini's6o9 matrix will look slightly better (better grain retention) but we are already talking of differences that you can only distinguish if you compare them frame by frame and that's not the way to watch a movie :D
Just my 5 cents.
All the best,
Sharro
Manao
9th April 2007, 18:36
About Qpel without resizing. I tried on a mpeg2 video, with and without resizing, and with and without qpel. I checked the results at constant quantizer with PSNR & file size. Without resizing, in order to achieve the same PSNR, the qpel file had to be 10% larger. With resizing, it was the reverse.
Now, here is what I think is happening : XviD, since it's a mpeg4 codec, shares the same hpel interpolation as mpeg2 codecs. Tha allows XviD to take encoding decision very close to the mpeg2's one, with a great efficiency boost.
If you resize, however, you can't anymore take the same decisions. hpel and qpel are put back on the same level, and qpel is naturally more efficient ( especially when the video is downsized ).
It would need some confirmation - I tested that only on two videos, and, afaik, I'm the only one to say it, though the few times I did nobody seemed to contradict me - so you are welcome to make your own test(s) to (con/in)firm it.
Especially, perhaps cropping by a non mod16 or even non mod8 value might invalidate my statement, since it misaligns macroblocks.
Teegedeck
9th April 2007, 21:51
Please don't use PSNR as a total-quality indicator. For example a high VHQ-level is good for PSNR but for the kind of high-quality encoding that we talk about here VHQ=4 is absolutely forbidden because it would 'optimize away' finest details. So PSNR is not a good tool for measuring quality; especially in this case.
To my knowledge, qpel is always bad for PSNR, no matter whether you resize or not (can you reproduce that experiment with other sources?) but in most situations it is good for subjective quality. (Not always though.)
XviD as an MPEG-4 encoder makes decisions completely different from those of an MPEG-2 encoder in any case (their b-frames for example carry different kinds of data; MPEG-4 GOPs are considerably longer etc.); resize or no resize, hpel or qpel.
*.mp4 guy
9th April 2007, 23:38
I have to agree with Manao on this, at high bitrates Qpel only adds ringing unless you have downsized the source by a considerable margin, I haven't done any imperical tests, but thats what my eyes tell me.
Manao
10th April 2007, 06:07
Teegedeck : qpel isn't always bad for PSNR ( see my post ). Furthermore, I do state clearly in which cases my observations were made. If somebody has to test further, I wish it wouldn't be me, else it would change nothing to the present situation : I would be the only one to talk about the possibility that qpel is completely useless when you don't resize a mpeg2 video.
Teegedeck
10th April 2007, 09:07
That's very interesting indeed - would someone volunteer to conduct a series of tests and post some screenshots? I'm far too busy this month to do it myself, I'm afraid.
smallbrain
10th April 2007, 23:10
Dear foxyshadis and hellgauss,
First of all, thanks a lot for your immediate responses!
My idea was to post a question and hope for a response within the next days. I couldn't foresee I would get two answers within half an hour!
@foxyshadis:
Will have to learn a little bit reading the 90% thread stuff.
Thanks for pointing out the direction.
@hellgauss:
Concerning "1)Remove bframe" I understand that removing b-frames will force the use of big p-frames instead. I can't imagine yet why this increases quality (I am still at beginner level).
Regarding "3)Use a custom matrices (or change h263 matrix in mpeg...", I already switched to mpeg-matrices, but don't want to use other custom ones before I understand more how they work.
Ad 4): My source is a VHS or S-VHS camera recording from somebody else. I digitized it using a Terratec Cameo Convert which is an external box connected by firewire cable to the PC. The box behaves as if it was a DV-camera, delivering a fixed 720*576 resolution with 25 fps what I recorded into an avi container. I don't downsize.
Preprocessing is as folllows:
video=avisource("test.avi")
cropped=crop(video,4,0,-12,-8)
return cropped
Ad 5): I want to try the the 1pass fixed quant.
Should I fix the quantizer using the "Zone options" menu?
Best regards.
smallbrain
smallbrain
10th April 2007, 23:39
That's very interesting indeed - would someone volunteer to conduct a series of tests and post some screenshots? I'm far too busy this month to do it myself, I'm afraid.
I am willing to but as a newbee I need more detailed instructions than others.
Hardware: P4 2.8 GHz Northwood, 1GB Ram
Software: Virtualdub driving xvid and x264. Avisynth installation.
Teegedeck, do the members have a common reference DVD with all kinds of tricky videos? Or does everybody test his personal stuff?
Teegedeck
12th April 2007, 15:56
Sorry for the late answer, I'm very much taken up by other things this week.
Unfortunately, we don't have a set of reference-videos, so a tester is pretty much on his own. You could use the 'XviD presets' with and w/o qpel on a resized and on a unresized version of the same clip. If you want to compare results by simply watching them in sequence, the video clips should be a very short; no more than 3 seconds - because beyond that you'll start believing that you 'remember' how the start of the clip looks. It's better to keep it short. My preferred method for comparison is a splitscreen or stacking windows vertically via an AviSynth script that loads the encodings via direcshowsource. Perhaps I can find those again, at the weekend, when I'll have some more time.
There even is a software for doing double-blind-tests but ATM I'm all forgetful. Is someone out there who knows which software I mean?
movmasty
29th April 2007, 20:05
Originally Posted by hellgauss
4) don't downsize the source. Use AspectRatio switch in xvid to set the proper AR, don't resize.
YES! Exactly!
And what do you think about upsampling? i do constantly with my low res sources, and the result is very better than resizing with the player, inside certain limits of 15-20%.
Especially when it comes to correct the pal/ntsc or anamorphic ar.
eg. you can resize 704/576 to 768/576,
or correct an anamorphic PAL enlarging orizzontally by 25% and reducing vertically by 6/7,
or appling both sides a 6/5 resize, that is very near to anamorphic resize with round simple ratios,
use lanczos naturally.
Smallbrain you dont even tell us what are your settings for the first pass,
if you used B frames and how many ,if you used any VHQ, I frame interval, Trellis, adaptive ecc...
Know that you could bring your size also over 10G, but quality wont Follow.
But lets say that you like an unique movie per dvd...
try do do a first pass in this way
1)open levels filter, set input levels to 10/25 - 1,10/1,15 - 220/240
2)Crop 16 pixels orizontally, vertically as you need,
3) resize width to 768 with lanczos
4) open custom matrices in profile, find one with values of 11-12 in the upper left corner on the left, on the right all 16,
5)uncheck B frames and adaptive
6)set one zone to Quant 2
7)set I frame interval to 75-50
8)uncheck trellis
9)motion search to 5 or 4
10) no VHQ.
What is the size now?
If still undersized, there is alwas the quantizer 1, that is not that bad for storage, you could reconvert your movie again...
and you could set I frame interval to 3 or 2 or1....
Blue_MiSfit
30th April 2007, 20:26
Dude. Don't fix quantizers, and don't use Q1. Q1 is only there to pad filesizes so that people hit their size targets. It's been said a million times, it won't improve quality.
Undersize is a silly topic. If you're saturating the codec (q2 pframes) and its not "big enough" (whatever that means), then use a high bitrate matrix like Didee's 6of9 or Sharktooth's EQM-v3hr, maybe add some sharpening in AviSynth if you want, and maybe use just 1 bframe and no VHQ.
Don't bring Q1 into the mix, and don't reduce motion search precision. Frankly I don't movmasty's methods hold much merit, but that's all IMHO :) I don't mean to sound nasty.
~MiSfit
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.