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; $mbits = 1000 * 1000;
if ( $bitrate < 2 * $mbits ) { if ( $bitrate < $mbits ) {
$frameWidth = 640;
$frameHeight = 360;
} elseif ( $bitrate < 2 * $mbits ) {
$frameWidth = 854; $frameWidth = 854;
$frameHeight = 480; $frameHeight = 480;
} else if ( $bitrate <= 4 * $mbits ) { } elseif ( $bitrate < 4 * $mbits ) {
$frameWidth = 1280; $frameWidth = 1280;
$frameHeight = 720; $frameHeight = 720;
} else { } else {
@ -142,10 +145,13 @@ 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,
@ -160,6 +166,7 @@ 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',