le-vlc-captura.sh 2.16 KB
Newer Older
Diego Pasqualin's avatar
Diego Pasqualin committed
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
#!/bin/bash
#
# Copyright (C) 2004-2013 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-interface
#
# le-interface is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.

ZENITYCMD="zenity --list --text='Escolha a opção de Edição de Vídeo' --radiolist --column 'Opções' --column 'Dispositivo'"
CAPTURA=""
WEBCAM=""
for dev in $(ls /dev/video*); do
    if v4l-info $dev | grep -q "em28xx"; then
        CAPTURA="$dev"
        ZENITYCMD="$ZENITYCMD FALSE 'Dispositivo de captura de vídeo composto'"
        ZENITYCMD="$ZENITYCMD FALSE 'Dispositivo de captura S-Video'"
    elif v4l-info "$dev" | grep -q "uvcvideo"; then
        WEBCAM="$dev"
        ZENITYCMD="$ZENITYCMD FALSE 'Captura de vídeo usando WEBCAM'"
    fi
done

ZENITYCMD=$(echo $ZENITYCMD | sed s/FALSE/TRUE/)

if test -z "$CAPTURA" && test -z "$WEBCAM"; then
    ZENITYCMD="zenity --error --text='Nenhum dispositivo de captura encontrado.'"
else
    ZENITYCMD="$ZENITYCMD --height=220 --width=450"
fi

RESP=$(eval $ZENITYCMD)

if [ "$RESP" = "Captura de vídeo usando WEBCAM" ]; then
    vlc v4l2://$WEBCAM :input-slave=alsa://hw:0,0
fi

if [ "$RESP" = "Dispositivo de captura de vídeo composto" ]; then
	vlc v4l2://$CAPTURA :v4l2-standard=NTSC :input-slave=alsa://hw:1,0 :v4l2-input=1 :v4l2-width=640 :v4l2-height=480
fi

if [ "$RESP" = "Dispositivo de captura S-Video" ]; then
	vlc v4l2://$CAPTURA :v4l2-standard=NTSC :input-slave=alsa://hw:1,0 :v4l2-input=0 :v4l2-width=640 :v4l2-height=480
fi