minor changes
This commit is contained in:
parent
9f1ca516b1
commit
540eab999a
14
dve
14
dve
@ -5,7 +5,7 @@ set -e
|
||||
# defaults for all configuration values
|
||||
ENC="ffmpeg"
|
||||
CRF=24
|
||||
OPTS="-map 0 -c:v libx265 -pix_fmt yuv420p10le -preset fast -x265-params crf=${CRF}:aq-mode=3 -c:a libvorbis -aq 5"
|
||||
OPTS="-map 0 -c:v libx265 -pix_fmt yuv420p10le -preset fast -x265-params crf=${CRF}:aq-mode=3 -c:a libopus -b:a 128000"
|
||||
# This is to split out and copy attachment streams, like subtitles
|
||||
# and fonts, so they only get copied once.
|
||||
DATA_OPTS="-map 0 -c:s copy -c:t copy -c:d copy -vn -an"
|
||||
@ -22,7 +22,7 @@ fi
|
||||
function on_finish() {
|
||||
echo "Cleaning up temporary working files"
|
||||
cd "$CWD"
|
||||
rm -rf "${OUTDIR}"/
|
||||
# rm -rf "${OUTDIR}"/
|
||||
echo "Finished cleaning"
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ while getopts “hl:t:o:s:q:v” OPTION; do
|
||||
;;
|
||||
q)
|
||||
CRF="$OPTARG"
|
||||
OPTS="-map 0 -c:v libx265 -pix_fmt yuv420p10le -preset fast -x265-params crf=${CRF}:aq-mode=3 -c:a libvorbis -aq 5"
|
||||
OPTS="-map 0 -c:v libx265 -pix_fmt yuv420p10le -preset fast -x265-params crf=${CRF}:aq-mode=3 -c:a libopus -b:a 128000"
|
||||
;;
|
||||
o)
|
||||
OPTS="$OPTARG"
|
||||
@ -109,6 +109,7 @@ if [[ "$1" == *".AVI" || "$1" == *".avi" ]]; then
|
||||
else
|
||||
$ENC -i "$1" -map 0:a -map 0:v -codec copy -f segment -segment_time $LEN -segment_format matroska -v ${VERBOSE} "${OUTDIR}/chunk-%03d.orig"
|
||||
fi
|
||||
|
||||
echo "Copying file metadata"
|
||||
DATA_IN="-i data.enc -map 1"
|
||||
${ENC} -y -v ${VERBOSE} -i "$1" ${DATA_OPTS} -f matroska "${OUTDIR}/data.enc" ||
|
||||
@ -121,7 +122,14 @@ PAR_OPTS="--no-notice --gnu -j 1 -S ${SERVERS} --eta --retries 2 --nice 10"
|
||||
PAR_OPTS="${PAR_OPTS} --workdir ... --transfer --return {.}.enc"
|
||||
ENC_OPTS="-y -v ${VERBOSE} -i {} ${OPTS} -f matroska {.}.enc"
|
||||
|
||||
# do local encode if single chunk, else parallel encode
|
||||
numchunks="$(ls -1q chunk-*.orig | wc -l)"
|
||||
if [ "$numchunks" -eq "1" ]; then
|
||||
ENC_OPTS="-y -v ${VERBOSE} -i chunk-*.orig ${OPTS} -f matroska chunk-0000.enc"
|
||||
${ENC} ${ENC_OPTS}
|
||||
else
|
||||
parallel ${PAR_OPTS} ${ENC} ${ENC_OPTS} ::: chunk-*.orig
|
||||
fi
|
||||
|
||||
echo "Combining chunks into final video file"
|
||||
echo "ffconcat version 1.0" > concat.txt
|
||||
|
Loading…
Reference in New Issue
Block a user