Merge remote-tracking branch 'parent/stable-4.2' into kb_development
This commit is contained in:
commit
454f262b2f
23 changed files with 370 additions and 389 deletions
|
@ -29,7 +29,7 @@ module Mastodon
|
|||
end
|
||||
|
||||
def default_prerelease
|
||||
'rc1'
|
||||
'rc2'
|
||||
end
|
||||
|
||||
def prerelease
|
||||
|
|
|
@ -41,11 +41,14 @@ module Paperclip
|
|||
@output_options['vframes'] = 1
|
||||
when 'mp4'
|
||||
unless eligible_to_passthrough?(metadata)
|
||||
bitrate = (metadata.width * metadata.height * 30 * BITS_PER_PIXEL) / 1_000
|
||||
size_limit_in_bits = MediaAttachment::VIDEO_LIMIT * 8
|
||||
desired_bitrate = (metadata.width * metadata.height * 30 * BITS_PER_PIXEL).floor
|
||||
maximum_bitrate = (size_limit_in_bits / metadata.duration).floor - 192_000 # Leave some space for the audio stream
|
||||
bitrate = [desired_bitrate, maximum_bitrate].min
|
||||
|
||||
@output_options['b:v'] = "#{bitrate}k"
|
||||
@output_options['maxrate'] = "#{bitrate + 192}k"
|
||||
@output_options['bufsize'] = "#{bitrate * 5}k"
|
||||
@output_options['b:v'] = bitrate
|
||||
@output_options['maxrate'] = bitrate + 192_000
|
||||
@output_options['bufsize'] = bitrate * 5
|
||||
|
||||
if high_vfr?(metadata)
|
||||
@output_options['vsync'] = 'vfr'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue