Okay I finally got 2 pass working. @quietvoid you're correct, you have to use -enc-mode-2p with -output-stat-file for the first pass and -enc-mode with -input-stat-file for the second pass.
Here's a quick example using the fastest speed preset and raw 8 bit yuv input, targeting 1080p at 3 Mbps VBR.
First Pass
Code:
svtav1encapp -i Beauty.yuv -w 1920 -h 1080 -fps-num 24000 -fps-denom 1001 -intra-period 96 -irefresh-type 2 -rc 2 -tbr 3000000
-enc-mode-2p 8 -output-stat-file stats.file -b Beauty_svtav1_8_3000.ivf
Second Pass
Code:
svtav1encapp -i Beauty.yuv -w 1920 -h 1080 -fps-num 24000 -fps-denom 1001 -intra-period 96 -irefresh-type 2 -rc 2 -tbr 3000000
-enc-mode 8 -input-stat-file stats.file -b Beauty_svtav1_8_3000.ivf
I get an output that decodes okay (and looks awful, predictably), but curiously there's an error during the second pass:
Error in freed returnVal 0
Odd.
Rate control seems to at least hit the target, it achieved 2995 Kbps which is within tolerance.
Any ideas on that error?