2007-10-18 21:33:15 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-10-19 23:36:27 +02:00
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
logger "$0: error: Invalid parameter count '$#' $*"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Channels.conf parameter
|
|
|
|
PARAMETER=${1}
|
|
|
|
|
|
|
|
# Iptv plugin listens this port
|
|
|
|
PORT=${2}
|
|
|
|
|
2007-10-20 00:44:42 +02:00
|
|
|
# There is a way to specify multiple URLs in the same script. The selection is
|
|
|
|
# then controlled by the extra parameter passed by IPTV plugin to the script
|
|
|
|
case $PARAMETER in
|
|
|
|
1)
|
|
|
|
URL=""
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
URL=""
|
|
|
|
;;
|
|
|
|
3)
|
|
|
|
URL=""
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
URL="" # Default URL
|
|
|
|
;;
|
|
|
|
esac
|
2007-10-18 21:33:15 +02:00
|
|
|
|
|
|
|
if [ -z "${URL}" ]; then
|
|
|
|
logger "$0: error: URL not defined!"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2007-10-20 00:44:42 +02:00
|
|
|
# Create unique pids for the stream
|
|
|
|
let VPID=${PARAMETER}+1
|
|
|
|
let APID=${PARAMETER}+2
|
|
|
|
let SPID=${PARAMETER}+3
|
|
|
|
|
|
|
|
# Use 'exec' for capturing program pid for further management in IPTV plugin
|
|
|
|
exec vlc "${URL}" --sout "#transcode{vcodec=mp2v,acodec=mpga,vb=2400,ab=320}:standard{access=udp,mux=ts{pid-video=${VPID},pid-audio=${APID},pid-spu=${SPID}},dst=127.0.0.1:${PORT}}" --intf dummy
|