Skip to content

Commit dc32962

Browse files
committed
Eliminate upper limit on vbv-bufsize calculation.
1 parent f229e54 commit dc32962

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

bin/transcode-video

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -758,21 +758,17 @@ HERE
758758

759759
if width > 1920 or height > 1080
760760
vbv_maxrate = @vbv_maxrate_2160p
761-
max_bufsize = 300000
762761
elsif width > 1280 or height > 720
763762
vbv_maxrate = @vbv_maxrate_1080p
764-
max_bufsize = 25000
765763

766764
case preset
767765
when 'slow', 'slower', 'veryslow', 'placebo'
768766
handbrake_options['encoder-level'] = '4.0'
769767
end
770768
elsif width > 720 or height > 576
771769
vbv_maxrate = @vbv_maxrate_720p
772-
max_bufsize = 17500
773770
else
774771
vbv_maxrate = @vbv_maxrate_480p
775-
max_bufsize = 12500
776772
end
777773

778774
unless media.info[:directory]
@@ -789,16 +785,13 @@ HERE
789785
end
790786
end
791787

792-
vbv_bufsize = @encoder_options.fetch('vbv-maxrate', vbv_maxrate).to_i / 2
793-
vbv_bufsize = max_bufsize if vbv_bufsize > max_bufsize
794-
795788
case preset
796789
when 'slower', 'veryslow', 'placebo'
797790
encoder_options['ref'] = '5'
798791
end
799792

800793
encoder_options['vbv-maxrate'] = vbv_maxrate.to_s
801-
encoder_options['vbv-bufsize'] = vbv_bufsize.to_s
794+
encoder_options['vbv-bufsize'] = (@encoder_options.fetch('vbv-maxrate', vbv_maxrate).to_i / 2).to_s
802795
encoder_options['crf-max'] = '25'
803796

804797
if @quick and not @handbrake_options.has_key? 'encoder-preset'

0 commit comments

Comments
 (0)