Log in

View Full Version : 2pass crf possibility?


fakey
4th June 2006, 05:08
I got nitpicking and possibly annoying question for x264.

Now that we have --direct auto can we have 2pass crf also?

2pass and not specifying bitrate already produces something like 2pass --crf 26 encoding, but hey more flexibility is always welcomed.

Anybody interested?

I'd like it when I encode some Music Videos;)

edit:typo

akupenguin
4th June 2006, 06:05
2pass + cqp is exactly the same as 1pass + cqp, and if you don't specify bitrate then the default is cqp=26. (Yes, that's a feature. I abuse it in my tuning. No, you shouldn't ever do that in a real encode.)

crf inherently doesn't work in 2pass. I could, however, add an "average qp" mode. This would not have crf's feature that crf(high motion) + crf(low motion) == crf(high motion + low motion), but on the scale of a whole movie it might be good enough.

MeteorRain
4th June 2006, 06:09
i think fakey is talking about using 2pass to optimize b-frame direct method. spatial or tempral method are determined in 2nd-pass.

fakey
4th June 2006, 06:35
Yes, I am.

@aku

Sorry I abused x264:D .

I did a tiny(~100frames) test the other day when --direct auto was implemented in x264 and it gave me output different from original crf encoding.

Will return with more (hopefully precise) results.

berrinam
4th June 2006, 08:59
What you could try is doing a first pass with crf set to output stats, and then do a second abr pass with that bitrate and that stats file. foxyshadis requested that a while ago in MeGUI, but we never got around to it.

fakey
4th June 2006, 16:40
Okay, seems like something stupid was stuck in my skull to make me confuse cqp result and crf one.:stupid:

Average QP? 2pass average target QP?
That would be the sweet thing that I want.

What you could try is doing a first pass with crf set to output stats, and then do a second abr pass with that bitrate and that stats file.
1crf+2pass right?
1st pass to get bitrate, 2nd to get stats, and final.
Hmm. Long way to go but for now that seems to do the trick.

berrinam
5th June 2006, 07:10
1crf+2pass right?
1st pass to get bitrate, 2nd to get stats, and final.
Hmm. Long way to go but for now that seems to do the trick.
Simpler:
1st pass: get bitrate and stats
2nd pass: use the slightly more advanced 2pass algorithm.

fakey
6th June 2006, 00:10
Oh, I thought crf doesn't output stats.
(as it doesn't accept one, that was just from my convention)

Thank you for clarifying.

foxyshadis
6th June 2006, 04:54
You can still specify --stats with any output mode, MeGUI just doesn't have any special support for it. (If you do use it as a one-pass size predictor, don't bother with a hardcore encode, just make it fast and a couple steps above the actual crf you would encode at to make up for the bitrate boost of a fast encode.)