diff --git a/pack-set b/pack-set deleted file mode 100755 index 718690d..0000000 --- a/pack-set +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -COMMON="--quality=0.67" -pack-vid $COMMON --size=4m "$1" "${1%.mp4}-small.mp4" & -pack-vid $COMMON --size=25m "$1" "${1%.mp4}-large.mp4" & -wait diff --git a/pack-vid b/pack-vid index 7326546..8a9f391 100755 --- a/pack-vid +++ b/pack-vid @@ -18,9 +18,9 @@ $maxBytes = $maxBytes * 15 / 16; // leave some headroom $options = [ 'crop' => false, 'no-audio' => false, - 'exposure' => '-1', // stops + 'exposure' => '-0.5', // half stop down 'peak' => '1000', // '10000' is max - 'fps' => '60000/1001', + 'fps' => '60', 'size' => $maxBytes, 'quality' => 1.0, ]; @@ -168,8 +168,7 @@ function convert( $src, $dest, $options ) { } else { $frameWidth = 1920; $frameHeight = 1080; - // Cap the bitrate rather than making larger encodings. - $bitrate = min( $bitrate, $base * 8 ); + $bitrate = $base * 4; } $aspect = $width / $height; @@ -200,13 +199,12 @@ function convert( $src, $dest, $options ) { $filters = [ "scale=w=$scaleWidth:h=$scaleHeight" ]; if ( $hdr ) { - $filters[] = "zscale=t=linear"; + $filters[] = "zscale=t=linear:p=bt2020"; if ( $exposure ) { $filters[] = "exposure=$exposure"; } $filters[] = "tonemap=hable:peak=$peak"; $filters[] = "zscale=t=bt709:p=bt709:m=bt709:r=full"; - $filters[] = "vibrance=0.20"; } $filters[] = "format=yuv420p"; if ( $crop ) { @@ -222,7 +220,6 @@ function convert( $src, $dest, $options ) { // $preset = 'veryslow'; // annoying at higher resolutions $preset = 'slow'; - //$preset = 'fast'; $tempPrefix = 'pack-vid-passlog' . rand(0,1 << 31); $passlog = tempnam( '.', $tempPrefix ); @@ -230,8 +227,7 @@ function convert( $src, $dest, $options ) { array_merge( [ '-i', $src, '-f', 'mp4', - //'-fpsmax', $fps, - '-r', $fps, + '-fpsmax', $fps, '-vf', $vf, '-c:v', 'libx264', '-b:v', $bitrate, @@ -247,8 +243,7 @@ function convert( $src, $dest, $options ) { array_merge( [ '-i', $src, '-vf', $vf, - //'-fpsmax', $fps, - '-r', $fps, + '-fpsmax', $fps, '-c:v', 'libx264', '-b:v', $bitrate, '-preset', $preset,