View Full Version : optimum filesize for encoding dvd to x.264 ?
Daedalus01
19th July 2007, 05:07
i normally encode a dvd using xvid AC3, 1 cd/2hr for lower quality or 1cd/1hr for high quality (i.e 2 cd rips)
i would like to use x.264 with AC3 now, and i understand it will give a lower filesize. What filesize would be the equivalent to an xvid 1cd or 2cd rips?
sorry if its been asked before, but i tried searching everywhere for this answer but couldnt find it
thanks
EDIT:
thanks for all the replies. the initial question i asked was what was the corresponding filesizes to use with x.264 that is equivalent to 1cd or 2cd xvid. ppl suggested i use x.264 CRF 18-24 (fix the quality, let the filesize vary).
advantages of this are:
less encoding time (only 1 pass needed)
quality of movies are constant
i have done some experiments, using a 30mb 42sec vob from a dvd of pirates of the caribbean 1 (the scene where Jack and Will fights in the blacksmith shop).
encoding was done using automkv for x.264, and autogordian knot for XVID. their filesizes are:
test mkv x.264 crf18 simple_resize(auto) no_grain filter: 12244kb
test mkv x.264 crf20 simple_resize(auto) no_grain filter: 6250kb
test mkv x.264 crf22 simple_resize(auto) no_grain filter: 4907kb
test mkv x.264 crf24 simple_resize(auto) no_grain filter: 3858kb
test xvid 80% quality: 12190kb
test xvid 70% quality: 10108kb
test mp4 x.264 crf20 no filters simple resize: 6521kb
on visual inspection, the crf20 (both) is is equivalent to the xvid 80%. it may look a little different, but that may be my imagination. There is abit more detail in the CRF18, however, its much larger filesize doesnt really warrant it.
IMO i like the x.264 without the no_grain filter, as i think the filter removes some detail.
one question though: should i use the resize feature in automkv? or just leave as original?
PuzZLeR
19th July 2007, 05:34
Some will say x264 encoding gives 20% better compression than Xvid, others will say 30%.
Let's assume it's about 25%. This means that x264 will need 25% less file size for the same quality than Xvid or can be 25% better quality for the same file size.
So you have two choices:
1- The high quality encodes can be targeted for 1050MB instead of 1400MB (2 CDs) and the low quality encodes can be targeted for 525MB instead of 700MB (1 CD). You should get similar quality with a smaller file size and this would be a good solution if you had larger storage media to place this content.
But...
2- Since you wish to store this video onto a CD, permanent finalized media, then I would recommend you keep the exact file sizes you had for Xvid and enjoy the better quality discs, which should be about 25% better in quality.
You cant mux AC3 into mp4, you need to use MKV btw.
Daedalus01
19th July 2007, 08:29
Some will say x264 encoding gives 20% better compression than Xvid, others will say 30%.
Let's assume it's about 25%. This means that x264 will need 25% less file size for the same quality than Xvid or can be 25% better quality for the same file size.
So you have two choices:
1- The high quality encodes can be targeted for 1050MB instead of 1400MB (2 CDs) and the low quality encodes can be targeted for 525MB instead of 700MB (1 CD). You should get similar quality with a smaller file size and this would be a good solution if you had larger storage media to place this content.
But...
2- Since you wish to store this video onto a CD, permanent finalized media, then I would recommend you keep the exact file sizes you had for Xvid and enjoy the better quality discs, which should be about 25% better in quality.
thanks. i am archiving on a hdd so yea i will use 1gb and 500mb
ToS_Maverick
19th July 2007, 08:59
i'd recommend you, to use 1/4 or 1/3 of a DVD as target size. if you ever want to burn some movies on a dvd, you don't have problems fitting them on a disc.
the sizes would be 1110 for 4 movies, 1400 for 3 (if you want to be compatible to 2 CDs) or 1480
Selur
19th July 2007, 09:10
@r3z: ac3 in mp4 works fine with gdsmux and Haalis Splitter,...
foxyshadis
19th July 2007, 09:31
Archiving to hard drive? Forget size, pick a crf. That's the #1 recommendation when you don't have a specific size that you must hit. crf 18 is very high quality, 24 is kinda lousy but half the size, and in between you'll probably find an acceptable tradeoff.
Daedalus01
19th July 2007, 14:29
Archiving to hard drive? Forget size, pick a crf. That's the #1 recommendation when you don't have a specific size that you must hit. crf 18 is very high quality, 24 is kinda lousy but half the size, and in between you'll probably find an acceptable tradeoff.
thanks , ill keep that in mind. however, i think the 1/4 dvd and 1/6 dvd idea is good in case i decide to archive some stuff on dvd to save space
Daedalus01
19th July 2007, 14:51
also if i dont really care abt accurate filesizes, is 1 pass ok?
Dark Shikari
19th July 2007, 15:15
also if i dont really care abt accurate filesizes, is 1 pass ok?
--crf mode is way better than 2pass IMO unless you really want a specific file size. Some movies need more filesize than others to achieve the same quality, and CRF does that.
fields_g
19th July 2007, 15:41
I also agree with the other postings about CRF. Saving to a HDD just screams using CRF. Predictable quality and time savings because there is no need for the second pass. Besides, it just might be that by the time you take these off the HDD, Bluray or HD-DVD burners may be in the market and your 1/3 1/6 1/10 1/12 or whatever targets will all be different.
As it sits now, 500 gig drive is actually dirt cheap. Would much rather add another one of these (externals are great) than juggle a bunch of burnt media.
PuzZLeR
19th July 2007, 18:08
Hi again,
Encoding with x264, or any H.264 implementation, is CPU intensive, maybe even 4x the encoding time as Xvid so to cut that down I too would suggest CRF. Quit trying to fit to a designated disc size. It's a mindset of the past, especially with HUGE hard drives available today. Most of us here do any "fitting" only if we really need to nowadays. My answer in my last post was only a good solution if you absolutely needed to fit this media onto a specific exact size, but since you don't really, then you should consider CRF.
Keep in mind, CD sizes were based on 80s tech, not what's good for a compressed movie in H.264 25 years later. Don't base your movie's quality level on the wrong premise to begin with. Instead give it the quality it needs.
Pick a CRF value instead of a size for whether you want higher or lower quality. CRF=24 should replace your "1 disc" mindset and CRF=18 your "2 disc" mindset, but size will vary and you should experiment with those in between too.
As far as AC3 is concerned, yes, you need the .mkv container since .mp4 does not support it (but I haven't tried gdsmux and Haali splitter yet though.) But do keep in mind, although the .mkv container is superior, it doesn't get nearly the same support with devices as .mp4 with AAC does.
Daedalus01
19th July 2007, 18:28
awesome i will do crf. does filesize relate linearly with crf (i doubt it). Thus, is there an optimum crf between 18 and 24? eg if 18 is 40% higher filesize than 16 then we may as well use 18?
SealTooGreat
19th July 2007, 18:42
Pick a CRF value instead of a size for whether you want higher or lower quality. CRF=24 should replace your "1 disc" mindset and CRF=18 your "2 disc" mindset, but size will vary and you should experiment with those in between too.
Daedalus01 has to make smaller resolution if he wants, with those CRFs settings, to get 1CD or 2CD target.
akupenguin
19th July 2007, 19:00
eg if 18 is 40% higher filesize than 16 then we may as well use 18?
18 is 1% smaller than 17.9, 2% smaller than 17.8, etc. There is no one point that's special.
SealTooGreat
19th July 2007, 19:08
Personally I'm using ABR one pass along with equation:
width*height*fps*bpp/1000=kbps
... where bpp is bits per pixel. I'm using bpp=0.16, you can try 0.11 if you are aiming really small target size (also resize res. to the lower values). I don't suggest you going below 0.11. After calculation you will get kbps which you have to put/type in the GUI or x264 cmd.
I think this is appropriate approach, considering desired target sizes (1cd or 2cd), but still keep decent quality. CRFs are very unpredictable it can go very sky high in giving bits to the picture. Anyway this is my suggestion. :)
If you do not care about size, use CRF.
shon3i
19th July 2007, 21:11
Personally I'm using ABR one pass along with equation:
width*height*fps*bpp/1000=kbps
Well, you should better use 2pass then, because ABR ratecontrol isn't smart much like is CRF.
PuzZLeR
19th July 2007, 22:13
Daedalus01 has to make smaller resolution if he wants, with those CRFs settings, to get 1CD or 2CD target.I wasn't comparing CRF to sizes, I was comparing CRF to Daedalus01's mindset.
Before, when "he" wanted high quality, he would encode to two CDs (bigger size) and only 1 CD (lower size) for lower quality. So I was suggesting that next time he wants high quality, he should think more in terms of the bigger files size with CRF=18, and lower file sizes with CRF=24 instead of, respectively 2 CDs or 1 CD.
No comparison to size at all here. You may be right in final yield, but I was comparing a different way of thinking.
@Daedalus01:
There is no "real" relationship between CRF and final file size. The only guarantee is that a lower CRF value produces a higher file size with the same source and settings.
CRF will seek to give you the quality you asked it to, and will give it to you without consideration to file size, whether it needs a smaller file size or bigger one. It guarantees you the quality you asked it to give you and every video clip will be different.
I personally calculated from my DVR's source that there's about a 15%-19% file size difference between quantizers, but without an initial index to multiply that with, which you don't know beforehand, this calculation is useless anyway.
And there is no optimum or best CRF value. That is your choice entirely and compromise. As I was mentioning earlier, it's all about mindset. Change your thinking.
Wrong thinking:"Which CRF value will give me a file size close to so-and-so?"
Correct thinking:"If I want the smallest file size possible, what is the highest CRF value, or lowest quality, that I will accept?"
buzzqw
19th July 2007, 22:56
i want just add my experience as soft developer (automkv)
i know many and many user that want to use 2 pass profile, extreme quality profile (so many and more hours of encoding) WITH unlimited final size (and so automkv will set a bitrate aiming 32GB...)
Yes.. unlimited/don't care final size... i have sayed more and more times to use the CRF profile.. but.. nothing :rolleyes:
BHH
saint-francis
20th July 2007, 01:37
Is it not true that a 2 pass encoding will give smaller files? I seems to me like the best option would be to run a first pass with crf and make a stats file that can be then used for a second pass. Are people doing this? Why all of the emphasis on crf when one can intelligently set a bitrate and max out all of the x264 settings? Please forgive my ignorance but if we are aiming to reduce file sizes with video encoding and if a 2 pass encoding creates a smaller file than crf, why not use it? Even if you do have terrabytes of storage. If you have more storage than you could possibly know what to do with then just backup DVD images to the drive or something like that.
PuzZLeR
20th July 2007, 04:44
@saint-francis
Hi there,
Yes, we should all be looking for smaller files, and decide on the quality hit we agree with, otherwise you're correct - may as well just load the DvD image instead on your hard drive. As well, if storage was infinite, many of us would quite likely leave the MPEG-2 source alone. Yes less space saves money, but the compactness and manageability is my reason.
Here's the way I look at it with CRF vs. 2-pass. Neither necessarily gives smaller or larger files. It's not that simple to compare the two with this thinking.
Let's say, with 2-pass, you choose 1500kbps as your favorite bitrate. What will happen is that some video clips will look nicer than others, because as you know, every clip is different. Some will look kind of bad as well.
Instead, let's say you like a certain quality with CRF. If clip 1 gives you 2000kbps in the end that means that it needed more bitrate. Yes you spent more bitrate, but didn't get a clip that quite likely may have looked weak at 1500kbps.
If clip 2 gives you 1100kbps, then you saved bitrate and still got the quality you wanted.
You never "over encode" or "under encode" this way. And in the end, you get the quality you want and STILL save file size from the source.
Actually this is life in general. Not every situation deserves the same treatment. (Ok, no analogies this time...:p, maybe next post...:devil:)
I also have yet to see anyone provide any conclusive or significant evidence that one scheme gives better quality than the other with x264 (given the same bitrate) so I'm sticking with CRF, and no stats file is necessary IMHO.
akupenguin
20th July 2007, 07:10
@Puzzler
I don't think that was the question...
@saint-francis
Short answer: If you want to pick a quality and let the size vary, use CRF. If you want to pick a bitrate and let the quality vary, use 2pass. There are some other minor differences, but you can ignore them.
Reasons for using CRF to estimate bitrate for 2pass:
* Examining the output video and tweaking segments for maximum psy quality. (Then you might as well use 2pass given that you're encoding multiple times anyway.)
* Only usually using CRF's bitrate, but sometimes vetoing it. (if you have both quality and bitrate thresholds.)
* Used to encoding XviD and just haven't gotten used to x264's capabilities.
...Improving compression efficiency is not one of the reasons.
Daedalus01
20th July 2007, 11:22
thanks for all the replies. the initial question i asked was what was the corresponding filesizes to use with x.264 that is equivalent to 1cd or 2cd xvid. ppl suggested i use x.264 CRF 18-24 (fix the quality, let the filesize vary).
advantages of this are:
less encoding time (only 1 pass needed)
quality of movies are constant
i have done some experiments, using a 30mb 42sec vob from a dvd of pirates of the caribbean 1 (the scene where Jack and Will fights in the blacksmith shop).
encoding was done using automkv for x.264, and autogordian knot for XVID. their filesizes are:
test mkv x.264 crf18 simple_resize(auto) no_grain filter: 12244kb
test mkv x.264 crf20 simple_resize(auto) no_grain filter: 6250kb
test mkv x.264 crf22 simple_resize(auto) no_grain filter: 4907kb
test mkv x.264 crf24 simple_resize(auto) no_grain filter: 3858kb
test xvid 80% quality: 12190kb
test xvid 70% quality: 10108kb
test mp4 x.264 crf20 no filters simple resize: 6521kb
on visual inspection, the crf20 (both) is is equivalent to the xvid 80%. it may look a little different, but that may be my imagination. There is abit more detail in the CRF18, however, its much larger filesize doesnt really warrant it.
IMO i like the x.264 without the no_grain filter, as i think the filter removes some detail.
one question though: should i use the resize feature in automkv? or just leave as original?
PuzZLeR
20th July 2007, 18:37
@Puzzler
I don't think that was the question...Hi Akupenguin,
We both know there’s no straight answer to whether 2-pass gives smaller files than CRF. However, the technical details of it all are better left to the likes of you. :p
I pointed out why use CRF instead of something seemingly “more accurate” than bitrate 2-pass as he asked. You’re right in how they vary. They are both like a function of two variables, and each scheme oppositely has only one constant parameter for one of them.
And yes CRF is very valid for compressing video, which is the object of the game for most here. I should have pointed out that even at CRF=18 I haven’t had one file that was larger than the original. This is also very near the boundary, and decision point, as to whether one should find it worthwhile to compress/encode or keep the source as is, assuming the source is MPEG-2.
And the lack of any substantial evidence pointing out one scheme over the other was my opinion as to why there’s no need for any stats file in using the bitrate from CRF towards a second pass to “supposedly” provide better quality. Such a feature on x264 should be redundant.
Is there any “real” evidence calling out one over the other as there was for older codecs? I doubt it.
@Daedalus01:
As far as resizing is concerned, you will get many answers to that. That also depends on where you want these clips to be played back.
I would say, nevertheless, if the source is DvD content, keep close to the original, either 480p anamorphic or with a PAR of 1:1 (depending on A/R, ex: 640x480 for 4:3).
Decreasing the size saves on bitrate demands, but would diminish quality on a bigger screen.
Increasing the size to HD-type levels takes much, much longer to encode, and personally, I don't think today's technology is fully ready for this. I would save this step for a few years down the road when hardware/software advances a bit more...
burfadel
22nd July 2007, 11:57
Just curious, what other settings are you using for encoding? These can affect quality/filesize significantly as well so it would be good to know the settings you're using!
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.