PDA

View Full Version : x264 1080p bitrate?


hsalb
24th November 2008, 13:02
If space is no issue, what should i settle for average bitrate? Source would be 1920x800 for example and i want to do a best quality 2pass encode. :stupid: Right now i use 9000kbps, is it oversized or should i go even higher?

DarkZell666
24th November 2008, 13:15
If space isn't an issue, don't even bother calculating/searching a bitrate and encode using a quality-based mode; ex: crf 18. Also, CRF is only 1-pass and doesn't need a second pass.
You choose the quality, and x264 (or any other codec) will use the appropriate bitrate to achieve the quality you asked for :)

Sagittaire
24th November 2008, 13:17
In most case H264 produce good result for 1080p at 6-8 Mbps. You can expect the same quality/pixel than equivalent 480p MPEG2 encoding at 3-4 Mbps for the same source.

burfadel
24th November 2008, 13:17
If you're not aiming for a particular end size, then setting a 2 pass encode at any bitrate is inefficient. 9000kbps is fairly excessive in my opinion, however that depends on the source (high motion, grain etc), and the settings used in x264 such as subme etc etc. CRF would be the more sensible option for you, maybe around 20, 22, its up to you! Just choose a sensible one (say 17-22) that looks good to you. The higher is lower bitrate, so ideally choose the highest value that meets your requirement. Setting too low is also inefficient.

Audionut
24th November 2008, 13:49
Personally, I use

--crf 16.0 --level 4.1 --keyint 240 --min-keyint 24 --ref 5
--mixed-refs --bframes 5 --b-adapt 2 --b-pyramid --weightb
--direct auto --deblock -2:-1 --subme 9 --trellis 1 --psy-rd 0.8:0
--partitions all --8x8dct --qpmin 1 --qpstep 8 --ipratio 1.3
--pbratio 1.1 --vbv-bufsize 40000 --vbv-maxrate 40000 --me umh
--merange 24 --threads auto --thread-input --aq-strength 0.4
--progress --no-psnr --no-ssim --output "output" "input"

Which gives about 8-10Mbps with 720p material.


btw, there is no best.

hsalb
24th November 2008, 13:50
thanks for all the input
If space isn't an issue, don't even bother calculating/searching a bitrate and encode using a quality-based mode; ex: crf 18. Also, CRF is only 1-pass and doesn't need a second pass.
You choose the quality, and x264 (or any other codec) will use the appropriate bitrate to achieve the quality you asked for :)

If i do a CRF 1-pass at lets say crf 18 and then i have a look at the resulting bitrate in most parts of the encode: Wouldnt a 2-pass encode with that given average bitrate of the crf-encode pack even more quality than the crf 1pass?

Atak_Snajpera
24th November 2008, 13:53
if i do a crf 1-pass at lets say crf 18 and then i have a look at the resulting bitrate in most parts of the encode: Wouldnt a 2-pass encode with that given average bitrate of the crf-encode pack even more quality than the crf 1pass?
no!!!!

Comatose
24th November 2008, 14:48
The logic behind that is that x264 in 2-pass will distribute the bitrate the same way as the CRF encode, so you'll end up with almost the same CRF. Or at least that's what I figure.
The "advantage" is that if you use a lower bitrate, it will have a variable RF and important parts might look better than just using a higher CRF altogether. (unless you happened to land on the bitrate required for a higher CRF :p) Or not.

Dark Shikari
24th November 2008, 17:18
The logic behind that is that x264 in 2-pass will distribute the bitrate the same way as the CRF encode, so you'll end up with almost the same CRF. Or at least that's what I figure.
The "advantage" is that if you use a lower bitrate, it will have a variable RFNo, no, no, no, no. 2pass tries to seek a constant ratefactor.

pcordes
24th November 2008, 19:25
no!!!!

That's not strictly true, is it?

Some options, e.g. direct=auto, can make better decisions on a second pass. I just tried direct=auto on a short clip from Pillow Talk, and it chose 0.4% temporal on --crf 25 -p1 at a bitrate of 399kb/s, and 7% temporal on --bitrate 399 -p2. (The final bitrate of the 2nd pass came out to 402kb/s, so the fact that it had a slightly better PSNR and SSIM is suspect... And yes, I used --aq 0 --psy-rd 0:0, since I wanted to look at PSNR instead of trying to visually compare the video.) x264 r1028.

IIRC, trellis can also do better on pass > 1. It's still useful in CRF, but maybe not _as_ useful. Is this still the case? I didn't try it out, since 2pass was using higher bitrates than I requested, so it would have been tricky to compare PSNR or SSIM.

Dark Shikari
24th November 2008, 19:36
That's not strictly true, is it?

Some options, e.g. direct=auto, can make better decisions on a second pass. I just tried direct=auto on a short clip from Pillow Talk, and it chose 0.4% temporal on --crf 25 -p1 at a bitrate of 399kb/s, and 7% temporal on --bitrate 399 -p2. (The final bitrate of the 2nd pass came out to 402kb/s, so the fact that it had a slightly better PSNR and SSIM is suspect... And yes, I used --aq 0 --psy-rd 0:0, since I wanted to look at PSNR instead of trying to visually compare the video.) x264 r1028.Yes, direct temporal is the one decision which is slightly better in twopass mode. But just as well, the motion search is slightly better in CRF (mainly with lower --me values) because CRF can use lookahead MVs as predictors, while secondpass can't. IIRC, trellis can also do better on pass > 1.Never was true, never will be, and I have no idea where this myth came from.

Sagekilla
24th November 2008, 21:18
If you encode at a given CRF value (let's say crf 18), take that bitrate (say 8000 kbps) and encode 2-pass with the bitrate, you'll get more or less the same bit distribution on 2-pass as you would on 1-pass CRF. They both use the same ratecontrol algo I believe.

bob0r
24th November 2008, 22:12
20mbit.

LoRd_MuldeR
24th November 2008, 22:17
They both use the same ratecontrol algo I believe.

Yes, they do. More or less. CRF uses a constant "scaling factor" while 2-Pass will "scale the results to fill the requested total size".

More info here:
http://git.videolan.org/gitweb.cgi?p=x264.git;a=blob;f=doc/ratecontrol.txt

Shinigami-Sama
24th November 2008, 22:31
20mbit.

280 maybe... ...depending on your source

nwg
25th November 2008, 22:36
Is there anyway to do 1 pass and get close to a target size say a single layer DVD. It takes me 30+ hours on 2 pass and would be great if I could do just 1 pass which is around 8 hours and be close to a full DVD size.

I suppose I should do a CRF 18 encode and just see what size I end up with.

wyti
25th November 2008, 22:39
No if you want to reach a filesize you can use ABR mode (set the bitrate and do only one pass) but you will get lower quality at the same filesize than with 2pass.

nwg
25th November 2008, 22:49
No if you want to reach a filesize you can use ABR mode (set the bitrate and do only one pass) but you will get lower quality at the same filesize than with 2pass.

I am not expecting a exact size but within 50MB would be nice. I am using the ripbot gui.

How can it be lower quality when this was posted above?

If you encode at a given CRF value (let's say crf 18), take that bitrate (say 8000 kbps) and encode 2-pass with the bitrate, you'll get more or less the same bit distribution on 2-pass as you would on 1-pass CRF. They both use the same ratecontrol algo I believe.

wyti
25th November 2008, 22:57
i don't say to use 1 pass crf (which give about same quality as 2 pass bitrate for the same filesize) but one pass bitrate mode (wich produce lower quality because the encoder don't know what scene use a lot of bits, and what use a few).
With crf you don't have any idea of the filesize (you can get for example 4Go for the source a, and 6 Go for the source b.)

Shinigami-Sama
26th November 2008, 00:23
you can guesstimate the size of a CRF encode to a handfull of percent but thats kind of defeating the purpose of CRF and is more a 1.n pass encode anyways..

ajp_anton
26th November 2008, 00:40
Is there anyway to do 1 pass and get close to a target size say a single layer DVD. It takes me 30+ hours on 2 pass and would be great if I could do just 1 pass which is around 8 hours and be close to a full DVD size.

I suppose I should do a CRF 18 encode and just see what size I end up with.Your first pass is only 8 hours because there's a second pass after that.
You can't think of 1-pass as 2-pass minus the 2nd pass. You'll be removing the fast 1st pass, leaving the slow 2nd pass.
I'd say making your 1st pass even faster gives you better quality than doing a 1-pass bitrate-encode. Not sure about this though, as I don't even know how 1-pass bitrate-mode works...

Comatose
26th November 2008, 22:18
No, no, no, no, no. 2pass tries to seek a constant ratefactor.
Oh. So that the quality stays constant.. ;_;