diff --git a/pack-vid b/pack-vid index 88fb4b9..85161ee 100755 --- a/pack-vid +++ b/pack-vid @@ -28,6 +28,8 @@ $options = [ 'quality' => 1.0, 'hdr' => false, 'dither' => false, + 'width' => false, + 'height' => false, ]; 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" . " --quality=n fraction of base bitrate to break on (deafult 0.75)\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; @@ -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 ); $crop = boolval( $options['crop'] ); $letterbox = boolval( $options['letterbox'] );