This commit is contained in:
Brooke Vibber 2025-10-05 16:43:23 -07:00
commit 4802c9e4c0

View file

@ -355,7 +355,11 @@ function convert( $src, $dest, $options ) {
$fps = $options['fps'];
if ( $options['preset'] ) {
if ( $options['vcodec'] === 'libvpx' || $options['vcodec'] === 'libvpx-vp9' ) {
$preset = [ '-speed', $options['preset'] ];
} else {
$preset = [ '-preset', $options[ 'preset' ] ];
}
} else {
$preset = [];
}
@ -369,7 +373,16 @@ function convert( $src, $dest, $options ) {
$format = [];
}
$vcodec = $options['vcodec'];
$vcodec = [
'-vcodec', $options['vcodec']
];
switch ( $options['vcode'] ) {
case 'libvpx-vp9':
$vcodec[] = '-row-mt';
$vcodec[] = 1;
break;
default:
}
$tempPrefix = 'pack-vid-passlog' . rand(0,1 << 31);
$passlog = tempnam( '.', $tempPrefix );
@ -379,7 +392,7 @@ function convert( $src, $dest, $options ) {
'-f', 'mp4',
'-fpsmax', $fps,
'-vf', $vf,
'-c:v', $vcodec,
], $vcodec, [
'-b:v', $bitrate,
], $preset, [
'-pass', '1',