-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathavif
More file actions
executable file
·44 lines (39 loc) · 773 Bytes
/
avif
File metadata and controls
executable file
·44 lines (39 loc) · 773 Bytes
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
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Create a cinemagraph from a few seconds of 100fps video.
if [[ -z "$1" ]]
then
echo "Usage: avif video.MOV 00:00:01.5 00:00:02.5"
exit 1
fi
input="$1"
output="${1%.*}.avif"
if [[ -n "$3" ]]
then
from="$2"
to="$3"
ffmpeg \
-ss "$from" \
-to "$to" \
-r 100 \
-i "$input" \
-vf "setpts=4*PTS,
crop=ih*(1+sqrt(5))/2:ih,
format=yuv420p" \
-c:v libsvtav1 \
-crf 8 \
-preset 8 \
-r 25 \
"$output"
else
ffmpeg \
-r 100 \
-i "$input" \
-vf "setpts=4*PTS,
crop=ih*(1+sqrt(5))/2:ih,
format=yuv420p" \
-c:v libsvtav1 \
-crf 8 \
-preset 8 \
-r 25 \
"$output"
fi