use the old logic for sizing

This commit is contained in:
Brooke Vibber 2023-05-17 09:53:50 -07:00
parent 5181d41f91
commit 9c0e598ce2

View file

@ -169,7 +169,6 @@ function convert( $src, $dest, $options ) {
$mbits = 1000 * 1000; $mbits = 1000 * 1000;
$base = intval( $mbits * floatval( $options['quality'] ) ); $base = intval( $mbits * floatval( $options['quality'] ) );
/*
if ( $bitrate < 1 * $base || $height < 480 ) { if ( $bitrate < 1 * $base || $height < 480 ) {
$frameWidth = 640; $frameWidth = 640;
$frameHeight = 360; $frameHeight = 360;
@ -191,7 +190,6 @@ function convert( $src, $dest, $options ) {
$frameHeight = 1080; $frameHeight = 1080;
$bitrate = min( $bitrate, $base * 8 ); $bitrate = min( $bitrate, $base * 8 );
} }
*/
$aspect = $width / $height; $aspect = $width / $height;
$pixels = $width * $height; $pixels = $width * $height;
@ -199,6 +197,7 @@ function convert( $src, $dest, $options ) {
// canonical base rate is 1 megabit at 480p // canonical base rate is 1 megabit at 480p
$bitrate = min( $bitrate, 4 * $base ); $bitrate = min( $bitrate, 4 * $base );
/*
$minWidth = 640; $minWidth = 640;
$minHeight = 360; $minHeight = 360;
@ -233,6 +232,7 @@ function convert( $src, $dest, $options ) {
$bitrate = min( $bitrate, $maxrate ); $bitrate = min( $bitrate, $maxrate );
} }
} }
*/
$wide = $aspect > ( $frameWidth / $frameHeight ); $wide = $aspect > ( $frameWidth / $frameHeight );
$crop = boolval( $options['crop'] ); $crop = boolval( $options['crop'] );