PDA

View Full Version : GKnot Compression Test with XviD (RC) ?


gatormac
10th March 2004, 02:31
Let me preface this post by saying that I know that this topic has been covered before, but there has been no definitive answer as far as I can see.

I use Gknot(0.28.7) to do a compression test before encoding in VDubMod(1.5.10.1). I know Gknot hasn't been updated to use the RC builds of XVID, but that is what I am using. I am getting strange results though. The results I usually get are very low....meaning the file looks super-compressible, even when I know they are not. That is when it works at all. 90% of the time it runs the check and nothing is output, regardless of whether or not I have discard first pass enabled or not, or even full pass enabled or not.

I would like to encode some stuff, but i feel like I am simply guessing at what filesize would be appropriate for my needs. i usually like to encode at an 80% or higher rate of the comression test, but like I said, unable to determine.

How can I do a good compression test? Do I have to go back to pre-RC builds of XVID? Will AutoGK work(I don't think so)? Is there a way to do a test outside of Gknot?

Also, does anybody understand the 1 pass option? I could possibly use that if there was a way to ensure that every frame was encoded to look excellent.....I don't care about file size.

Nic: (Edited the subject title, please make your subjects descriptive)

gatormac
10th March 2004, 05:44
OK, I just did a test run on a trailer that worked pretty well. Since I am not overly concerned with hitting a target filesize, but rather focus on quality, I set a target filesize of 500MB (for a trailer that I would normally target at 40MB). The resulting video was 67MB with excellent quality.

I thought if you set the filesize too high that it would introduce artifacts, but it seems to have cut off the bitrate at what you might consider "maximum quality". So if I set a target bitrate of 3GB for a movie I should get a "maximum quality" encode, probably with a filesize around 1.5 to 2GB.

Am I anywhere close in my assumption/logic?

aaar9800
10th March 2004, 05:48
just do a constant quant=2.0

That is "perfect" quality and requires just one pass

gatormac
10th March 2004, 06:34
Yeah, I just realized that the XVID file was larger than the VOB....what would be the point in an 8GB XVID file

:o

Zom-B
10th March 2004, 08:10
@gatormac

To get the compression Test work you have to uncheck the "discard First Pass" option in your Xvid configuration for the Test!

DarkDudae
10th March 2004, 16:17
@gatormac

ARCalculator is able to do a comp. check with XviD 1.0

Regards

gatormac
10th March 2004, 18:17
To get the compression Test work you have to uncheck the "discard First Pass" option in your Xvid configuration for the Test!

I already do that, but I get inconsistent results. Sometimes it works, most of the time it doesn't.

ARCalculator is able to do a comp. check with XviD 1.0

I did not know that! Thanks for the tip DarkDudae:)

gatormac
11th March 2004, 00:37
ARCalculator looks promising, but isn't very user-friendly IMO.

I also tried the manual method with some success. A thought however:

There is no way to do a compression test that takes zones into consideration. Doing it manually, you can set your zones, but the average delta frames (I think?) are only affected by the constant quantizer that you set. The same goes for ARCalculator. The problem with this is that, lets say for example, you set a quantizer of 2 and get 80% at 20000KB. You then encode the video with a target of 20000KB, but also set a zone with a Q of 1 on a difficult scene. The difficult scene gets encoded at a Q of 1 and looks very good, but the rest of the video has too low a bitrate and looks like crap. Same for having zones with a lower Q or weight, just with the opposite effect though--instead of not having enough bits to go around, you have too many that are wasted where not needed.

I noticed this by doing a test encode using both ARCalc and the manual method....both had similar results. I did a compression test on a Saving Private Ryan Trailer with a zone (the size of half of the trailer) set to a Q1 (I know this is overkill, but I like to use Q1 zones for difficult scenes). The compression test gave me a target video size to shoot for, I encoded it with the same XVID settings and zones(except 2 pass defaults). The video was super blocky and pixelated, except for the Q1 zone which looked beautiful.

For those of us (am I the only one?) who like to improve certain scenes with a zone setting without decreasing the quality of other zones, it would be helpful if a compression test could be done that took into account the zones instead of focusing only on the quantizer that was set for the entire video. If this has already been done, forgive me for wasting everyones time, I just haven't been able to do it with the methods discussed here.

The manual method talks about finding the "predicted size", which is the average delta frame size of the compression test file multiplied by the number of frames. It then tells you to take the target video file size and do a simple calculation:

(100 * Target Video Size)/Predicted Size = compression%

To find a target filesize for a certain percentage (I like 80%) I just mix things up a bit:

(Predicted Size * Compression%)/100 = Target Video Size

If someone wants to shoot for an 80% encode, the only factor that can change quality is the delta frame size, which is only affected by the quantizer that is set when you do your compression run. To get a more accurate (and efficient) target filesize/bitrate, wouldn't the equation to find the average delta frame size need to take the zones into account? I don't know how it would be done as I don't know how the average delta frame size is found, but instead of having every frame set with a constant Q

Frames = 3000
Q = 2
Delta frame size = X

Take into consideration the zones

Zone1Frames = 1000
Q = 2
Zone1Delta = X

Zone2Frames= 1000
Q = 1
Zone2Delta = Y

Zone3Frames = 1000
Q = 20
Zone3Delta = Z

AverageDeltaFrameSize = (X + Y + Z)/3

This is just to illustrate what I mean....nobody should ever take my math logic seriously, but you should get the idea of what I mean.

Is this possible? Has it already been done or is somebody planning on doing it? Am I a freaking idiot? :D

gatormac
12th March 2004, 00:33
Am I a freaking idiot?

Since nobody has answered I will take that as a yes:p

I have reinstalled the version that comes with Gknot as it gives great quality and accurate compression results. I will come back to 1.0 when the final is released and Gknot is updated....which should be any day now, it is ready.