-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.sh
executable file
·47 lines (33 loc) · 1.9 KB
/
script.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
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
A=0
DURATION=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 order1.mov)
DURATION=${DURATION%.*}
CLIPLENGTH=200
while [ $A -le $DURATION ]
do
ffmpeg -ss $A -i "order1.mov" -t $CLIPLENGTH -c:v libx264 output-${A}.mov;
let “A=A+$CLIPLENGTH”
done
# original segments
ffmpeg -i order1.mov -c:v libx264 -crf 22 -map 0 -segment_time 3 -g 3 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*3)" -f segment order%03d.mov
ffmpeg -i order1.mov -c:v libx264 -crf 22 -map 0 -segment_time 200 -g 200 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*3)" -f segment order%03d.mov
# Works:
ffmpeg -i "order1.mov" -c copy -map 0 -segment_time 00:05:00 -f segment -reset_timestamps 1 order%03d.mov
# Re-encoding: (doesnt work)
ffmpeg -i "order1.mov" -c:v libx264 -map 0 -segment_time 00:05:00 -f segment -reset_timestamps 1 order%03d.mov
$
# Reencoding with crf specified
ffmpeg -i "order1.mov" -c:v libx264 -crf 18 -map 0 -segment_time 00:05:00 -f segment -reset_timestamps 1 order%03d.mov
# repeat for whole thing
ffmpeg -i "order1.mov" -c:v libx264 -crf 18 -map 0 -segment_time 00:00:03 -f segment -reset_timestamps 1 order%03d.mov
# removing reset timestamps
ffmpeg -i "order1.mov" -c:v libx264 -crf 18 -map 0 -segment_time 00:00:03 -f segment order%03d.mov >>> made all screens go blank. so -reset_timestamps 1 is important
# using g200
ffmpeg -i "order1.mov" -c:v libx264 -crf 18 -map 0 -segment_time 3 -g 3 -f segment -reset_timestamps 1 order%03d.mov
# TRIALS
# order 1
ffmpeg -i "order1.mov" -c:v libx264 -crf 18 -map 0 -segment_time 3 -g 3 -f segment -reset_timestamps 1 order%03d.mov
# order 2
ffmpeg -i "order2.mov" -c:v libx264 -crf 18 -map 0 -segment_time 3 -g 3 -f segment -reset_timestamps 1 2slide_%03d.mov
# order 3
ffmpeg -i "order3.mov" -c:v libx264 -crf 18 -map 0 -segment_time 3 -g 3 -f segment -reset_timestamps 1 3slide_%03d.mov