-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.sh
58 lines (49 loc) · 1.7 KB
/
common.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
48
49
50
51
52
53
54
55
56
#!/bin/bash
containsElement () {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
getoption(){
option="$1"
local __resultvar=$2
default="$3"
if [[ -z "$option" ]]; then
if [[ -z "$default" ]]; then
showhelp
exit
else
option="$default"
fi
fi
if [[ "$__resultvar" ]]; then
eval $__resultvar="'$option'"
else
echo "$option"
fi
}
get_orig_fn(){
getoption "$1" rundata
#./tags/mntfladata201611unorganizedmondaygopropci000000140usb062210scsi0000part1DCIM100GOPRO/GP010003.MP4.orig.aprs.runs
#.orig.aprs.runs = 15
nameholder="${rundata::-15}" #cut last 15 characters off
orig_filename="$(cat "$nameholder".oldname)"
#use base path and add .oldname, which is a file containing the original path
echo "$orig_filename"
}
runsfilext="runs"
aprsfilext="aprs"
ffmpegext="ffmpeg"
ffmpeglist="ffmpeg_commands.txt"
runlist="runlist.txt"
videolist="videolist.txt"
videofileregex='.*\.(mp4|mov|mkv|264|avi|mpg|mpeg|h264|m4v|ogv|webm)$'
#for each in *.MP4; do echo "$each"; ffmpeg -i "$each" "$each".flac; done
#for each in *.MP4; do echo "$each"; multimon-ng -c -a AFSK1200 -t flac "$each.flac" > "$each.aprs"; done
#cat *.aprs |grep -i {{T | cut -d " " -f 2-4 |sort -u
#ffmpeg -i input.flv -vf "select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr thumb%04d.png
#ffmpeg -framerate 60 -i thumb%04d.png -c:v libx264 -r 30 -pix_fmt yuv420p thumbs.mp4
#https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
#https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video
#ffmpeg -i input.mp4 -vf "select=gt(scene\,0.003),setpts=N/(25*TB)" output.mp4
#http://superuser.com/questions/984841/ffmpeg-remove-parts-without-motion