summaryrefslogtreecommitdiff
path: root/Script
diff options
context:
space:
mode:
Diffstat (limited to 'Script')
-rwxr-xr-xScript/launch_cam.sh20
-rwxr-xr-xScript/launch_video.sh24
2 files changed, 44 insertions, 0 deletions
diff --git a/Script/launch_cam.sh b/Script/launch_cam.sh
new file mode 100755
index 0000000..75fcd20
--- /dev/null
+++ b/Script/launch_cam.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+#
+# Launch web cam
+#
+
+touch /home/app/gst-pid
+alreadyrunning=`cat /home/app/gst-pid`
+
+cnt=$(echo $alreadyrunning | wc -w)
+if [ $cnt -lt 2 ] ; then
+ echo "create new $cnt"
+ gst-launch-1.0 v4l2src device=/dev/video$cnt ! video/x-raw, width=640, height=480 ! videoconvert ! waylandsink &
+ echo $! >> /home/app/gst-pid
+else echo "already running"
+ for x in $alreadyrunning; do kill -9 $x; done
+ rm -rf /home/app/gst-pid
+fi
+
+
diff --git a/Script/launch_video.sh b/Script/launch_video.sh
new file mode 100755
index 0000000..6b23c87
--- /dev/null
+++ b/Script/launch_video.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+#
+# Launch web cam
+#
+
+touch /home/app/gstvid-pid
+alreadyrunning=`cat /home/app/gstvid-pid`
+
+#URL=http://intel07.vannes/~sdx/Downloads/Amazing%20Nature%20full%20HD%20720p.mp4
+#URL=http://intel07.vannes/~sdx/Videos/big_buck_bunny_480p_surround-fix.avi
+#URL=http://intel07.vannes/~sdx/Videos/caminandes_480p.avi
+URL=file:///home/app/AmazingNature_480p.mp4
+
+if [ $(echo $alreadyrunning | wc -w) -lt 8 ] ; then
+ echo "create new"
+ gst-launch-1.0 playbin uri=$URL &
+ echo $! >> /home/app/gstvid-pid
+else echo "already running"
+ for x in $alreadyrunning; do kill -9 $x; done
+ rm -rf /home/app/gstvid-pid
+fi
+
+