Compare commits
No commits in common. "2ac10e635010f7c96385b2c684d9ecc5af244583" and "4d6d4fc6da8f7ffc340e7282b5e1d6521a90389e" have entirely different histories.
2ac10e6350
...
4d6d4fc6da
2 changed files with 6 additions and 16 deletions
5
pack-set
5
pack-set
|
|
@ -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
|
|
||||||
17
pack-vid
17
pack-vid
|
|
@ -18,9 +18,9 @@ $maxBytes = $maxBytes * 15 / 16; // leave some headroom
|
||||||
$options = [
|
$options = [
|
||||||
'crop' => false,
|
'crop' => false,
|
||||||
'no-audio' => false,
|
'no-audio' => false,
|
||||||
'exposure' => '-1', // stops
|
'exposure' => '-0.5', // half stop down
|
||||||
'peak' => '1000', // '10000' is max
|
'peak' => '1000', // '10000' is max
|
||||||
'fps' => '60000/1001',
|
'fps' => '60',
|
||||||
'size' => $maxBytes,
|
'size' => $maxBytes,
|
||||||
'quality' => 1.0,
|
'quality' => 1.0,
|
||||||
];
|
];
|
||||||
|
|
@ -168,8 +168,7 @@ function convert( $src, $dest, $options ) {
|
||||||
} else {
|
} else {
|
||||||
$frameWidth = 1920;
|
$frameWidth = 1920;
|
||||||
$frameHeight = 1080;
|
$frameHeight = 1080;
|
||||||
// Cap the bitrate rather than making larger encodings.
|
$bitrate = $base * 4;
|
||||||
$bitrate = min( $bitrate, $base * 8 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$aspect = $width / $height;
|
$aspect = $width / $height;
|
||||||
|
|
@ -200,13 +199,12 @@ function convert( $src, $dest, $options ) {
|
||||||
|
|
||||||
$filters = [ "scale=w=$scaleWidth:h=$scaleHeight" ];
|
$filters = [ "scale=w=$scaleWidth:h=$scaleHeight" ];
|
||||||
if ( $hdr ) {
|
if ( $hdr ) {
|
||||||
$filters[] = "zscale=t=linear";
|
$filters[] = "zscale=t=linear:p=bt2020";
|
||||||
if ( $exposure ) {
|
if ( $exposure ) {
|
||||||
$filters[] = "exposure=$exposure";
|
$filters[] = "exposure=$exposure";
|
||||||
}
|
}
|
||||||
$filters[] = "tonemap=hable:peak=$peak";
|
$filters[] = "tonemap=hable:peak=$peak";
|
||||||
$filters[] = "zscale=t=bt709:p=bt709:m=bt709:r=full";
|
$filters[] = "zscale=t=bt709:p=bt709:m=bt709:r=full";
|
||||||
$filters[] = "vibrance=0.20";
|
|
||||||
}
|
}
|
||||||
$filters[] = "format=yuv420p";
|
$filters[] = "format=yuv420p";
|
||||||
if ( $crop ) {
|
if ( $crop ) {
|
||||||
|
|
@ -222,7 +220,6 @@ function convert( $src, $dest, $options ) {
|
||||||
|
|
||||||
// $preset = 'veryslow'; // annoying at higher resolutions
|
// $preset = 'veryslow'; // annoying at higher resolutions
|
||||||
$preset = 'slow';
|
$preset = 'slow';
|
||||||
//$preset = 'fast';
|
|
||||||
|
|
||||||
$tempPrefix = 'pack-vid-passlog' . rand(0,1 << 31);
|
$tempPrefix = 'pack-vid-passlog' . rand(0,1 << 31);
|
||||||
$passlog = tempnam( '.', $tempPrefix );
|
$passlog = tempnam( '.', $tempPrefix );
|
||||||
|
|
@ -230,8 +227,7 @@ function convert( $src, $dest, $options ) {
|
||||||
array_merge( [
|
array_merge( [
|
||||||
'-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,
|
||||||
|
|
@ -247,8 +243,7 @@ function convert( $src, $dest, $options ) {
|
||||||
array_merge( [
|
array_merge( [
|
||||||
'-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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue