-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-deinterlacer.sh
47 lines (44 loc) · 1.59 KB
/
simple-deinterlacer.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
options=("Auto Detect Field Order" "Deinterlace Top Field First" "Deinterlace Bottom Field First" "Auto Detect Field Order (ffplay)" "Deinterlace Top Field First (ffplay)" "Deinterlace Bottom Field First (ffplay)" "Exit Program")
video_file=$1
PS3="> "
if [ -z "$video_file" ]; then
echo "No Video File Provided"
exit 1
fi
echo "Please select a Field Order:"
select choice in "${options[@]}"
do
case $choice in
"Auto Detect Field Order")
ffmpeg -hide_banner -i "$video_file" -vf "yadif=1" -c:v ffv1 -map 0:a -map 0:v -c:a copy 'deinterlaced.mkv'
exit
;;
"Deinterlace Top Field First")
ffmpeg -hide_banner -i "$video_file" -vf "yadif=1:parity=tff" -c:v ffv1 -map 0:a -map 0:v -c:a copy 'deinterlaced.mkv'
exit
;;
"Deinterlace Bottom Field First")
ffmpeg -hide_banner -i "$video_file" -vf "yadif=1:parity=bff" -c:v ffv1 -map 0:a -map 0:v -c:a copy 'deinterlaced.mkv'
exit
;;
"Auto Detect Field Order (ffplay)")
ffplay -hide_banner -i "$video_file" -vf "yadif=1"
exit
;;
"Deinterlace Top Field First (ffplay)")
ffplay -hide_banner -i "$video_file" -vf "yadif=1:parity=tff"
exit
;;
"Deinterlace Bottom Field First (ffplay)")
ffplay -hide_banner -i "$video_file" -vf "yadif=1:parity=bff"
exit
;;
"Exit Program")
break
;;
*)
echo "Invalid Option Selected"
;;
esac
done