summaryrefslogtreecommitdiff
path: root/Script/launch_video2.sh
blob: 640278495b16de1556172203bf42cc47928d4534 (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
25
26
#!/bin/sh

#
#  Launch web cam 
#

pidfile=$HOME/.gstvid2-pid

touch $pidfile
alreadyrunning=`cat $pidfile`

video=/usr/share/media/videos/Caminandes_1080p.mp4

if [ $(echo $alreadyrunning | wc -w) -lt 1  ] ; then
    echo "create new"
    #gst-launch-1.0 playbin uri=$URL &
	gst-launch-1.0  filesrc location=$video ! qtdemux name=demux  \
		demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink  \
		demux.video_0 ! queue ! vaapidecode ! vaapisink fullscreen=1 &
    echo $!  >> $pidfile
else echo "already running"
    for x in $alreadyrunning; do kill -9 $x; done
    rm -rf $pidfile
fi