summaryrefslogtreecommitdiff
path: root/Script/launch_video.sh
blob: 5d1ebb5b00d9a3d87279462619a0c4b9661d757f (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
#!/bin/sh

#
#  Launch web cam 
#

touch $HOME/gstvid-pid
alreadyrunning=`cat $HOME/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:///usr/share/media/videos/AmazingNature_480p.mp4

if [ $(echo $alreadyrunning | wc -w) -lt 3  ] ; then
    echo "create new"
    gst-launch-1.0 playbin uri=$URL &
    echo $!  >> $HOME/gstvid-pid
else echo "already running"
    for x in $alreadyrunning; do kill -9 $x; done
    rm -rf $HOME/gstvid-pid
fi