Change --hdr to control hdr output instead of tonemapping of input
Keep --hdr-input for the old forcing
This commit is contained in:
parent
96f4cf2f72
commit
ca2ab23a97
1 changed files with 10 additions and 4 deletions
14
pack-vid
14
pack-vid
|
|
@ -30,6 +30,7 @@ $options = [
|
|||
'size' => $maxBytes,
|
||||
'quality' => 1.0,
|
||||
'bitrate' => 0,
|
||||
'hdr-input' => false,
|
||||
'hdr' => false,
|
||||
'dither' => false,
|
||||
'width' => false,
|
||||
|
|
@ -71,7 +72,8 @@ if ( count ( $args ) < 2 ) {
|
|||
" --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" .
|
||||
" --hdr-input force HDR input processing on\n" .
|
||||
" --hdr force HDR output on (normally SDR output)\n" .
|
||||
" --dither enable dithering in 8-bit downconversion\n" .
|
||||
" --width=n override frame width in pixels\n" .
|
||||
" --height=n override frame height in pixels\n" .
|
||||
|
|
@ -190,9 +192,10 @@ function convert( $src, $dest, $options ) {
|
|||
$cropLeft = intval( $options['crop-left'] );
|
||||
}
|
||||
// @fixme some files are missing this? trims from qt?
|
||||
//$hdr = $track->color_primaries === 'bt2020' || $options['hdr'];
|
||||
//$hdrInput = $track->color_primaries === 'bt2020' || $options['hdr-input'];
|
||||
// pix_fmt: "yuv420p10le"
|
||||
$hdr = substr( $track->pix_fmt, -5 ) === 'p10le' || $options['hdr'];
|
||||
$hdrInput = substr( $track->pix_fmt, -5 ) === 'p10le' || $options['hdr-input'];
|
||||
$hdr = $hdrInput && $options['hdr'];
|
||||
if ( $options['keyframe-int'] ) {
|
||||
$keyframeInt = intval( $options['keyframe-int'] );
|
||||
} else {
|
||||
|
|
@ -335,8 +338,11 @@ function convert( $src, $dest, $options ) {
|
|||
if ( $vibrance ) {
|
||||
$filters[] = "vibrance=$vibrance";
|
||||
}
|
||||
}
|
||||
} elseif ( $hdrInput ) {
|
||||
$filters[] = "format=yuv420p10le";
|
||||
} else {
|
||||
$filters[] = "format=yuv420p";
|
||||
}
|
||||
if ( $crop ) {
|
||||
$filters[] = "crop=w=$frameWidth:h=$frameHeight";
|
||||
} elseif ( $letterbox ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue