PDA

View Full Version : This target file size thing.....


yetanotherid
21st April 2008, 18:18
This target file size thing.....

This post turned out to be a real scroller. I'm sorry about that, but I did some experimenting with converting and output file size, and am after an opinion as to what's going on, so I posted as much information regarding the different conversions I've done as I thought I'd need to.

First off, I'll admit I'm frighteningly new to the whole ripping DVDs to AVIs exercise. In fact my first rip was only about 6 days ago, although I've done many since then. I'm using AutoGK and have experimented with different versions of the XviD encoder, and aside from the file size issue which is the purpose of this post I've been very happy with the results. Most of the time, the quality of the output file has been superior to 99% of the AVI's I've downloaded. It makes me wonder why so many people seem to manage to produce such average quality rips.

Anyway... my first rip was with using AutoGK 2.8 (which I'm still using) and the XviD decoder that comes with it (or with version 2.5 of AutoGK to be exact). It was nowhere near the target file size I specified. So I read through this forum looking for answers but don't know if any of them are applicable, as I'm not sure simply "tweaking" settings is the answer. Plus I don't want to fiddle with something I don't understand, given that I assume the purpose of using AutoKG is because it'll make better decisions than I could. I tried a different version of the codec and hit the target size exactly, but the next rip (same input vob) was a mile off again. So I tried to carry out a bit of an experiment with different versions of XviD and found the results interesting. I used the same version of AutoGK each time (2.8) and between each rip I uninstalled the version of XviD I'd just used, removed all XviD traces from the registry, made sure all XviD's files were really gone from the hard drive, and rebooted the computer between rips if that's what I needed to do to make sure the previous version was completely gone. I didn't touch any of the XviD codec settings before any of the conversions, letting AutoGK handle everything (which I assume it does anyway so I didn't want to do anything that might have interfered with it working properly).

For the experimental conversions I ripped a small vob to my hard drive, and used that same vob each time. I'd previously theorised that there was no direct relation to the specified output file size being achieved and whether I let AutoGK choose the resolution or if I set it myself, so I set the same specific resolution each time. I also manually set the same bit rate for the audio, which was in MP3 format. I figured that way, there's two variables which won't be variable any more.

So here's the upshot of it all....
Only one version of the XviD codec I used hit my 100MB target size exactly each and every time (well give or take a few KBs). Every single one of the other codec versions has either failed to achieve the target size for me, or hit it one time, then missed it another (I didn't do multiple conversions with each codec version but I did do so with a couple of them, partly because I did the converting on two different computers at first to make sure the hardware or OS weren't a factor in hitting the target file size). But here's the bit I've been trying to get to....
None of the codecs missed the target size (if they didn't achieve it) by what I'd describe as a random amount. Every time the target size was missed the actual size was 60MB (as opposed to the 100MB size I specified) give or take 0.5MB either way, so to my way of thinking it's as if when the target size was missed, it's because the codec was actually aiming for the wrong size for some reason. Almost like AutoGK and the codec weren't communicating properly, and not because a setting in the codec itself needed a tweak. And because as far as I can tell AutoGK will over-ride any codec tweaking I might do anyway, there wouldn't be much point in doing so. Of course I could be wrong about all this as I'm just a newbie, but I'm curious and trying to find out just what's going wrong.
I also tried one of the codecs which was only outputting a 60MB file with another GUI type converter and got the same results, so maybe it's not AutoGK's fault.

Below are the results I got with the different codec versions. Maybe there's an expert here who's been patient enough to get through my post to this point, and would care to offer an explanation. After I did the converting I compared AutoGKs log files for each rip, and all the relevant bits were exactly the same for each one. I've posted the compression values from those files here, although they didn't vary much. They did appear to slightly differ (once again by the same amount) according to whether the output file size was correct or not. All the scripts AutoGK produced were the same.

Target File size for all conversions: 100MB
All logs:
Output will contain 15174 frames
Video size: 96,293,688 bytes (91.83 Mb)


Conversion 1A: 60.5MB
Koepi's XviD, version 1.0.3 (20/12/2004), Core2 Duo E6750 PC
Compressibility percentage is: 65.26
Predicted comptest value is: 65.26%
Expected quality of first pass size: 63.07%
Second pass speed was: 91.76 fps.
Total time: 6 minutes 24 seconds.

Conversion 1B: 100MB
Koepi's XviD, version 1.0.3 (20/12/2004), AMD 3200+ PC
Compressibility percentage is: 65.33
Predicted comptest value is: 65.33%
Expected quality of first pass size: 63.49%
Second pass speed was: 21.96 fps
Total time: 23 minutes 46 seconds

Conversions 2A & 2B: 60.5MB
Nic's XviD version 1.1.0 (06/04/2005), Core2 Duo E6750 PC (Results identical on AMD 3200+ PC)
Compressibility percentage is: 65.26
Predicted comptest value is: 65.26%
Expected quality of first pass size: 63.07%

Conversion 3: 100MB
Koepi's XviD version 1.1.2 (01/02/2007), Core2 Duo E6750 PC
Compressibility percentage is: 65.33
Predicted comptest value is: 65.33%
Expected quality of first pass size: 63.49%
Second Pass speed was: 87.03 fps
Total time: 6 minutes 32 seconds

Conversion 4: 59.8MB
Koepi's XviD version 1.1.3 Final (28/06/2007), Core2 Duo E6750 PC
Compressibility percentage is: 65.30
Predicted comptest value is: 65.30%
Expected quality of first pass size: 63.07%
Second Pass speed was: 94.33 fps
Total time: 6 minutes 24 seconds

Conversion 5: 100MB
Koepi's XviD version 1.2.127 Alpha (25/02/2006), Core2 Duo E6750 PC
Compressibility percentage is: 84.45
Using sharper matrix
Predicted comptest value is: 76.26%
Expected quality of first pass size: 86.75%
Speed was: 94.62 fps
Total time: 6 minutes 20 seconds

Conversion 6: 59.9MB
88keys XviD version 1.2.127 (29/03/2008), Core2 Duo E6750 PC
Compressibility percentage is: 84.45%
Using sharper matrix
Predicted comptest value is: 76.26%
Expected quality of first pass size: 86.75%
Second Pass speed was: 96.73 fps
Total time: 6 minutes 17 seconds

So I guess the 1.2 version of the encoder gives the same file sizes with better quality than the 1.1 version does. Or am I reading that wrong?

It was also interesting that the total encoding times for both the 1.1 and 1.2 versions didn't vary all that much from conversion to conversion on the same computer. I'd read that the 1.2 encoder version was optimised for dual core processors, but the 1.1 version was using both cores anyway, and was only a few seconds slower, so I'm not sure what the difference is.

And last but not least.....
At some stage I've used all the above versions of XviD until each one produced a file smaller than the specified size. At that point I stopped using it and tried another, which usually happened within a couple of conversions if it didn't happen the first time (like it's a 50/50 chance each time). So now I'm using the only codec version which after days and days of encoding, has not produced anything other than a file of pretty much the exact target size, no matter what other settings I give AutoGK to work with.
And that's Koepi's XviD version 1.2.127 Alpha (25/02/2006).

So does anyone know why a codec would hit the target size, seemingly only about 50% of the time, then output a smaller file size the other 50% of the time, and when it does output the smaller file size, why it's wrong by the exact same amount each time?

I've attached (hopefully) some of AutoGK's log files in case anyone wants to check that I'm not missing something.

Thanks.

budwzr
1st May 2008, 05:33
Ummm...as it says in the user guide, AGK results are based on the compressibility of the source.

A "target" file size is just that. A TARGET, something to shoot for. I don't think it was meant to be an exact number 100% of the time.

BTW, using a target filesize is probably the worst method of encoding because high motion videos will need heavy compression to hit the target, whereas low motion videos will waste disk space.

yetanotherid
1st May 2008, 10:55
Ummm...as it says in the user guide, AGK results are based on the compressibility of the source.

A "target" file size is just that. A TARGET, something to shoot for. I don't think it was meant to be an exact number 100% of the time.

BTW, using a target filesize is probably the worst method of encoding because high motion videos will need heavy compression to hit the target, whereas low motion videos will waste disk space.

Hmmm... well I haven't gone back and re-read the guide, but is it possible that in context, the "AKG results" you mentioned refer to the resulting quality of the output for a given file size, rather than to just the file size specifically?

In my limited experience with AKG and XviD, as a combination they're very, very good at getting close to the target file size. I've stuck with the version of XviD I mentioned in my original post and as an example I've just finished backing up a 36 DVD box set to AVI's, each DVD containing 4 episodes of a series. When I setup AKG for the job I specified the same target file size and resolution for each episode. AKG/XviD didn't fail to hit the target file size a single time, within half a MB either way, despite having to sometimes adjust settings to accommodate an episode which was harder or easier than average to compress.
So to me that says if one version of the codec can do it each and every time, while others miss 50% of the time, and when they miss they appear to be achieving the wrong target file size (because it's the same size each time they miss) then there's something else going on that's not just the codec over or under shooting the target by a random amount.

I am aware that using a target file size doesn't always achieve the optimum quality, however I am realistic when choosing that size so that AGK can still achieve a good average quality, but unfortunately there's many reasons... some of them relating to storage and the type of device the backups will most often be played on... that often makes choosing a balance between quality and file size one of those necessary evils.

Thanks for the reply.

weaver4
1st May 2008, 22:57
You are seeing the same problem that I have talked about for a few months now. For target size or target quality you should only use the version of XviD that comes with AutoGK. This version is a single build of 1.2 that has never been released and is not the main build.

If you want to use a more "conventional" build of XviD (that only runs on a single core, mind you) you will need another tool like avi.net, staxrip, megui or one of the many others.

yetanotherid
2nd May 2008, 00:31
You are seeing the same problem that I have talked about for a few months now. For target size or target quality you should only use the version of XviD that comes with AutoGK. This version is a single build of 1.2 that has never been released and is not the main build.
If you want to use a more "conventional" build of XviD (that only runs on a single core, mind you) you will need another tool like avi.net, staxrip, megui or one of the many others.

Really? You mean I'm not alone? Or mad? Or having hallucinations?
Thank you very much for letting me know! I was starting to wonder. :-)

Ironically, the XviD build that comes with AutoGK was the one I started with. I specified a file size for my very first conversion, but didn't touch any of AutoGK's other settings as I had no idea what I was doing anyway. Instead of 350MB, I think the resulting file was around 270MB. Without touching anything I ran the conversion again and this time it hit 350MB exactly.
So I did a lot of Googling and a lot of experimenting with different codec versions until I found one that works as expected every time, and I've stuck with it ever since.
I must admit when I first posted here I didn't think I could possibly be almost alone with this problem, especially given that I'm experiencing it on two different PCs, and I thought someone would simply be able to point me to a bit of dumbness on my part and the problem would be solved. Unfortunately though it hasn't worked out that way....

I'm also confused with the multi thread/core thing too. I've read about different builds being able to use more than one core while others don't etc, but every XviD version of tried has happily used both, and encoding times have been identical give or take a little bit. The only difference I noticed between the 1.1 and 1.2 versions of XviD was that the 1.1 versions didn't use up as many CPU cycles on average (around 80% as opposed to close to 100%). They still did the job in around the same time though, so while I'd like to know why that is, I guess in the end it doesn't matter too much.

budwzr
2nd May 2008, 23:22
I can't imagine any scenario where a small variation on a 700MB encode would make any material difference, so you've piqued my curiosity.

yetanotherid
3rd May 2008, 01:43
I can't imagine any scenario where a small variation on a 700MB encode would make any material difference, so you've piqued my curiosity.

I'm not sure what you're referring to when you say "small variation".
At the moment AutoGK is busy re-encoding some old DivX AVI's to XviD to make them compatible with my standalone player. So far it's done 7 of them, and the variation has been no more than about 20KBs for a 300MB (long story) target file size. That's excellent.

However the sort of variation I'm referring to is when you aim for a 700MB file and get (for example) a 540MB file around 50% of the time, and where the variation on that 540MB is again only a MB or so either way. The other 50% of the time AutoGK hits 700MB, give or take a couple either way.

To be honest I thought I'd explained my problem pretty clearly... It's not a small variation either way that's the issue, it's as though somewhere in the process something goes wrong around 50% of the time, and either AutoGK or XviD is aiming for a much smaller than specified target file size.