blob: c43264cf956840fc2f121744f73fcf6a74fabc57 (
plain)
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
|
# input file full name
iffname=$1
quality=$2 #23..12, less is better quality
threads=$3
# getting input file name without path and extension and extension
ifname=$(basename -- "$iffname")
ifext="${ifname##*.}"
ifname="${ifname%.*}"
#temporary file full name
tffname=$ifname.temp.mkv
#output file full name
offname=$ifname-60fps.mp4
echo "Input full filename:" $iffname
echo "Input filename:" $ifname
echo "Input file extension:" $ifext
echo "Temporary full filename:" $tffname
echo "Output full filename:" $offname
#vsscript="$HOME/.local/share/SVP4/scripts/$(ls $HOME/.local/share/SVP4/scripts)"
vsscript="$HOME/.local/share/SVP4/scripts/ffff.py"
# --vf=vapoursynth=$(echo $HOME)/.local/share/SVP4/scripts/ffff.py \
mpv \
"$iffname" \
--o="$tffname" \
--no-audio \
--no-sub \
--no-sub-auto \
--input-ipc-server=/tmp/mpvencodesocket \
--input-media-keys=no \
--no-msg-color \
--vf=vapoursynth="$vsscript" \
--of=matroska \
--ovc=libx264 \
--ovcopts=crf=$quality,preset=slow,threads=$threads
ffmpeg \
-y \
-i "$iffname" \
-i "$tffname" \
-map 1:v \
-map 0:a? \
-map 0:s? \
-vcodec copy \
-acodec copy \
-scodec copy \
"$offname"
rm "$tffname"
|