summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-10-05 01:01:24 +0200
committerJonas Smedegaard <dr@jones.dk>2014-10-05 01:01:24 +0200
commit17bf49d41aeb11c3d62e3c41875277dc0792187c (patch)
tree99e45fa4beece4e9e48f276d09ec95402349c0e8 /localvideowebencode
parentfd8abe0b10e07eb5a34562a9deab110a47a90070 (diff)
Fix handle multiple input files.
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode14
1 files changed, 8 insertions, 6 deletions
diff --git a/localvideowebencode b/localvideowebencode
index acbcca5..2c19cc1 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -166,6 +166,8 @@ while true ; do
esac
done
+[ -n "$sample" ] || notsample=yes
+
# Resolve if system has many CPU cores
processors=$(nproc)
[ $processors -gt 2 ] || processors=
@@ -426,7 +428,7 @@ avconv_chained="avconv -threads auto -y -v warning"
vpxenc_chained="vpxenc --quiet ${processors:+-t $((processors-1))}"
oggenc="oggenc"
opusenc="opusenc"
-_melt_sample="$infile_first ${sample:+in=$((samplestart)) out=$((samplestart + samplelength))}"
+_melt_infiles="${notsample:+$infiles}${sample:+$infile_first in=$((samplestart)) out=$((samplestart + samplelength))}"
# filter options
_melt_video="progressive=1${framerate:+ frame_rate_num="$framerate_num" frame_rate_den="$framerate_den"}${size:+ s=${width:+$width}x${height:+$height}}${aspect:+ aspect=$aspect}"
@@ -485,7 +487,7 @@ _melt_img="f=image2 $_melt_video"
if [ -n "$multipass" ] && [ -n "$webm$vp9" ]; then
echo "Analyzing video complexity${do_loudness:+ and audio dynamics}..."
if [ -n "$use_vpxenc" ]; then
- $melt ${_melt_sample:-$infiles} \
+ $melt $_melt_infiles \
${do_loudness:+$audioprefilters -filter loudness} \
$filters \
${do_loudness:+-consumer xml:$stem.xml video_off=1 all=1} \
@@ -496,7 +498,7 @@ if [ -n "$multipass" ] && [ -n "$webm$vp9" ]; then
${vp9:+"$vpxenc_chained - $_vpxenc_vp9 \
-p 2 --pass=1 --fpf=${stem}_vp9.log -o /dev/null"}
else
- $melt ${_melt_sample:-$infiles} \
+ $melt $_melt_infiles \
${do_loudness:+$audioprefilters -filter loudness} \
$filters \
${do_loudness:+-consumer xml:$stem.xml video_off=1 all=1} \
@@ -519,7 +521,7 @@ fi
if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then
echo "Encoding video${channels:+ and extracting audio...}"
- $melt ${_melt_sample:-$infiles} \
+ $melt $_melt_infiles \
${channels:+$audioprefilters \
${_melt_loudness:+-filter loudness program=$lufs \
results="$_melt_loudness"}} \
@@ -577,7 +579,7 @@ if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then
fi
elif [ -n "$use_avconv_vp8$use_avconv_vp9" ] && [ -n "$webm$vp9" ]; then
echo "Encoding video..."
- $melt ${_melt_sample:-$infiles} \
+ $melt $_melt_infiles \
${channels:+$audioprefilters \
${_melt_loudness:+-filter loudness program=$lufs \
results="$_melt_loudness"}} \
@@ -599,7 +601,7 @@ elif [ -n "$use_avconv_vp8$use_avconv_vp9" ] && [ -n "$webm$vp9" ]; then
${stem}_vp9.webm"}}
else
echo "Encoding video..."
- $melt ${_melt_sample:-$infiles} \
+ $melt $_melt_infiles \
${channels:+$audioprefilters \
${_melt_loudness:+-filter loudness program=$lufs \
results="$_melt_loudness"}} \