How to do 2-pass encode with HEVC 10bit codec?

I have a 10bit video and want to encode it using x265 (HEVC) code. How can I do 2-pass encoding for the same?

Hey Albert,

FFmpeg provides best ways to transcode a video. To transcode/encode 10 bit video with HEVC you just need to set the video profile to main10 which supports 10bit. Consider the following command as an example.
ffmpeg -y -i input -c:v libx265 -b:v 2600k -x265-params pass=1,profile=main10 -an -f null /dev/null && \ffmpeg -i input -c:v libx265 -b:v 2600k -x265-params pass=2,profile=main10 -c:a aac -b:a 128k output.mp4

Thanks for your reply!

BTW, How can I use CRF with 2-pass HEVC 10bit encode?

Pass encoded with CRF (constant rate factor) is not possible, you have to use either a 2-pass or CRF rate control method. Consider the following command as an example for CRF encode.
ffmpeg -i input -c:v libx265 -crf 26 -preset fast -x265-params profile=main10 -c:a aac -b:a 128k output.mp4