allow 288p, 180p, 144p output for low-bitrate videos
This commit is contained in:
parent
1512776b6c
commit
830b10c318
1 changed files with 13 additions and 1 deletions
14
pack-vid
14
pack-vid
|
@ -171,7 +171,19 @@ function convert( $src, $dest, $options ) {
|
|||
|
||||
$mbits = 1000 * 1000;
|
||||
$base = intval( $mbits * floatval( $options['quality'] ) );
|
||||
if ( $bitrate < 1 * $base || $height < 480 ) {
|
||||
if ( $bitrate < 0.125 * $base || $height < 144 ) {
|
||||
$frameWidth = 256;
|
||||
$frameHeight = 144;
|
||||
$bitrate = min( $bitrate, $base * 0.25 );
|
||||
} elseif ( $bitrate < 0.25 * $base || $height < 180 ) {
|
||||
$frameWidth = 320;
|
||||
$frameHeight = 180;
|
||||
$bitrate = min( $bitrate, $base * 0.5 );
|
||||
} elseif ( $bitrate < 0.5 * $base || $height < 288 ) {
|
||||
$frameWidth = 512;
|
||||
$frameHeight = 288;
|
||||
$bitrate = min( $bitrate, $base * 0.5 );
|
||||
} elseif ( $bitrate < 1 * $base || $height < 480 ) {
|
||||
$frameWidth = 640;
|
||||
$frameHeight = 360;
|
||||
$bitrate = min( $bitrate, $base );
|
||||
|
|
Loading…
Reference in a new issue