PDA

View Full Version : 2nd Pass with 1st Pass CRF Bitrate


rack04
23rd June 2009, 14:51
Lately I've been encoding my Blu-ray Discs using 1st Pass CRF and then using the bitrate obtained from the 1st Pass to run a 2nd Pass for standalone compatibility. The question I have is whether or not the switches used in the first pass effect the standalone compatibility. For example, are the following switches necessary in the 1st Pass:

--keyint 24 --min-keyint 1 --mvrange 511

J_Darnley
23rd June 2009, 16:09
They keyint settings are required because slice-type decision is done in the first pass. Vectors are not stored in the stats file so mvrange is not required.

In short: yes, yes, no.

rack04
23rd June 2009, 16:16
Thanks for the reply. Is it alright to output NULL in the first pass CRF since all I need is that stats and bitrate?

jmartinr
23rd June 2009, 16:20
Thanks for the reply. Is it alright to output NULL in the first pass CRF since all I need is that stats and bitrate?

Yes it is.

rack04
23rd June 2009, 16:28
Thanks for all the help. Here is what I've come up with.

Echo.
Echo.
Echo.[ %TIME% ] Encoding pass 1 ...
Echo.

@Echo on
"%x264_PATH%" --pass 1 --crf 18 --stats "%WORKING_DIRECTORY%\%SOURCE_FILENAME%.stats" --level 4.1 --keyint 24 --min-keyint 1 --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto --deblock -1:-1 --subme 2 --partitions none --me dia --threads auto --thread-input --aq-mode 2 --sar 1:1 --aud --progress --no-psnr --no-ssim --output NUL "%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs" 2>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-1pass.txt"
@Echo off

FOR /F "tokens=7 delims=. " %%A IN ('findstr encoded "%WORKING_DIRECTORY%\%SOURCE_FILENAME%-1pass.txt"') DO SET CRF_VIDBITRATE=%%A

Echo.
Echo.
Echo.[ %TIME% ] Encoding pass 2 ...
Echo.

@Echo on
"%x264_PATH%" --pass 2 --bitrate %CRF_VIDBITRATE% --stats "%WORKING_DIRECTORY%\%SOURCE_FILENAME%.stats" --level 4.1 --keyint 24 --min-keyint 1 --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto --deblock -1:-1 --subme 7 --trellis 2 --partitions all --8x8dct --vbv-bufsize 30000 --vbv-maxrate 24000 --me umh --threads auto --thread-input --aq-mode 2 --sar 1:1 --aud --progress --no-psnr --no-ssim --output "%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.h264" "%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs" --mvrange 511 --nal-hrd 2>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-2pass.txt"
@Echo off

kemuri-_9
23rd June 2009, 16:43
--b-adapt 2 on the 2nd pass is unused so you can remove it from the parameter list.

rack04
23rd June 2009, 17:07
--b-adapt 2 on the 2nd pass is unused so you can remove it from the parameter list.

I was not aware of that. Thanks for the tip.