PDA

View Full Version : How to determine what image size and file size to use?


stax76
23rd December 2005, 21:27
I try to figure out how people decide what image size and file size to use. Some explanations:

Some movies compress well while others don't and analogous some movies are longer than others so that means while some movies would do good with 700 MB other will require 2 GB for equal quality. I'm storing 2-4 movies on a DVD and since movies are so different I'm not much concerned about hitting a exact file size but am rather concerned about getting a constant quality which I get using around 200000 pixel image size and quality mode around quant 3.

I did not found much information about how multipass compares to quality mode and I have the impression most people prefer to hit a exact file size and if I understood correctly this is the only reason why multipass is needed. I hope you can help me to get a better understanding of all these things.

CruNcher
23rd December 2005, 23:34
For DVD Backup its goten useless to resize anymore especialy with AVC but also for good ASP codecs it's less needed i never resize just crop the black boarders do a correct ar signaling and if you use a good codec it should be fine :) time needed for such an encode with 2.4 GHz would be like 2h ASP without qpel 3h with qpel 4h AVC HP today :) if you think about that with a P3 450 and Divx 3.11 SBC you needed over double the time for 640x272 it's a good tradeof today because of the much better quality (detail preservation) you achive so resizing imho is something outdated (no real time win today anymore) for streaming well yes it can be helpfull but archiving i don't think so.

unskinnyboy
23rd December 2005, 23:48
I did not found much information about how multipass compares to quality mode and I have the impression most people prefer to hit a exact file size and if I understood correctly this is the only reason why multipass is needed. I hope you can help me to get a better understanding of all these things.
You guessed correct. Unless you want to hit a specific target size, you don't need to do a 2-pass encode (I am guessing you are talking about XviD here). If disk space is no issue (you are storing the encodes on your hard drive, HTPC etc) and you don't plan to archive them onto CD-R/DVD-R and constant quality is what you need, do a single pass, constant quant encode. Be aware that you would have NO control over the final filesize. Does this answer your doubt?

Btw, there are plenty of threads on this topic where manono and others have explained this.

stax76
24th December 2005, 01:27
For DVD Backup its goten useless to resize anymore especialy with AVC but also for good ASP codecs it's less needed i never resize just crop the black boarders do a correct ar signaling and if you use a good codec it should be fine time needed for such an encode with 2.4 GHz would be like 2h ASP without qpel 3h with qpel 4h AVC HP today if you think about that with a P3 450 and Divx 3.11 SBC you needed over double the time for 640x272 it's a good tradeof today because of the much better quality (detail preservation) you achive so resizing imho is something outdated (no real time win today anymore) for streaming well yes it can be helpfull but archiving i don't think so.

16:9 movie would already end up twice of 200000 pixel but I should give it a try.

You guessed correct. Unless you want to hit a specific target size, you don't need to do a 2-pass encode (I am guessing you are talking about XviD here). If disk space is no issue (you are storing the encodes on your hard drive, HTPC etc) and you don't plan to archive them onto CD-R/DVD-R and constant quality is what you need, do a single pass, constant quant encode. Be aware that you would have NO control over the final filesize. Does this answer your doubt?

Btw, there are plenty of threads on this topic where manono and others have explained this.


Thanks, it's clearer now and I've now also found more about it, I'll trust much this post:

http://forum.doom9.org/showthread.php?p=698597#post698597

jonny
24th December 2005, 13:21
http://forum.doom9.org/showthread.php?t=69457

there are some crucial comments by sysKin:


The quant distribution from 2-pass is definitely not better than constant quant - it's just more random and imprecise. I doubt you get a better picture by artificially introducing quantizer fluctuations...



Nope, don't overestimate 2-pass encoding. It doesn't know what bitrate scenes need. It just tries to achive constant quant AND desired bitrate, which is simply more difficulat than constant quant alone.


this is the technical explanation

stax76
24th December 2005, 13:44
:thanks:

raeltheimperialaerosolkid
27th December 2005, 09:20
Wow!! That's a great topic! This should be inserted, at least as a warning, in the guides in the main site!

Hylas
14th January 2006, 13:59
http://forum.doom9.org/showthread.php?t=69457

there are some crucial comments by sysKin:

The quant distribution from 2-pass is definitely not better than constant quant - it's just more random and imprecise. I doubt you get a better picture by artificially introducing quantizer fluctuations...


Funny. Just a few weeks earlier I got a completely different answer:
http://forum.doom9.org/showthread.php?p=421070#post421070

Generally, two pass could give a better overall experience than constant quantizer by modulating the quantizer according to HVS and R-D factors (e.g. raising quantizer slightly in scenes with high motion).


Also, see here for a related and equally old discussion (http://www.hydrogenaudio.org/forums/index.php?showtopic=16002).

stax76
14th January 2006, 14:29
As I understand it is the lower the bitrate the better it gets overall compared to quality mode. I don't think it helps any if you do a file size comparable to XviD at q2.5 or DivX at q3, at this low values slow settings don't seem to work miracles either, please correct me if I'm wrong.

stax76
6th February 2006, 21:26
I'm going to start a poll:

Title: multipass vs quality mode
Type: multiselect

Options:

multipass 1 CD
multipass 2 CD
multipass 3 CD
multipass 1/2 DVD
multipass 1/3 DVD
multipass 1/4 DVD
multipass 1/5 DVD
multipass other
quality mode (fixed quant)
other

Any suggestions about the options?

jonny
6th February 2006, 23:08
ops i've missed the thread

@Hylas:
correct me if i'm wrong, but the conclusion of the discussion you link seems that 2 pass converge to a fixed quantizer encode
(i'm talking about the one at hydrogenaudio)
in the last years i'm mainly using fixed quant encodes, but i think this is subjective (and depending on the average quantizer you aim)

@stax:
a poll like this could be dangerous
my advice is to add quant=1
(just kidding : )

Pao1o
7th February 2006, 13:05
First of all, thanks for this wonderful prog.
I've used it hundreds of times and, personally, it has failed only once or twice (but maybe it's my fault).
I've used often the custom size option, 'cause i'm not able to match the percentage quality with my desidered size.

I'm wandering, is there a rule to hit a desidered size, using the target quality option?

If I have a dvd 4,5 giga (for example) which percentage may I use to hit 1600 mb final size?

Many thanks and sorry for my poor english.

P.S. I've seen in the forum that there are no general rules (a film compress better than others) but I hope in some suggestions

jonny
7th February 2006, 16:26
If I have a dvd 4,5 giga (for example) which percentage may I use to hit 1600 mb final size?

there is no relation (at least no know relation - too many variables involved, i doubt someone will ever go into a serious reserch in this direction)


I'm wandering, is there a rule to hit a desidered size, using the target quality option?

size prediction can help on this (it's something similar to compressibility test)
my tool "Enc" can do this.

Hylas
8th February 2006, 09:05
correct me if i'm wrong, but the conclusion of the discussion you link seems that 2 pass converge to a fixed quantizer encode
(i'm talking about the one at hydrogenaudio)

I don't see a convergence, as there is no infinitely iterated process involved (multi-pass wasn't available back then), but you're right, the agreement was that 2-pass and constant quantizer are pretty close.

However, there is also speculation about theoretical advantages of 2-pass:

- Two-pass in XviD attains quant=2 to those few frames where no gain is expected from compressing them higher (i.e. they're small enough at quant=2). Possibly a minimal gain in quality.
- Two-pass allows to give I-frames a slight boost. Whether this actually makes a positive difference remains somewhat unclear, but I'd say it probably does.

About the poll:
CBR should be included, in fact that's what I use, combined with restricted quantizer variation.

boombastic
8th February 2006, 11:07
Can you use adaptive quantization with both 2-pass and fixed quant 1 pass?
Does the use of a custom matrix take advantage of one of those two encoding mode?

Pao1o
8th February 2006, 13:05
there is no relation (at least no know relation - too many variables involved, i doubt someone will ever go into a serious reserch in this direction)


size prediction can help on this (it's something similar to compressibility test)
my tool "Enc" can do this.

Thanks for your answer, I have supposed so.
Thanks also for your tool, from now I will use it.

Last question: is it better to shrink a dvd 7 giga into 4,5 giga (i.e. with dvd shrink) and then ricompress into avi with agk,

or is it better to leave it uncompress?

I mean, for a better final quality and time saved.

Bye.

jsquare
8th February 2006, 15:53
For the past few weeks I been testing different methods of encoding, 2-Pass, 1-Pass quality based and 1-Pass bitrate based(Mosthly with XVID). So far the 1-Pass quality based is the best choice in my book, just don't go above Q3.

Here are my typical settings:

- I Crop manually and try to maintain as much as the original AR as possible, also will target at ~215000 b/p, resizing an 2.35:1 movie will be around 720x304 or 704x304, 16:9 anamorphic down to 624x352, 596x336 or even as low as 512x288, I haven't tried any 4:3 or interlaced material so that still pending.
- Single Pass, Q=2
- Zones: Weight 0.75, Chroma Optimizer ON, rest at default
- Profile: Unrestricted
- Quantization Type: H.263 (MPEG seems to give better detail on dark/slow scene, but it takes more bitrate)
- B-VOPs: 2-1.5-1 (Default settings, also tried 2-1.63-0, 1-1-1, etc)
- No AQ, QPEL or GMC
- Quality: Mode Search 6, VHQ4, VHQ for Bframes ON, Chroma Motion ON, Turbo OFF or ON(can't really decide).

As you can see my target quality is around 75% but as we all know some movies will compress better than others and the use of filters/resize still an issue with my encodes, an example will be 2 different and recent movies, Revenge of the Sith(Starwars III) and War of The Worlds(2005).
War of the Worlds is 116mins long and it takes 1.7GB with above settings at a resolution of 608x336 with Lanczos resize, H.263, no filters and 128k AVR MP3 audio.
While StarWars III is 140mins long and takes around 1.2GB with same settings except for a resolution of 720x304.

Somehow I'm not 100% satistfied, maybe because I pay to much attention to the XVID's feedback window with all those red/blue/green bars and I/P/B stats, and still looking for the perfect combination of resizer(Lanczos vs Bicubic) and filters(RemoveGrain or something better).