* 600 -> 800 on pack-preset
* audio-channels and audio-bitrate options on pack-video
This commit is contained in:
Brooke Vibber 2024-10-23 19:10:40 -07:00
parent 6bb7e08525
commit dffe1a0402
2 changed files with 14 additions and 5 deletions

View file

@ -1 +1,2 @@
pack-set --color-temperature=6800 --peak=600 --vibrance=0.2 "$@" #pack-set --color-temperature=6800 --peak=600 --vibrance=0.2 "$@"
pack-set --color-temperature=6800 --peak=800 --vibrance=0.2 "$@"

View file

@ -20,12 +20,15 @@ $options = [
'crop' => false, 'crop' => false,
'letterbox' => false, 'letterbox' => false,
'no-audio' => false, 'no-audio' => false,
'audio-bitrate' => 96000,
'audio-channels' => 2,
'exposure' => '0', // stops 'exposure' => '0', // stops
'peak' => '1000', // '10000' is max 'peak' => '1000', // '10000' is max
'preset' => 'medium', 'preset' => 'medium',
'fps' => '60000/1001', 'fps' => '60000/1001',
'size' => $maxBytes, 'size' => $maxBytes,
'quality' => 1.0, 'quality' => 1.0,
'bitrate' => 0,
'hdr' => false, 'hdr' => false,
'dither' => false, 'dither' => false,
'width' => false, 'width' => false,
@ -62,8 +65,9 @@ if ( count ( $args ) < 2 ) {
" --peak=n set HDR peak nits\n" . " --peak=n set HDR peak nits\n" .
" --preset=key set h.264 encoding preset\n" . " --preset=key set h.264 encoding preset\n" .
" --fps=n frame rate limit\n" . " --fps=n frame rate limit\n" .
" --size=n target file size in bytes (default 3.5M)\n" . " --bitrate=n target bitrate (exclusive with --size)\n" .
" --quality=n fraction of base bitrate to break on (deafult 0.75)\n" . " --size=n target file size in bytes (exclusive with --bitrate)\n" .
" --quality=n fraction of base bitrate to break on (deafult 1.0)\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=n override frame width in pixels\n" . " --width=n override frame width in pixels\n" .
@ -195,14 +199,18 @@ function convert( $src, $dest, $options ) {
} }
$bitrate = floor( $maxBits / $duration ); $bitrate = floor( $maxBits / $duration );
if ( $options['bitrate'] ) {
$bitrate = sizify( $options['bitrate'] );
}
if ( $options[ 'no-audio' ] || count( $audioTracks ) == 0 ) { if ( $options[ 'no-audio' ] || count( $audioTracks ) == 0 ) {
$audio = [ '-an' ]; $audio = [ '-an' ];
} else { } else {
$audioBitrate = 96 * 1000; $audioBitrate = $options[ 'audio-bitrate' ];
$audioChannels = $options[ 'audio-channels' ];
$audio = [ $audio = [
'-ac', 2, '-ac', $audioChannels,
'-b:a', $audioBitrate, '-b:a', $audioBitrate,
]; ];
$bitrate -= $audioBitrate; $bitrate -= $audioBitrate;