View Full Version : LOST and x264 settings help
((( atom )))
16th January 2008, 20:42
Ok, so I've been doing my recent 40 or what encodes with x264 using crf and so far I am very happy with the improved quality and the little bigger filesizes then my old standard xvid 2pass.
Now I'm LOST: 3 seasons, 24, 23 and 23 episodes, wich I will want to be able burn to dvd. So I will have to deal with a target size using x264 for the fist time. I would really like keeping the unscaled, cropped picture and encode anamorphically and keep the original ac3 (around 120MB), but I am not sure if and how far I can squeeze all while staying close to the original DVD quality.
Since I have only been using x264 with crf so far, I have no good starting point and no idea if I can achieve my goals at all.
Any hints, please?
Sharktooth
16th January 2008, 20:52
easy. encode 2% of randomly chosen scenes (the usual selectevery() stuff) of an episode at a certain CRF (the one you're aiming - usually 18 is enough for complete tansparency) and look at the filesize.
multiply that by 50 and you'll have approximately the whole encoded movie file size (minus the audio size that you should take into consideration too!). if that's bigger than your target filesize (if it's smaller or equal then your desired filesize will be OK for sure), divide your target filesize by the previous number and you'll gain a quality ratio. multiply by 100 and you'll get how much % of "quality" you will loose from the desider CRF by using the desired filesize.
Dark Shikari
16th January 2008, 20:56
If you want a specific bitrate, just use twopass mode.
Sharktooth
16th January 2008, 21:00
D S, yeah... i have made a compression test example to help him decide the final filesize since he always used CRF modes...
((( atom )))
16th January 2008, 21:01
Ok, sound simple, but is CRF still the way to go when targetting for a filesize? And if so, what CRF would still be ok?
I just ran a full encode of the pilot at CRf 18 and ended up with 917MB. I can quickly encode that again, since I have a core2 quad now, yess!, and it only takes 20 minutes or so..
Sharktooth
16th January 2008, 21:08
no... the CRF in the example is just a test encode to help you decide the final filesize (bitrate).
the test was meant to tell you how much quality % you'll loose from your desired quality when aiming at a certain filesize, so you can decide if that filesize will be good for your needs or not...
needless to say you should use the same options for both CRF test encode and your final encode...
((( atom )))
16th January 2008, 21:08
Sharktooth, you and D S answered while I was typing.. So are aou saying I should use your example to figure how many episodes I will actually get onto a DVD with decent quality and then set up a two-pass encode?
Sharktooth
16th January 2008, 21:09
yes. exactly.
ok, now you have your 918MB encode... try to do what i said :)
EDIT: lets say you want to put 5 episodes in one DVD. that's 896MB per episode.
so, making the operations i explained in my first reply, you will find that 896MB is 97.6% of 918MB... that means you will only loose 2.4% from your CRF 18 quality encode. is that acceptable?
if yes, you can go on with 5 episodes per DVD...
NOTE: we didnt took the audio into consideration... you should account for that too by subtracting the audio filesize from 896MB and from 918MB...
((( atom )))
16th January 2008, 21:12
running it at 21 again.. Projected filesize shows 556 MB so far, still to much.. Will be back when done in a couple of minutes..
Sharktooth
16th January 2008, 21:17
no... you dont need multiple CRF encodes...
do just a CRF 18 encode. then do what i said.
((( atom )))
16th January 2008, 21:22
ok, starting 18 now.
Sharktooth
16th January 2008, 21:26
ok. let's do it step by step.
the problem is: you dont know how much bitrate to specify to obtain a good quality encode.
solution: do a compression test against your ideal quality.
Steps:
1- choose final filesize (that leads to a final bitrate too)
2- do a CRF 18 encode (whole or partial as described above)
3- compare the CRF 18 filesize against YOUR DESIRED filesize (as described above)
4- once you have a % of difference you are able to decide if your chosen filesize is OK or NOT, by looking at that % number... usually (and that's pretty subjective!!!) a 15-25% difference is acceptable but not more.
5- if it's ok you can proceed with a 2 pass encode with your chosen filesize (->bitrate), if not then choose a bigger filesize and go to point 3.
NOTE: the step 2 is just an analysis pass and you dont need to do the whole encode at that step. a 2% of the encode is ok (at the end, remember to multiply the filesize you obtain with this encoding by 50, for successive the successive steps/operations)
((( atom )))
16th January 2008, 21:38
Ok, much clearer now, thx. The CRF 18 encode is still running, projected filesize 972 MB right now and after my noodles I will go on..
Sharktooth
16th January 2008, 21:41
ok. keep in mind that is a very good a way to calculate the quality loss from an ideal encode (at CRF18) to a filesize limited encode... that will always help you to answer by yourself questions like "what bitrate should i use?" or "how much episodes can i put on a DVD without loosing too much quality?"
oh... and dont forget to take the audio size into consideration too... ;)
((( atom )))
16th January 2008, 22:20
So CRF 18 turns out 917 MB.
8 episodes for 1 DVD makes 560 MB per episode
Audio is 113 MB, so I have 447 MB for my video, not even 50%.
I guess the next step is to throw anamorphic encoding overboardand see if i can at least keep the vertical resolution :(
Testing...
((( atom )))
16th January 2008, 22:22
ahh, horizontal that was ;)
Ranguvar
16th January 2008, 22:35
IMDB says the aspect ratio is 1.78:1. I would go with either 720x400 or 688x384 for the resolution in that case. The former comes out to 1.8:1, the latter to 1.79:1. The former will most likely be better quality since it is higher resolution by a little, but the latter is slightly closer to the original aspect ratio. I'd probably go with the former, since while it's easy to tell when a video has been "squished", it's hard to tell when it's been "stretched", and it's only barely stretched at all.
Hope that helped :)
((( atom )))
16th January 2008, 22:49
yeah, meanwhile i did a resized non-anamorphic encode at 720x400 wich will gave me 634 MB. 20% off would still be 508 MB. Since I rezise anyway and remember to have read that the eye sees sharper in the vertical resolution I will try now 592x464 anamorphic . This way I will have a little less pixels to encode than using 720x400 and will keep more of the important vertical pixels. Never tried anamorph encoding after having resized, but as I understand the whole trick is keeping as much of the vertical pixels. Well, I'll see. Any coments on that idea?
Ranguvar
16th January 2008, 23:11
Not really sure... I never use anamorphic since several players I use are incompatible with it; I just use normal. Since you're doing huge x264 encodes, I highly doubt there'll be any visible difference; I'd go with the 720x400. Try and see though :)
((( atom )))
16th January 2008, 23:25
Well, so I tried that anamorphic encoding after resizing but I have the feeling, that the statement about vertical resolution is not quite true. I will have a closer look at my results tomorrow, time for bed now..
((( atom )))
17th January 2008, 00:25
Ok, couldn't sleep ;) So I was curious and took the avs scripts for my 592x464 anamorphic encode and the 688x384 for 1:1 and loaded them in virtualdubmod, saved the same frame from both clips as .bmp, loaded them in photoshop and resized the 592x464 to the exact aspect ratio of the 688x384 and viewed the resulting images fullscreen in irfanview, where I could nicely switch between them. I tried to spot the better one and to my surprise 8 out of ten times when I looked up at the status line where it tells me which image i am viewing the resized 592x464 looked better! So there must be something to the theory of the eye seing sharper in the vertical axis!
So I have a winner resolution: 592x464 with display aspect ratio of 16/9 for playback! I wouldn't have thought that to come out of this.
All I have to check now, is if the other episodes are alike in terms of compressibility, but I remember having encoded all of these in xvid a while ago (at 720x400 btw.) and they all compressed pretty similar.
I will attach both test images in a zipfile in case anyone is interested..
So thx. everyone so far!
Sharktooth
17th January 2008, 00:35
you're welcome.
however yes, anamorphic looks better to me even if the horizontal res is lower.
Ranguvar
19th January 2008, 00:07
Welcome :)
And cool, I learned something. Gotta try anamorphic more :)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.