fixes for options

This commit is contained in:
Brooke Vibber 2023-10-26 11:10:59 -07:00
parent 64d494825c
commit 5ba048b8c8
2 changed files with 12 additions and 10 deletions

View file

@ -12,17 +12,17 @@ do
else else
echo "FILE: $INFILE" echo "FILE: $INFILE"
#COMMON="$OPTS" #COMMON=""
#COMMON="$OPTS --exposure=-2.5 --peak=141" #COMMON="--exposure=-2.5 --peak=141"
#COMMON="$OPTS --exposure=-1 --peak=500" #COMMON="--exposure=-1 --peak=500"
COMMON="$OPTS --peak=1000" COMMON="--peak=1000"
SPEED_SMALL="veryslow" SPEED_SMALL="veryslow"
SPEED_LARGE="slow" SPEED_LARGE="slow"
SMALL="$COMMON --size=4m --quality=0.75 --preset=$SPEED_SMALL" SMALL="$COMMON --size=4m --quality=0.75 --preset=$SPEED_SMALL"
LARGE="$COMMON --size=25m --preset=$SPEED_LARGE" LARGE="$COMMON --size=25m --preset=$SPEED_LARGE"
pack-vid $SMALL "$INFILE" "${INFILE%.mp4}-small.mp4" pack-vid $SMALL $OPTS "$INFILE" "${INFILE%.mp4}-small.mp4"
pack-vid $LARGE "$INFILE" "${INFILE%.mp4}-large.mp4" pack-vid $LARGE $OPTS "$INFILE" "${INFILE%.mp4}-large.mp4"
fi fi
done done

View file

@ -31,6 +31,7 @@ $options = [
'width' => false, 'width' => false,
'height' => false, 'height' => false,
'keyframe-int' => 0, 'keyframe-int' => 0,
'vibrance' => 0,
]; ];
while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) { while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) {
@ -300,6 +301,7 @@ function convert( $src, $dest, $options ) {
$peakNits = floatval( $options['peak'] ); $peakNits = floatval( $options['peak'] );
$sdrNits = 80; $sdrNits = 80;
$peak = $peakNits / $sdrNits; $peak = $peakNits / $sdrNits;
$vibrance = floatval( $options['vibrance'] );
$filters = [ "scale=w=$scaleWidth:h=$scaleHeight" ]; $filters = [ "scale=w=$scaleWidth:h=$scaleHeight" ];
if ( $hdr ) { if ( $hdr ) {
@ -313,8 +315,10 @@ function convert( $src, $dest, $options ) {
} else { } else {
$dither = ""; $dither = "";
} }
$filters[] = "zscale=t=bt709:p=bt709:m=bt709:r=full$dither"; $filters[] = "zscale=tin=linear:t=709:p=709:m=709:r=full$dither";
$filters[] = "vibrance=0.2"; if ( $vibrance ) {
$filters[] = "vibrance=$vibrance";
}
} }
$filters[] = "format=yuv420p"; $filters[] = "format=yuv420p";
if ( $crop ) { if ( $crop ) {
@ -337,7 +341,6 @@ function convert( $src, $dest, $options ) {
'-i', $src, '-i', $src,
'-f', 'mp4', '-f', 'mp4',
'-fpsmax', $fps, '-fpsmax', $fps,
//'-r', $fps,
'-vf', $vf, '-vf', $vf,
'-c:v', 'libx264', '-c:v', 'libx264',
'-b:v', $bitrate, '-b:v', $bitrate,
@ -354,7 +357,6 @@ function convert( $src, $dest, $options ) {
'-i', $src, '-i', $src,
'-vf', $vf, '-vf', $vf,
'-fpsmax', $fps, '-fpsmax', $fps,
//'-r', $fps,
'-c:v', 'libx264', '-c:v', 'libx264',
'-b:v', $bitrate, '-b:v', $bitrate,
'-preset', $preset, '-preset', $preset,