-
Notifications
You must be signed in to change notification settings - Fork 2
/
mt9v032_stream.sh
executable file
·64 lines (56 loc) · 1.99 KB
/
mt9v032_stream.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
#!/bin/bash
# * Copyright (C) 2018 Gumstix, Inc. - https://www.gumstix.com/
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 or
# * (at your option) any later version as published by the Free Software
# * Foundation.
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# * GNU General Public License for more details.
clear
destdir=~/.host_ip_addr
enter_ip () {
echo
echo "Please enter the host IP address:"
read ip_addr
touch $destdir -f
echo "$ip_addr" > $destdir
}
if hash gst-launch-1.0 2>/dev/null; then
gname="gst-launch-1.0";
elif hash gst-launch 2>/dev/null; then
gname="gst-launch";
else
echo >&2 "Gstreamer not installed. Installing..."
smart update
yes | smart install gstreamer1.0
yes | smart install gstreamer1.0-plugins-good
if hash gst-launch-1.0 2>/dev/null; then
gname="gst-launch-1.0";
elif hash gst-launch 2>/dev/null; then
gname="gst-launch";
fi
fi
# echo $gname
if [ -f "$destdir" ]; then
echo
echo "The IP address you entered last time:"
cat $destdir
echo
read -s -n1 -r -p "Press Space/Enter to use it, or any other key to enter a new IP..." key
if [ "$key" = '' ]; then
echo
ip_addr=$(<$destdir)
else
enter_ip
fi
else
enter_ip
fi
modprobe omap3-isp
media-ctl -r -l '"mt9v032 2-005c":0->"OMAP3 ISP CCDC":0[1], "OMAP3 ISP CCDC":2->"OMAP3 ISP preview":0[1], "OMAP3 ISP preview":1->"OMAP3 ISP resizer":0[1], "OMAP3 ISP resizer":1->"OMAP3 ISP resizer output":0[1]'
media-ctl -V '"mt9v032 2-005c":0[SGRBG10 752x480], "OMAP3 ISP CCDC":2[SGRBG10 752x480], "OMAP3 ISP preview":1[YUYV2X8 752x480], "OMAP3 ISP resizer":1[YUYV2X8 752x480]'
$gname -v v4l2src device=/dev/video6 ! videoconvert !rtpvrawpay ! udpsink host=$ip_addr port=6666