View Single Post
Old 28th May 2017, 22:32   #2  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Hi pojke,

I made ffmpeg_VBR plugins for AVStoDVD and for DVDStyler a while ago, both have the option to use an "Extremely High Quality" 2-pass VBR mode for FFmpeg. For DVDStyler my plugin is transparently integrated into the software, so this might be the easiest way to use this mode.

The FFmpeg parameters for this mode were basically developed by forum member Fishman0919, and they were optimized further with the help of some DVDStyler forum members.

If you prefer to use FFmpeg from the command line, here is the basic script:

Code:
ffmpeg.exe -i %in% %aspect% %threads% %filter% %size% %dc% -g 12 -bf 2 -maxrate 8000k -q:v 2 %first_hq% %CQM% -pass 1 -passlogfile "%out_path%ffmpeg" -an -c:v mpeg2video %il% "%out_path%pass1.m2v"

ffmpeg.exe -i %in% %aspect% %threads% %filter% %size% %dc% -g 12 -bf 2 -lmin 0.75 -mblmin 50 -qmin 1 -qmax 31 -maxrate 8000k -b:v %bitrate%k %second_hq% %CQM% -pass 2 -passlogfile "%out_path%ffmpeg" -an -c:v mpeg2video %il% %out%
Of course you need to resolve all the values for the variables, this part from the original batch file from AVStoDVD should give you the needed information:

Code:
:2pass
IF %bitrate% GTR 7990 SET bitrate=7990
IF EXIST "%out_path%ffmpeg*.log" DEL "%out_path%ffmpeg*.log"
IF EXIST "%out_path%pass1.m2v" DEL "%out_path%pass1.m2v"
IF [%interlaced%==[1 SET il=-flags +ilme+ildct -alternate_scan 1 -top 1
IF [%bff%==[1 SET il=-flags +ilme+ildct -alternate_scan 1 -top 0
IF NOT [%Force 2-pass VBR%==[1 IF NOT [%Force 2-pass VBR%==[2 IF EXIST "Fox New.txt" SET /P CQM=<"Fox New.txt"
IF NOT [%Force 2-pass VBR%==[1 SET first_hq=-b_strategy 2 -brd_scale 2 -profile:v 4
SET second_hq=-pre_dia_size 5 -dia_size 5 -qcomp 0.7 -qblur 0 -preme 2 -me_method dia -sc_threshold 0 -sc_factor 4 -bidir_refine 4 -profile:v 4 -mbd rd -mbcmp satd -precmp satd -cmp satd -subcmp satd -skipcmp satd
SET user_hq=%user_hq:-bf 2 =%
IF [%Force 2-pass VBR%==[2 SET second_hq=%user_hq%
IF [%Force 2-pass VBR%==[1 SET second_hq=

Cheers
manolito
manolito is offline   Reply With Quote