[Werner Clausen]"The first pass completes but the second fails on start with this message: "Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height"."
Does the first pass actually complete?
Please post the FFmpeg version.
For newer builds of FFmpeg, the use of presets is recommended for the libx264 codec.
Depending on the build, this is achieved by using the -vpre or -preset option.
Also, the pass log file option is not needed for the libx264 library as it generates it's own logs.
Finally, -crf only needs one pass as it is setting the constant "q" factor which would be determined by two pass.
Anyway, for the latest version, a UNIX 2 pass example (using -b instead of -crf) would be: