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