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