Compare commits

...

2 commits

Author SHA1 Message Date
5546481191 add 30fps limiter
it's probably gonna get re-rendered anyway
2023-01-24 16:50:11 -08:00
0c459a0709 include a 360p size tier 2023-01-24 16:49:10 -08:00

View file

@ -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',