Compare commits
No commits in common. "324a3fa064520a3778eab84abfc042a24f421c1c" and "96f4cf2f72a4d56cbb0b0f35a24fba90a01eea2f" have entirely different histories.
324a3fa064
...
96f4cf2f72
3 changed files with 4 additions and 66 deletions
28
pack-set-hdr
28
pack-set-hdr
|
|
@ -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
|
|
||||||
28
pack-set-vp9
28
pack-set-vp9
|
|
@ -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
|
|
||||||
14
pack-vid
14
pack-vid
|
|
@ -30,7 +30,6 @@ $options = [
|
||||||
'size' => $maxBytes,
|
'size' => $maxBytes,
|
||||||
'quality' => 1.0,
|
'quality' => 1.0,
|
||||||
'bitrate' => 0,
|
'bitrate' => 0,
|
||||||
'hdr-input' => false,
|
|
||||||
'hdr' => false,
|
'hdr' => false,
|
||||||
'dither' => false,
|
'dither' => false,
|
||||||
'width' => false,
|
'width' => false,
|
||||||
|
|
@ -72,8 +71,7 @@ if ( count ( $args ) < 2 ) {
|
||||||
" --bitrate=n target bitrate (exclusive with --size)\n" .
|
" --bitrate=n target bitrate (exclusive with --size)\n" .
|
||||||
" --size=n target file size in bytes (exclusive with --bitrate)\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" .
|
" --quality=n fraction of base bitrate to break on (deafult 1.0)\n" .
|
||||||
" --hdr-input force HDR input processing on\n" .
|
" --hdr force HDR input processing on\n" .
|
||||||
" --hdr force HDR output on (normally SDR output)\n" .
|
|
||||||
" --dither enable dithering in 8-bit downconversion\n" .
|
" --dither enable dithering in 8-bit downconversion\n" .
|
||||||
" --width=n override frame width in pixels\n" .
|
" --width=n override frame width in pixels\n" .
|
||||||
" --height=n override frame height 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'] );
|
$cropLeft = intval( $options['crop-left'] );
|
||||||
}
|
}
|
||||||
// @fixme some files are missing this? trims from qt?
|
// @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"
|
// pix_fmt: "yuv420p10le"
|
||||||
$hdrInput = substr( $track->pix_fmt, -5 ) === 'p10le' || $options['hdr-input'];
|
$hdr = substr( $track->pix_fmt, -5 ) === 'p10le' || $options['hdr'];
|
||||||
$hdr = $hdrInput && $options['hdr'];
|
|
||||||
if ( $options['keyframe-int'] ) {
|
if ( $options['keyframe-int'] ) {
|
||||||
$keyframeInt = intval( $options['keyframe-int'] );
|
$keyframeInt = intval( $options['keyframe-int'] );
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -320,8 +317,6 @@ function convert( $src, $dest, $options ) {
|
||||||
}
|
}
|
||||||
$filters[] = "scale=w=$scaleWidth:h=$scaleHeight";
|
$filters[] = "scale=w=$scaleWidth:h=$scaleHeight";
|
||||||
if ( $hdr ) {
|
if ( $hdr ) {
|
||||||
$filters[] = "format=yuv420p10le";
|
|
||||||
} elseif ( $hdrInput ) {
|
|
||||||
$filters[] = "zscale=t=linear:p=709:m=709";
|
$filters[] = "zscale=t=linear:p=709:m=709";
|
||||||
if ( $exposure ) {
|
if ( $exposure ) {
|
||||||
$filters[] = "exposure=$exposure";
|
$filters[] = "exposure=$exposure";
|
||||||
|
|
@ -340,9 +335,8 @@ function convert( $src, $dest, $options ) {
|
||||||
if ( $vibrance ) {
|
if ( $vibrance ) {
|
||||||
$filters[] = "vibrance=$vibrance";
|
$filters[] = "vibrance=$vibrance";
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$filters[] = "format=yuv420p";
|
|
||||||
}
|
}
|
||||||
|
$filters[] = "format=yuv420p";
|
||||||
if ( $crop ) {
|
if ( $crop ) {
|
||||||
$filters[] = "crop=w=$frameWidth:h=$frameHeight";
|
$filters[] = "crop=w=$frameWidth:h=$frameHeight";
|
||||||
} elseif ( $letterbox ) {
|
} elseif ( $letterbox ) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue