-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvideos.sh
More file actions
executable file
·35 lines (28 loc) · 852 Bytes
/
videos.sh
File metadata and controls
executable file
·35 lines (28 loc) · 852 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
#!/usr/bin/env bash
QUALITY=40
FOLDER=videos
SOURCE=video.mkv
thumbnail () {
local file=${1};
./ffmpeg -i "$FOLDER/$file.webm" -vf "thumbnail" -frames:v 1 "$FOLDER/$file.png" -y;
}
transcode () {
local file=${1};
local start=${2};
local length=${3};
./ffmpeg -ss $start -i "$FOLDER/$SOURCE" -t $length -filter:v scale="720:-1" -threads 4 \
-f webm -vcodec vp8 -keyint_min 24 -r 24 -g 1 \
-force_key_frames "expr:gte(t,n_forced*2)" \
-qmin $QUALITY -qmax $QUALITY -crf $QUALITY -c:a libvorbis "$FOLDER/$file.webm" -y;
thumbnail $file;
}
transcode "video-0" 31 10;
transcode "video-1" 62 20;
transcode "video-2" 92 15;
transcode "video-3" 183 25;
transcode "video-4" 224 5;
transcode "video-5" 250 10;
transcode "video-6" 338 20;
transcode "video-7" 445 10;
transcode "video-8" 776 5;
transcode "video-9" 801 15;