fps limiter option, now default to 60
uses -fpsmax on ffmpeg
This commit is contained in:
parent
d07f3b7ce1
commit
55d9c94887
1 changed files with 7 additions and 5 deletions
12
pack-vid
12
pack-vid
|
@ -15,7 +15,8 @@ $options = [
|
||||||
'letterbox' => false,
|
'letterbox' => false,
|
||||||
'audio' => false,
|
'audio' => false,
|
||||||
'exposure' => '0',
|
'exposure' => '0',
|
||||||
'peak' => '10000'
|
'peak' => '10000',
|
||||||
|
'fps' => '60',
|
||||||
];
|
];
|
||||||
|
|
||||||
while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) {
|
while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) {
|
||||||
|
@ -36,7 +37,8 @@ if ( count ( $args ) < 2 ) {
|
||||||
" --letterbox pad instead of cropping\n" .
|
" --letterbox pad instead of cropping\n" .
|
||||||
" --audio include audio\n" .
|
" --audio include audio\n" .
|
||||||
" --exposure=n adjust exposure\n" .
|
" --exposure=n adjust exposure\n" .
|
||||||
" --peak=n set HDR peak nits\n"
|
" --peak=n set HDR peak nits\n" .
|
||||||
|
" --fps=n set frame rate\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
[ $src, $dest ] = $args;
|
[ $src, $dest ] = $args;
|
||||||
|
@ -183,14 +185,14 @@ function convert( $src, $dest, $options ) {
|
||||||
}
|
}
|
||||||
$vf = implode( ',', $filters );
|
$vf = implode( ',', $filters );
|
||||||
|
|
||||||
$fps = 30;
|
$fps = $options['fps'];
|
||||||
|
|
||||||
$passlog = tempnam( '.', 'pack-vid-passlog' );
|
$passlog = tempnam( '.', 'pack-vid-passlog' );
|
||||||
run( 'ffmpeg',
|
run( 'ffmpeg',
|
||||||
array_merge( [
|
array_merge( [
|
||||||
'-i', $src,
|
'-i', $src,
|
||||||
'-f', 'mp4',
|
'-f', 'mp4',
|
||||||
'-r', $fps,
|
'-fpsmax', $fps,
|
||||||
'-vf', $vf,
|
'-vf', $vf,
|
||||||
'-c:v', 'libx264',
|
'-c:v', 'libx264',
|
||||||
'-b:v', $bitrate,
|
'-b:v', $bitrate,
|
||||||
|
@ -206,7 +208,7 @@ function convert( $src, $dest, $options ) {
|
||||||
array_merge( [
|
array_merge( [
|
||||||
'-i', $src,
|
'-i', $src,
|
||||||
'-vf', $vf,
|
'-vf', $vf,
|
||||||
'-r', $fps,
|
'-fpsmax', $fps,
|
||||||
'-c:v', 'libx264',
|
'-c:v', 'libx264',
|
||||||
'-b:v', $bitrate,
|
'-b:v', $bitrate,
|
||||||
'-preset', 'veryslow',
|
'-preset', 'veryslow',
|
||||||
|
|
Loading…
Reference in a new issue