diff options
Diffstat (limited to '')
-rwxr-xr-x | roles/prerec/templates/reencode.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/roles/prerec/templates/reencode.sh b/roles/prerec/templates/reencode.sh index 66c2f57..5a0128b 100755 --- a/roles/prerec/templates/reencode.sh +++ b/roles/prerec/templates/reencode.sh @@ -32,19 +32,22 @@ done shift `expr $OPTIND - 1` OPTIND=1 +input="$1" +output="$2" + command="$(cat<<EOF -ffmpeg -y -i "$1" $time_limit \ +ffmpeg -y -i "$input" $time_limit \ -vf "scale='-1':'min($limit_resolution,ih)', select='eq(n,0)+if(gt(t-prev_selected_t,1/$limit_fps),1,0)'" \ -c:v libvpx-vp9 -b:v 0 -crf $q -an \ -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu -g 240 \ -pass 1 -f webm -threads $cpu /dev/null && - ffmpeg -y -i "$1" $time_limit \ + ffmpeg -y -i "$input" $time_limit \ -vf "scale='-1':'min($limit_resolution,ih)', select='eq(n,0)+if(gt(t-prev_selected_t,1/$limit_fps),1,0)'" \ - -c:v libvpx-vp9 -b:v 0 -crf $q -c:a libopus \ - -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu \ - -pass 2 -threads $cpu "$2" + -c:v libvpx-vp9 -b:v 0 -crf $q -c:a libopus \ + -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $cpu \ + -pass 2 -threads $cpu -- "$output" EOF )" |