allow overriding frame size
This commit is contained in:
parent
3127862487
commit
742238f642
1 changed files with 12 additions and 1 deletions
13
pack-vid
13
pack-vid
|
@ -28,6 +28,8 @@ $options = [
|
||||||
'quality' => 1.0,
|
'quality' => 1.0,
|
||||||
'hdr' => false,
|
'hdr' => false,
|
||||||
'dither' => false,
|
'dither' => false,
|
||||||
|
'width' => false,
|
||||||
|
'height' => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) {
|
while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) {
|
||||||
|
@ -55,7 +57,9 @@ if ( count ( $args ) < 2 ) {
|
||||||
" --size=n target file size in bytes (default 3.5M)\n" .
|
" --size=n target file size in bytes (default 3.5M)\n" .
|
||||||
" --quality=n fraction of base bitrate to break on (deafult 0.75)\n" .
|
" --quality=n fraction of base bitrate to break on (deafult 0.75)\n" .
|
||||||
" --hdr force HDR input processing on\n" .
|
" --hdr force HDR input processing on\n" .
|
||||||
" --dither enable dithering in 8-bit downconversion\n"
|
" --dither enable dithering in 8-bit downconversion\n" .
|
||||||
|
" --width override frame width in pixels\n" .
|
||||||
|
" --height override frame height in pixels\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
[ $src, $dest ] = $args;
|
[ $src, $dest ] = $args;
|
||||||
|
@ -251,6 +255,13 @@ function convert( $src, $dest, $options ) {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if ( $options['width'] ) {
|
||||||
|
$frameWidth = intval( $options['width'] );
|
||||||
|
}
|
||||||
|
if ( $options['height'] ) {
|
||||||
|
$frameHeight = intval( $options['height'] );
|
||||||
|
}
|
||||||
|
|
||||||
$wide = $aspect > ( $frameWidth / $frameHeight );
|
$wide = $aspect > ( $frameWidth / $frameHeight );
|
||||||
$crop = boolval( $options['crop'] );
|
$crop = boolval( $options['crop'] );
|
||||||
$letterbox = boolval( $options['letterbox'] );
|
$letterbox = boolval( $options['letterbox'] );
|
||||||
|
|
Loading…
Reference in a new issue