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,
|
||||
'audio' => false,
|
||||
'exposure' => '0',
|
||||
'peak' => '10000'
|
||||
'peak' => '10000',
|
||||
'fps' => '60',
|
||||
];
|
||||
|
||||
while ( count( $args ) > 0 && substr( $args[0], 0, 2 ) == '--' ) {
|
||||
|
@ -36,7 +37,8 @@ if ( count ( $args ) < 2 ) {
|
|||
" --letterbox pad instead of cropping\n" .
|
||||
" --audio include audio\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;
|
||||
|
@ -183,14 +185,14 @@ function convert( $src, $dest, $options ) {
|
|||
}
|
||||
$vf = implode( ',', $filters );
|
||||
|
||||
$fps = 30;
|
||||
$fps = $options['fps'];
|
||||
|
||||
$passlog = tempnam( '.', 'pack-vid-passlog' );
|
||||
run( 'ffmpeg',
|
||||
array_merge( [
|
||||
'-i', $src,
|
||||
'-f', 'mp4',
|
||||
'-r', $fps,
|
||||
'-fpsmax', $fps,
|
||||
'-vf', $vf,
|
||||
'-c:v', 'libx264',
|
||||
'-b:v', $bitrate,
|
||||
|
@ -206,7 +208,7 @@ function convert( $src, $dest, $options ) {
|
|||
array_merge( [
|
||||
'-i', $src,
|
||||
'-vf', $vf,
|
||||
'-r', $fps,
|
||||
'-fpsmax', $fps,
|
||||
'-c:v', 'libx264',
|
||||
'-b:v', $bitrate,
|
||||
'-preset', 'veryslow',
|
||||
|
|
Loading…
Reference in a new issue