Log in

View Full Version : Are my x264 settings still up-to-date?


bur
15th May 2013, 19:48
I'm using the following settings to transcode anime from high bitrate to 800 kbps to be able to watch them on my smartphone (HTC DHD). It can handle more than 800 kbps but it doesn't show on the small screen anyway, so I settled with that.
1st pass: --deblock -2:-1 --b-adapt 2 --bframes 4 --direct auto --psy-rd 1.0:1.0 --trellis 0 --pass 1 --bitrate 800 --threads auto --stats "%2.stats" --output NUL "convert.avs"

2nd pass: --ref 5 --deblock -2:-1 --b-adapt 2 --bframes 4 --direct auto --me umh --subme 8 --psy-rd 1.0:1.0 --trellis 2 --pass 3 --bitrate 800 --threads auto --stats "%2.stats" --output "video%2.mkv" "convert.avs"
I came up with these after reading Brother John's site. But maybe there has been some new development work so that I should adjust my settings or add new ones?

General comments on how to improve things are also welcome.

LoRd_MuldeR
15th May 2013, 20:12
Nowadays, you can just use this instead:
1st pass: --preset slower --tune film --pass 1 --bitrate 800 --stats "%2.stats" --output NUL "convert.avs"

2nd pass: --preset slower --tune film --pass 2 --bitrate 800 --stats "%2.stats" --output "video%2.mkv" "convert.avs"

The preset/tuning system in conjunction with the fast first pass feature (enabled by default) takes care of the rest :cool:

Adjust the preset if the above is too slow (too fast) for your needs. Also adjust the tune to animation, in case you are encoding cartoon-like stuff.

That's it ;)

bur
17th May 2013, 18:12
Thanks, good to know. I saw that my current settings are like slow but with trellis 2. Encoding time is no real concern so I guess I'll go with slower for now, but out of curiosity, would it be possible to use --preset slow --trellis 2 to override parts of the preset?

I also saw you're using --pass 2 instead of 3. I think the difference is that 3 still updates the stats file and 2 doesn't?

MasterNobody
17th May 2013, 18:23
but out of curiosity, would it be possible to use --preset slow --trellis 2 to override parts of the preset?
Yes. You can override almost any option of preset (if there is option for this different value). Presets are like default values which goes first and then all other options override them (btw. it doesn't matter where in command line would be preset option it would still be applied first i.e. you can't override anything by preset except the defaults)

LoRd_MuldeR
17th May 2013, 22:42
I think the difference is that 3 still updates the stats file and 2 doesn't?

Exactly. But there usually is no point in updating the stats file, if you only run two passes. And there usually is no point in running more than two passes with x264. So...

bur
18th May 2013, 14:29
I tried the new settings and while the 2nd pass takes twice as long now (11-12 fps vs 24-25 fps) it shows:

http://imageshack.us/a/img90/1629/snapshot4380presetslowe.th.png (http://imageshack.us/a/img90/1629/snapshot4380presetslowe.png)
(--preset slower)

http://imageshack.us/a/img11/6361/snapshot4380oldsettings.th.png (http://imageshack.us/a/img11/6361/snapshot4380oldsettings.png)
(old settings, see above)

I guess on the smartphone that difference isn't visible, but it's nice to see what's possible.


Regarding the --pass 3, I was using this because I read that if for some reason a 3rd pass would be needed it'd be nice to have that updated stats file. But you're right, that never happened to me. Bitrate for these videos was usually 799.x kbps after two passes. And for my purpose even +/- 100kbps would be no problem.