View Full Version : XVID Compressibility Test
norlane
14th March 2011, 06:44
Is there any way using MPEG-2 format with AviSynth file as input to do a compressibility test usng xvid codec .
To obtain the best bitrate etc.
I searched a bit but could only find the app below which is not developed any more for vdub.
Enc v1.03
make a size prediction at a given quantizer and make a compressibility test
Needs VirtualDub for working (the latest VirtualDubMod version is strictly required if you are going to use size prediction or compressibility test).
http://jonny.leffe.dnsalias.com
With the compressibility test function you are able to predict the quality of your encode, before making the real encode.
The result is a % value, to obtain good results you should stay in the 50%-60% range (the range is not objective, you should make experiments to see what you like more).
If the result is too low, you can change resolution, resize filters, codec parameters, use more cds in order to obtain an higher value.
yetanotherid
14th March 2011, 08:07
I'd use AutoGK to run the compressibility test but it'd have to run it on the mpeg2 file directly, unless.... you wrap the script into an AVI using http://codec.kiev.ua/codec/avs2avi_Wrapper_CODEC.htm. It wraps the script into an AVI which AutoGK can then open. There's also a similar program called MakeAVIS which comes with the standard installation of ffdshow.
An alternative would be to use HDConvertToX as I'm pretty sure it'll open the script directly and it's one of the few currently developed (maybe the only one) conversion programs still capable of running a compression test. You can even change the percentage of the video on which it runs the test.
"The result is a % value, to obtain good results you should stay in the 50%-60% range (the range is not objective, you should make experiments to see what you like more)."
Using AutoGK the default quality for a single pass encode is 75% and it's also what I aim for using a 2 pass encode as it's supposed to be the percentage which gives the optimum quality/file size ratio (although some will say the figure is 70%, which could be correct). From memory, that works out to a CQ of 2.7 (when using HDConvertToX you specify a quantiser rather than a quality percentage).
Of course the ultimate compression test is running a full single pass encode, but of course it also takes a lot longer, but I always find myself not being able to help myself so I have to ask..... any reason for running a compression test, or is there any reason for picking a target file size? If there's no need for a particular file size then a single pass encode at the desired resolution and at 75% or CQ 2.7 will give you the same quality without the need for messing about running compression tests and having to run 2 passes. You just don't know what the file size will be in advance.
norlane
14th March 2011, 19:22
thankx for this.
there is no need for a particular file size i just wont to obtain the best quality i can and l believe that equates to the right bitrate thus file size.
However i am just learning this
henryho_hk
15th March 2011, 04:42
Perhaps you can try my batch script http://forum.doom9.org/showthread.php?t=119500
norlane
15th March 2011, 09:12
awsome thankx for the batch script will work on this
yetanotherid
15th March 2011, 12:20
thankx for this.
there is no need for a particular file size i just wont to obtain the best quality i can and l believe that equates to the right bitrate
Kind of, but the bitrate and therefore the file size is determined also by how hard the video is to compress. A video with a lot of action will usually need a higher bitrate and therefore the file size will be larger for a particular quality relative to the original DVD. It could result in a file size anywhere between 600MB and 2GB for a typical DVD encode.
When picking the quality and running a single pass encode the file size is the unknown factor. By picking a file size you're effectively picking the quality, only you don't know what it'll be until you at least run a compression test. The first pass of a 2 pass encode is (as far as I know) pretty much the same as a single pass encode. Only instead of encoding as it goes, the encoder works out how to distribute the bits to give you a consistent quality throughout the video according to the file size you chose (the total number of bits you've told it to use).
To be honest if you want the best quality possible and plenty of freedom to write your own AVISynth scripts, a program such as MeGUI and encoding using the x264 encoder would be the better option. As long as you're not needed to end up with an XviD/AVI for a particular reason, although MeGUI (and HDConvertToX) will both encode using the XviD encoder too and both will let you modify or add to the AVISyth scripts they create.
norlane
15th March 2011, 21:12
Thenks for this have used x264 and placed "2>&1 | "logger.exe" -filter "x264 [info]" -invert : " in my bat file which gives me the log file with quants and rate factor
so i can up or down with the bitrate to get the right range for these values and the quality with x264 is my favorite.
Just wanted to work out the best bitrate,matrix, ect for xvid codec,avi container, using vdub .. So if i do a single pass picking a quality level in vdub.
I should get a bitrate for that quality that i can use in a 2 pass encode approximatly.
This is what we are trying to obtain the right bitrate like i can with x264 reading the log file quant and rate factor values.
Thankx for your replies
yetanotherid
16th March 2011, 01:59
Thenks for this have used x264 and placed "2>&1 | "logger.exe" -filter "x264 [info]" -invert : " in my bat file which gives me the log file with quants and rate factor
so i can up or down with the bitrate to get the right range for these values and the quality with x264 is my favorite.
Why not just preselect the CRF and let the bitrate/quantiser take care of itself? Most conversion GUIs let you specify a CRF value for a single pass encode.
Just wanted to work out the best bitrate,matrix, ect for xvid codec,avi container, using vdub .. So if i do a single pass picking a quality level in vdub.
I should get a bitrate for that quality that i can use in a 2 pass encode approximatly.
I don't use VirtualDub for encoding myself but if you can pick a quality level and run a single pass encode, then yes if you then run a 2 pass encode using the same file size you should end up with exactly the same quality. Which begs the question.... what would be the point of the 2 pass encode when you've already run the single pass encode?
This is what we are trying to obtain the right bitrate like i can with x264 reading the log file quant and rate factor values.
I don't think I've ever used VirtualDub directly to encode a video myself, but using most modern encoder GUIs you'd simply pick the CRF value you want, let the encoder to it's thing and everything else will take care of itself.
The only time I've ever checked the log file for the second pass CRF value is on the rare occasion I've needed to specify the file size for some reason. Normally I just run single pass encodes at a specific CRF value.
norlane
18th March 2011, 22:36
thankx going to try the batch script now !
See if i can start of with a basic batch script.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.