-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-vp9
executable file
·33 lines (31 loc) · 1.51 KB
/
create-vp9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
START_TIME=$SECONDS
YEAR=$(date +"%Y")
QUALITY=${Q:-28}
SIZING="-vf scale=1920:-1"
OPT="-y -v info -hide_banner"
MOVIE=$(stat -c"%y" tl000001.jpg|cut -d " " --output-delimiter=- -f1,2|cut -b1-10)-q$QUALITY.webm
echo -n create_movie $MOVIE ...
if [ -z !$PID ]; then
ffmpeg -y -v error -r 30 -f image2 -i tl%06d.jpg -vf "hqdn3d=1.5:1.5:6:6" -an -c:v libvpx-vp9 -crf $QUALITY -b:v 0 -r 30 $MOVIE
else
# ffmpeg -y -v info -r 30 -f image2 -i tl%06d.jpg -vf "hqdn3d=1.5:1.5:6:6" -an -c:v libvpx-vp9 -crf $QUALITY -b:v 0 -r 30 $MOVIE
ffmpeg $OPT -r 30 -f image2 -i tl%06d.jpg \
-c:v libvpx-vp9 -pass 1 -b:v 0 \
$SIZING \
-metadata title="Timelapse Grand River view, Kitchener, ON" \
-metadata author="Steffen Roller <[email protected]>" \
-metadata year="$YEAR" \
-metadata copyright="Create Commons" \
-crf $QUALITY -threads 8 -speed 4 -tile-columns 6 -frame-parallel 1 -an -f webm /dev/null
ffmpeg $OPT -r 30 -f image2 -i tl%06d.jpg -c:v libvpx-vp9 -pass 2 -b:v 0 \
$SIZING \
-metadata title="Timelapse Grand River view, Kitchener, ON" \
-metadata author="Steffen Roller <[email protected]>" \
-metadata year="$YEAR" \
-metadata copyright="Create Commons" \
-crf $QUALITY -threads 8 -speed 1 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -an -f webm $MOVIE
rm ffmpeg2pass-0.log
fi
ELAPSED_TIME=$(($SECONDS - $START_TIME))
echo finished in $(($ELAPSED_TIME/60/60)) hr, $(($ELAPSED_TIME/60%60)) min and $(($ELAPSED_TIME % 60)) sec