fixes
This commit is contained in:
parent
b4832db888
commit
4757720ac4
1 changed files with 15 additions and 2 deletions
17
pack-vid
17
pack-vid
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue