Log in

View Full Version : Which of the following x264 options shouldn't be set in the first pass?


orion44
18th March 2010, 10:47
I've made a batch file, but I'm not sure if some of the following
options should be set in the first pass, or only in the second pass.

First Pass: x264.exe --tune film --slow-firstpass -b 3 --b-pyramid normal -r 4 -B 944 -p 1 --stats D:\Project\Stats.log --direct temporal -t 0 --no-fast-pskip --no-dct-decimate -o D:\Project\Video.mp4 D:\Project\AviSynthScript.avs

Second Pass: x264.exe --tune film -b 3 --b-pyramid normal -r 4 -B 944 -p 2 --stats D:\Project\Stats.log --direct temporal -t 0 --no-fast-pskip --no-dct-decimate -o D:\Project\Video.mp4 D:\Project\AviSynthScript.avs

Is there any option from the first pass that I should discard, that is only useful in the second pass?

AlekseiV
18th March 2010, 10:50
--slow-firstpass

Fr4nz
18th March 2010, 11:20
I've made a batch file, but I'm not sure if some of the following
options should be set in the first pass, or only in the second pass.

First Pass: x264.exe --tune film --slow-firstpass -b 3 --b-pyramid normal -r 4 -B 944 -p 1 --stats D:\Project\Stats.log --direct temporal -t 0 --no-fast-pskip --no-dct-decimate -o D:\Project\Video.mp4 D:\Project\AviSynthScript.avs

Second Pass: x264.exe --tune film -b 3 --b-pyramid normal -r 4 -B 944 -p 2 --stats D:\Project\Stats.log --direct temporal -t 0 --no-fast-pskip --no-dct-decimate -o D:\Project\Video.mp4 D:\Project\AviSynthScript.avs

Is there any option from the first pass that I should discard, that is only useful in the second pass?

Why you don't use only presets in order to avoid useless/redundant parameters?
All those parameters you're using in the command line are pretty useless...
Read here: http://mewiki.project357.com/wiki/X264_Settings

For example, you will get faster and better results with a command-line like this one:

x264.exe --preset slow --tune film --pass 2 --bitrate XXXX
--stats ".stats" --output "output" "input"

orion44
18th March 2010, 11:53
Why you don't use only presets in order to avoid useless/redundant parameters?
All those parameters you're using in the command line are pretty useless...
Read here: http://mewiki.project357.com/wiki/X264_Settings

For example, you will get faster and better results with a command-line like this one:

x264.exe --preset slow --tune film --pass 2 --bitrate XXXX
--stats ".stats" --output "output" "input"

Why do you think that they are useless?

Do you mean that they are useless only in the first pass?

I don't want to use the slow preset, because it would take longer
to encode, and I'm perfectly happy with the medium settings.

nm
18th March 2010, 12:28
Why do you think that they are useless?

Do you mean that they are useless only in the first pass?

Your both passes have redundant and poorly balanced settings. For example, you disable trellis and then use --no-fast-pskip, which is certainly not a good tradeoff. Just use --tune film and the appropriate rate control settings (--crf x or --bitrate y --pass 1/2).

And use fast first pass (drop --slow-firstpass), as AlekseiV suggested. That should speed the encoding up so that you can afford --preset slow

orion44
18th March 2010, 13:04
And use fast first pass (drop --slow-firstpass), as AlekseiV suggested.

I've removed it.

For example, you disable trellis and then use --no-fast-pskip, which is certainly not a good tradeoff.

It certainly is, the image looks nicer with trellis off, and no fast p skip enabled.

Dark Shikari
18th March 2010, 14:17
It certainly is, the image looks nicer with trellis off, and no fast p skip enabled.no-fast-pskip does practically nothing. It is a placebo option, and if you think it does something significant, your eyes are probably fooling you and you should stop messing too much with settings you don't understand.

If you're looking to retain detail or grain, which it looks like you are, try --tune film or something of the sort. And don't turn off trellis, because it's required for psy-trellis (enabled with --tune film), which will help quite a bit.

mp3dom
18th March 2010, 14:32
Dark Shikari, I've a question for you: what settings are useful if I want to keep grain and gradients smoothing (avoid color banding)? I know it could be a useless question (the grain itself could keep the gradients smoothing) but I've a footage with subtle grain all over the frame and keeping the grain doesn't allow me (at least with the settings that I've tried) to keep the smooth gradients. I've already tried with no mbtree, deadzone at 0, qpmin at 0, trellis at 0/2, grain preset and similar but I can keep the grain (and not the gradients) or keep the gradients (and not the grain). As for bitrate I can have an average of 13 Mbps. Thanks!

Dark Shikari
18th March 2010, 14:34
Dark Shikari, I've a question for you: what settings are useful if I want to keep grain and gradients smoothing (avoid color banding)? I know it could be a useless question (the grain itself could keep the gradients smoothing) but I've a footage with subtle grain all over the frame and keeping the grain doesn't allow me (at least with the settings that I've tried) to keep the smooth gradients. I've already tried with no mbtree, deadzone at 0, qpmin at 0, trellis at 0/2, grain preset and similar but I can keep the grain (and not the gradients) or keep the gradients (and not the grain). As for bitrate I can have an average of 13 Mbps. Thanks!Keeping fine dither in dark areas is practically impossible at sane bitrates. It can potentially take even more bitrate than keeping grain. Honestly, I often just give up and use gradfun2db on playback. It's far easier.

This SOC project (http://wiki.videolan.org/SoC_x264_2010#10-bit_encoding_support) would definitely help the problem a lot though.

mp3dom
18th March 2010, 14:46
Ok, understood. Thanks for the answer! :)

orion44
18th March 2010, 15:05
no-fast-pskip does practically nothing. It is a placebo option, and if you think it does something significant, your eyes are probably fooling you and you should stop messing too much with settings you don't understand.

If you're looking to retain detail or grain, which it looks like you are, try --tune film or something of the sort. And don't turn off trellis, because it's required for psy-trellis (enabled with --tune film), which will help quite a bit.

OK, I will do that.

And about the --tune film option, should I enable it when creating backups of my DVD collection?

For example, when creating backups of the movie Matrix, Dark City, or Collateral?

Or should I use the default options for these types of movies?

nm
18th March 2010, 19:23
And about the --tune film option, should I enable it when creating backups of my DVD collection?

For example, when creating backups of the movie Matrix, Dark City, or Collateral?

Yes. --tune film is helpful with most live-action and CGI sources. For clean cel animation, use --tune animation.

orion44
19th March 2010, 00:15
Yes. --tune film is helpful with most live-action and CGI sources. For clean cel animation, use --tune animation.

OK, I will use it.

Thanks.