Compare commits

..

No commits in common. "324a3fa064520a3778eab84abfc042a24f421c1c" and "96f4cf2f72a4d56cbb0b0f35a24fba90a01eea2f" have entirely different histories.

3 changed files with 4 additions and 66 deletions

View file

@ -1,28 +0,0 @@
#!/bin/bash
set -e
OPTS=""
for INFILE in "$@"
do
if [[ "$1" =~ ^--.* ]]
then
echo "OPTION: $1"
OPTS="$OPTS $1"
shift
else
echo "FILE: $INFILE"
COMMON="--vcodec=libsvtav1 --hdr"
SPEED_SMALL="4"
SPEED_LARGE="4"
SMALL="$COMMON --size=4m --quality=0.5 --preset=$SPEED_SMALL"
MED="$COMMON --size=10m --quality=0.75 --preset=$SPEED_SMALL"
TEN80="$COMMON --bitrate=4000000 --width=1920 --height=1080 --preset=$SPEED_LARGE"
pack-vid $SMALL $OPTS "$INFILE" "${INFILE%.mp4}-hdr-av1-small.webm"
pack-vid $MED $OPTS "$INFILE" "${INFILE%.mp4}-hdr-av1-med.webm"
pack-vid $TEN80 $OPTS "$INFILE" "${INFILE%.mp4}-hdr-av1-1080p.webm"
fi
done

View file

@ -1,28 +0,0 @@
#!/bin/bash
set -e
OPTS=""
for INFILE in "$@"
do
if [[ "$1" =~ ^--.* ]]
then
echo "OPTION: $1"
OPTS="$OPTS $1"
shift
else
echo "FILE: $INFILE"
COMMON="--vcodec=libvpx-vp9 --hdr"
SPEED_SMALL="2"
SPEED_LARGE="2"
SMALL="$COMMON --size=4m --quality=0.5 --speed=$SPEED_SMALL"
MED="$COMMON --size=10m --quality=0.75 --speed=$SPEED_SMALL"
TEN80="$COMMON --bitrate=4000000 --width=1920 --height=1080 --preset=$SPEED_LARGE"
pack-vid $SMALL $OPTS "$INFILE" "${INFILE%.mp4}-hdr-vp9-small.webm"
pack-vid $MED $OPTS "$INFILE" "${INFILE%.mp4}-hdr-vp9-med.webm"
pack-vid $TEN80 $OPTS "$INFILE" "${INFILE%.mp4}-hdr-vp9-1080p.webm"
fi
done

View file

@ -30,7 +30,6 @@ $options = [
'size' => $maxBytes,
'quality' => 1.0,
'bitrate' => 0,
'hdr-input' => false,
'hdr' => false,
'dither' => false,
'width' => false,
@ -72,8 +71,7 @@ if ( count ( $args ) < 2 ) {
" --bitrate=n target bitrate (exclusive with --size)\n" .
" --size=n target file size in bytes (exclusive with --bitrate)\n" .
" --quality=n fraction of base bitrate to break on (deafult 1.0)\n" .
" --hdr-input force HDR input processing on\n" .
" --hdr force HDR output on (normally SDR output)\n" .
" --hdr force HDR input processing on\n" .
" --dither enable dithering in 8-bit downconversion\n" .
" --width=n override frame width in pixels\n" .
" --height=n override frame height in pixels\n" .
@ -192,10 +190,9 @@ function convert( $src, $dest, $options ) {
$cropLeft = intval( $options['crop-left'] );
}
// @fixme some files are missing this? trims from qt?
//$hdrInput = $track->color_primaries === 'bt2020' || $options['hdr-input'];
//$hdr = $track->color_primaries === 'bt2020' || $options['hdr'];
// pix_fmt: "yuv420p10le"
$hdrInput = substr( $track->pix_fmt, -5 ) === 'p10le' || $options['hdr-input'];
$hdr = $hdrInput && $options['hdr'];
$hdr = substr( $track->pix_fmt, -5 ) === 'p10le' || $options['hdr'];
if ( $options['keyframe-int'] ) {
$keyframeInt = intval( $options['keyframe-int'] );
} else {
@ -320,8 +317,6 @@ function convert( $src, $dest, $options ) {
}
$filters[] = "scale=w=$scaleWidth:h=$scaleHeight";
if ( $hdr ) {
$filters[] = "format=yuv420p10le";
} elseif ( $hdrInput ) {
$filters[] = "zscale=t=linear:p=709:m=709";
if ( $exposure ) {
$filters[] = "exposure=$exposure";
@ -340,9 +335,8 @@ function convert( $src, $dest, $options ) {
if ( $vibrance ) {
$filters[] = "vibrance=$vibrance";
}
} else {
$filters[] = "format=yuv420p";
}
$filters[] = "format=yuv420p";
if ( $crop ) {
$filters[] = "crop=w=$frameWidth:h=$frameHeight";
} elseif ( $letterbox ) {