-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathchannels_imx335.sh
129 lines (97 loc) · 3.24 KB
/
channels_imx335.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
echo $1 $2 >>/tmp/channels.log
#
# gk7205v300 IMX335 board
# 6 position switch as defined by ELRS
# Change resolutions in flight
#2000, 1725, 1575, 1425, 1275, 1000
#if [ $1 -eq 7 ]; then
if [ $2 -lt 1050 ]; then
yaml-cli -s .image.contrast 60
yaml-cli -s .image.hue 50
yaml-cli -s .image.saturation 50
yaml-cli -s .image.luminance 50
yaml-cli -s .video0.bitrate 7000
yaml-cli -s .video0.size 1920x1080
yaml-cli -s .video0.gopSize 1.5
yaml-cli -s .video0.fps 30
yaml-cli -s .isp.sensorConfig /etc/sensors/imx335_i2c_4M.ini
echo "1920x1080/30fps/7Mb" >/tmp/mavlink.msg
killall -1 majestic
sleep 1
/etc/gkrcparams --MaxQp 30 --MaxI 2
elif [ $2 -gt 1250 ] && [ $2 -lt 1300 ]; then
yaml-cli -s .image.contrast 60
yaml-cli -s .image.hue 50
yaml-cli -s .image.saturation 50
yaml-cli -s .image.luminance 50
yaml-cli -s .video0.bitrate 14000
yaml-cli -s .video0.size 1920x1080
yaml-cli -s .video0.gopSize 1.5
yaml-cli -s .video0.fps 30
yaml-cli -s .isp.sensorConfig /etc/sensors/imx335_i2c_4M.ini
echo "1920x1080/30fps/14Mb" >/tmp/mavlink.msg
killall -1 majestic
sleep 1
/etc/gkrcparams --MaxQp 30 --MaxI 2
elif [ $2 -gt 1400 ] && [ $2 -lt 1450 ]; then
yaml-cli -s .image.contrast 80
yaml-cli -s .image.hue 50
yaml-cli -s .image.saturation 60
yaml-cli -s .image.luminance 60
yaml-cli -s .video0.bitrate 14000
yaml-cli -s .video0.size 1920x1080
yaml-cli -s .video0.gopSize 1.5
yaml-cli -s .video0.fps 30
yaml-cli -s .isp.sensorConfig /etc/sensors/imx335_i2c_4M.ini
echo "1920x1080/30fps/14Mb C:80%" >/tmp/mavlink.msg
killall -1 majestic
sleep 1
/etc/gkrcparams --MaxQp 30 --MaxI 2
elif [ $2 -gt 1550 ] && [ $2 -lt 1600 ]; then
yaml-cli -s .image.contrast 80
yaml-cli -s .image.hue 50
yaml-cli -s .image.saturation 60
yaml-cli -s .image.luminance 60
yaml-cli -s .video0.bitrate 14000
yaml-cli -s .video0.size 1920x1080
yaml-cli -s .video0.gopSize 1.5
yaml-cli -s .video0.fps 30
yaml-cli -s .isp.sensorConfig /etc/sensors/imx335_i2c_4M.ini
echo "1920x1080/30fps/14Mb C:80%" >/tmp/mavlink.msg
killall -1 majestic
sleep 1
/etc/gkrcparams --MaxQp 30 --MaxI 2
elif [ $2 -gt 1700 ] && [ $2 -lt 1750 ]; then
yaml-cli -s .image.contrast 60
yaml-cli -s .image.hue 50
yaml-cli -s .image.saturation 50
yaml-cli -s .image.luminance 50
yaml-cli -s .video0.bitrate 14000
yaml-cli -s .video0.size size: 2592x1520
yaml-cli -s .video0.gopSize 1.5
yaml-cli -d .video0.fps
yaml-cli -s .isp.sensorConfig /etc/sensors/5M_imx335.ini
echo "2592x1520/25fps" >/tmp/mavlink.msg
killall -1 majestic
sleep 1
/etc/gkrcparams --MaxQp 30 --MaxI 2
elif [ $2 -gt 1950 ]; then
# emergency
yaml-cli -s .image.contrast 60
yaml-cli -s .image.hue 50
yaml-cli -s .image.saturation 50
yaml-cli -s .image.luminance 50
yaml-cli -s .video0.bitrate 3000
yaml-cli -s .video0.size 1920x1080
yaml-cli -s .video0.gopSize 1.5
yaml-cli -s .video0.fps 30
yaml-cli -s .isp.sensorConfig /etc/sensors/imx335_i2c_4M.ini
echo "1920x1080/30fps/3Mb" >/tmp/mavlink.msg
killall -1 majestic
sleep 1
/etc/gkrcparams --MaxQp 30 --MaxI 2
else
echo "unknown value" $2
fi
#fi
exit 1