fixes
* add 540p between 480p and 720p * use veryslow for small and medium for large * fix max bitrate for lower resolutions * throw in more b-frames for fun (may not be relevant)
This commit is contained in:
parent
a982d7d812
commit
7317855d05
2 changed files with 14 additions and 6 deletions
8
pack-set
8
pack-set
|
@ -5,11 +5,11 @@ do
|
|||
echo "$INFILE"
|
||||
|
||||
COMMON="--quality=0.75 --exposure=-2.5 --peak=141 --fps=60000/1001"
|
||||
SPEED="slow"
|
||||
#SPEED="veryfast"
|
||||
SPEED_SMALL="veryslow"
|
||||
SPEED_LARGE="medium"
|
||||
|
||||
SMALL="$COMMON --size=4m --preset=$SPEED"
|
||||
LARGE="$COMMON --size=25m --preset=$SPEED"
|
||||
SMALL="$COMMON --size=4m --preset=$SPEED_SMALL"
|
||||
LARGE="$COMMON --size=25m --preset=$SPEED_LARGE"
|
||||
|
||||
pack-vid $SMALL "$INFILE" "${INFILE%.mp4}-small.mp4"
|
||||
pack-vid $LARGE "$INFILE" "${INFILE%.mp4}-large.mp4"
|
||||
|
|
12
pack-vid
12
pack-vid
|
@ -164,16 +164,22 @@ function convert( $src, $dest, $options ) {
|
|||
if ( $bitrate < 1 * $base || $height < 480 ) {
|
||||
$frameWidth = 640;
|
||||
$frameHeight = 360;
|
||||
} elseif ( $bitrate < 2 * $base || $height < 720) {
|
||||
$bitrate = min( $bitrate, $base );
|
||||
} elseif ( $bitrate < 2 * $base || $height < 540) {
|
||||
$frameWidth = 854;
|
||||
$frameHeight = 480;
|
||||
$bitrate = min( $bitrate, $base * 2 );
|
||||
} elseif ( $bitrate < 2.5 * $base || $height < 720) {
|
||||
$frameWidth = 960;
|
||||
$frameHeight = 540;
|
||||
$bitrate = min( $bitrate, $base * 2.5 );
|
||||
} elseif ( $bitrate < 4 * $base || $height < 1080) {
|
||||
$frameWidth = 1280;
|
||||
$frameHeight = 720;
|
||||
$bitrate = min( $bitrate, $base * 4 );
|
||||
} else {
|
||||
$frameWidth = 1920;
|
||||
$frameHeight = 1080;
|
||||
// Cap the bitrate rather than making larger encodings.
|
||||
$bitrate = min( $bitrate, $base * 8 );
|
||||
}
|
||||
|
||||
|
@ -240,6 +246,7 @@ function convert( $src, $dest, $options ) {
|
|||
'-c:v', 'libx264',
|
||||
'-b:v', $bitrate,
|
||||
'-preset', $preset,
|
||||
'-bf', '16',
|
||||
'-pass', '1',
|
||||
'-passlogfile', $passlog,
|
||||
'-g', $keyframeInt,
|
||||
|
@ -256,6 +263,7 @@ function convert( $src, $dest, $options ) {
|
|||
'-c:v', 'libx264',
|
||||
'-b:v', $bitrate,
|
||||
'-preset', $preset,
|
||||
'-bf', '16',
|
||||
'-pass', '2',
|
||||
'-passlogfile', $passlog,
|
||||
'-g', $keyframeInt,
|
||||
|
|
Loading…
Reference in a new issue