This repository was archived by the owner on Dec 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebcam2webmweb.sh
More file actions
executable file
·39 lines (28 loc) · 1.84 KB
/
webcam2webmweb.sh
File metadata and controls
executable file
·39 lines (28 loc) · 1.84 KB
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
#!/bin/sh
## Quand c'est cassé ou qu'on modifie quelque chose, on le dit sur gitolite
## ou l'on prévient l'auteur pierre.boutillier@PLASCI afin d'en laisser la trace
# Copyright 2014 Planète Sciences
# This file is part of webtv-plasci
# This program 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 3 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, see <http://www.gnu.org/licenses/>.
assure_commande () { ## assure_commande commande paquet
which $1 > /dev/null ||\
{ echo "Commande \"$1\" introuvable, il faut surement installer le paquet $2."
exit 3 ; }
}
assure_commande gst-launch-1.0 gstreamer1.0-tools
[ $# -eq 4 ] || { echo "Usage: $0 nom_serveur_icecast port_serveur_icecast mdp_icecast prefix_mountpoint" ; echo "Capture le flux depuis la webcam et l'envoi au serveur icecast en ogv et webm." ; exit 2 ; }
[ "$TERM" = "screen" ] || { echo "Il faut lancer ce script en utilisant screen pour que la diffusion survive aux deconnections." ; exit 4 ; }
gst-launch-1.0 v4l2src ! queue ! videorate ! "video/x-raw,framerate=25/1" ! tee name=video \
video. ! queue ! videoscale ! "video/x-raw,height=512,width=640" ! theoraenc ! oggmux ! queue ! \
shout2send ip=$1 port=$2 password=$3 mount=$4".ogv" \
video. ! queue ! videoscale ! "video/x-raw,height=190,width=240" ! vp8enc ! webmmux ! queue ! \
shout2send ip=$1 port=$2 password=$3 mount=$4".webm"