Compare commits
2 commits
114a105d1c
...
5546481191
Author | SHA1 | Date | |
---|---|---|---|
5546481191 | |||
0c459a0709 |
1 changed files with 9 additions and 2 deletions
11
pack-vid
11
pack-vid
|
@ -108,10 +108,13 @@ function convert( $src, $dest, $options ) {
|
|||
}
|
||||
|
||||
$mbits = 1000 * 1000;
|
||||
if ( $bitrate < 2 * $mbits ) {
|
||||
if ( $bitrate < $mbits ) {
|
||||
$frameWidth = 640;
|
||||
$frameHeight = 360;
|
||||
} elseif ( $bitrate < 2 * $mbits ) {
|
||||
$frameWidth = 854;
|
||||
$frameHeight = 480;
|
||||
} else if ( $bitrate <= 4 * $mbits ) {
|
||||
} elseif ( $bitrate < 4 * $mbits ) {
|
||||
$frameWidth = 1280;
|
||||
$frameHeight = 720;
|
||||
} else {
|
||||
|
@ -142,10 +145,13 @@ function convert( $src, $dest, $options ) {
|
|||
}
|
||||
$vf = implode( ',', $filters );
|
||||
|
||||
$fps = 30;
|
||||
|
||||
run( 'ffmpeg',
|
||||
array_merge( [
|
||||
'-i', $src,
|
||||
'-f', 'mp4',
|
||||
'-r', $fps,
|
||||
'-vf', $vf,
|
||||
'-c:v', 'libx264',
|
||||
'-b:v', $bitrate,
|
||||
|
@ -160,6 +166,7 @@ function convert( $src, $dest, $options ) {
|
|||
array_merge( [
|
||||
'-i', $src,
|
||||
'-vf', $vf,
|
||||
'-r', $fps,
|
||||
'-c:v', 'libx264',
|
||||
'-b:v', $bitrate,
|
||||
'-preset', 'veryslow',
|
||||
|
|
Loading…
Reference in a new issue