-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenc-stories.sh
executable file
·35 lines (24 loc) · 1.13 KB
/
enc-stories.sh
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
34
35
echo "convert video to vertical"
echo "usage: ./enc-stories.sh path align[1,2,3,9]"
SRC=$1
DST=$(dirname $1)/$(basename $1| cut -d. -f1)-stories.mp4
# -vf scale=-1:1080
POS=$2
#ffplay -filter:v "crop=ih/16*9:ih" ~/tmp/skot.mp4
case $POS in
1)
ffmpeg -stats -i "$SRC" -y -vf scale=1080:1920 -vf "crop=ih/16*9:ih:0:0" -c:v libx264 -crf 24 -vf format=yuv420p -c:a aac -movflags +faststart -preset fast "$DST"
;;
2)
ffmpeg -stats -i "$SRC" -y -vf scale=1080:1920 -vf "crop=ih/16*9:ih:iw/10" -c:v libx264 -crf 24 -vf format=yuv420p -c:a aac -movflags +faststart -preset fast "$DST"
;;
3)
ffmpeg -stats -i "$SRC" -y -vf scale=1080:1920 -vf "crop=ih/16*9:ih" -c:v libx264 -crf 24 -vf format=yuv420p -c:a aac -movflags +faststart -preset fast "$DST"
;;
*)
ffmpeg -stats -i "$SRC" -y -vf scale=1080:1920 -vf "crop=ih/16*9:ih" -c:v libx264 -crf 24 -vf format=yuv420p -c:a aac -movflags +faststart -preset fast "$DST"
;;
9)
ffmpeg -stats -i "$SRC" -y -vf scale=1080:1920 -vf "crop=ih/16*9:ih:iw" -c:v libx264 -crf 24 -vf format=yuv420p -c:a aac -movflags +faststart -preset fast "$DST"
;;
esac