This commit is contained in:
Brooke Vibber 2023-05-27 17:04:17 -07:00
parent a2457707ed
commit 1512776b6c
2 changed files with 14 additions and 5 deletions

View file

@ -11,9 +11,11 @@ for INFILE in "$@"
do
echo "$INFILE"
COMMON="$OPTS --hdr --exposure=-2.5 --peak=141 --fps=60000/1001"
#COMMON="$OPTS --hdr --exposure=-2.5 --peak=141 --fps=60000/1001"
COMMON="$OPTS --hdr --exposure=-2 --peak=500 --fps=60000/1001"
SPEED_SMALL="veryslow"
SPEED_LARGE="medium"
#SPEED_LARGE="medium"
SPEED_LARGE="veryslow"
SMALL="$COMMON --size=4m --preset=$SPEED_SMALL"
LARGE="$COMMON --size=25m --preset=$SPEED_LARGE"

View file

@ -27,6 +27,7 @@ $options = [
'size' => $maxBytes,
'quality' => 1.0,
'hdr' => false,
'dither' => false,
];
while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) {
@ -53,7 +54,8 @@ if ( count ( $args ) < 2 ) {
" --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" .
" --hdr force HDR input processing on\n"
" --hdr force HDR input processing on\n" .
" --dither enable dithering in 8-bit downconversion\n"
);
}
[ $src, $dest ] = $args;
@ -267,8 +269,13 @@ function convert( $src, $dest, $options ) {
$filters[] = "exposure=$exposure";
}
$filters[] = "tonemap=hable:peak=$peak:desat=0.0";
$filters[] = "zscale=t=bt709:p=bt709:m=bt709:r=full";
$filters[] = "vibrance=0.0625";
if ( $options['dither'] ) {
$dither = ":dither=ordered";
} else {
$dither = "";
}
$filters[] = "zscale=t=bt709:p=bt709:m=bt709:r=full$dither";
$filters[] = "vibrance=0.2";
}
$filters[] = "format=yuv420p";
if ( $crop ) {