Log in

View Full Version : First pass slow in 2-pass encode


wqcr
13th October 2017, 09:44
Hi, when running:
ffmpeg -i "input.mp4" -an -c:v libx265 -b:v 400k -x265-params pass=1:stats="mylog.log" -preset slower -f NULL nul -y && ffmpeg -i "input.mp4" -c:v libx265 -b:v 1000k -x265-params pass=2:stats="mylog.log" -preset slower -c:a opus -strict experimental -ab 64k -f matroska "Output.mkv"

First pass takes a long time to finish, almost the same as 2nd pass.
Is it possible to use lower preset (veryfast) with 1st pass?

I can't remember the cmdline, but IFME did 1st pass always much faster than 2nd pass.

sneaker_ger
13th October 2017, 10:14
Try -x265-params no-slow-firstpass=1:pass=1:stats="mylog.log"

wqcr
13th October 2017, 10:25
Try -x265-params no-slow-firstpass:pass=1:stats="mylog.log"

Thanks I will try,
does the "preset" have to be specified for the 1st pass?

Asmodian
13th October 2017, 16:19
Yes, use exactly the same settings for both passes. That option sneaker_ger suggested will lower all the options it is safe to lower.

wqcr
14th October 2017, 15:42
Try -x265-params no-slow-firstpass:pass=1:stats="mylog.log"

I'm getting
libx265 @ 0x556b6fac70 Unknown option: no-slow-firstpass:pass.

sneaker_ger
14th October 2017, 16:28
Try:
-x265-params no-slow-firstpass=1:pass=1:stats="mylog.log"

benwaggoner
20th October 2017, 18:24
Also, my understanding is the using a slow first pass and a faster preset generally will result in better 2-pass VBR results than just using a slower preset. Using fast preset, at least for 2-pass VBR offered worse quality @ time than either a single pass with lookahead or a full 2-pass. The old fast preset mode diverged too much from the actual encode pass to give accurate enough data for optimal quality. There are so many different decisions to make in HEVC, the divergence resulting from different pass settings yielded a lot more divergence than it did in x264.