This commit is contained in:
Brooke Vibber 2023-04-09 14:52:06 -07:00
parent b4832db888
commit 4757720ac4
1 changed files with 15 additions and 2 deletions

View File

@ -187,7 +187,7 @@ function convert( $src, $dest, $options ) {
}
$exposure = floatval( $options['exposure'] );
$peakNits = floatval( $options['peakNits'] );
$peakNits = floatval( $options['peak'] );
$sdrNits = 80;
$peak = $peakNits / $sdrNits;
@ -215,7 +215,8 @@ function convert( $src, $dest, $options ) {
// $preset = 'veryslow'; // annoying at higher resolutions
$preset = 'slow';
$passlog = tempnam( '.', 'pack-vid-passlog' );
$tempPrefix = 'pack-vid-passlog' . rand(0,1 << 31);
$passlog = tempnam( '.', $tempPrefix );
run( 'ffmpeg',
array_merge( [
'-i', $src,
@ -248,4 +249,16 @@ function convert( $src, $dest, $options ) {
'-y', $dest
] )
);
$len = strlen( $tempPrefix );
if ( $len > 0 ) {
$dir = dir( './' );
for ( $entry = $dir->read(); $entry !== false; $entry = $dir->read() ) {
if ( substr( $entry, 0, $len ) === $tempPrefix ) {
print "...deleting temp file: $entry\n";
unlink( $entry );
}
}
$dir->close();
}
}