From 4e8e26a4b3aa0feab4e47052ec4300b0d3b03154 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Mon, 1 Sep 2008 14:28:05 +0300 Subject: [PATCH] Updated iptvstream.sh script to support optional video resolution settings. --- HISTORY | 3 +++ iptv/iptvstream.sh | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 2f44eed..3fdf09a 100644 --- a/HISTORY +++ b/HISTORY @@ -66,4 +66,7 @@ VDR Plugin 'iptv' Revision History 2008-xx-xx: Version 0.2.2 +- Updated Italian translation (Thanks to Diego Pierotto). - Tweaked pid scanner parameters for HD broadcasts. +- Fixed opening of fifo tap. +- Updated iptvstream.sh script to support optional video resolution settings. diff --git a/iptv/iptvstream.sh b/iptv/iptvstream.sh index 3f7d3f8..27b4c38 100755 --- a/iptv/iptvstream.sh +++ b/iptv/iptvstream.sh @@ -31,8 +31,10 @@ PARAMETER=${1} # Iptv plugin listens this port PORT=${2} -# Default bitrates for stream transcoding +# Default settings for stream transcoding +VCODEC=mp2v VBITRATE=2400 +ACODEC=mpga ABITRATE=320 # There is a way to specify multiple URLs in the same script. The selection is @@ -40,6 +42,8 @@ ABITRATE=320 case ${PARAMETER} in 1) URL="" + WIDTH=720 + HEIGHT=576 ;; 2) URL="" @@ -57,13 +61,19 @@ if [ -z "${URL}" ]; then exit 1; fi +# Create transcoding options +TRANSCODE_OPTS="vcodec=${VCODEC},acodec=${ACODEC},vb=${VBITRATE},ab=${ABITRATE}" +if [ -n "${WIDTH}" -a -n "${HEIGHT}" ] ; then + TRANSCODE_OPTS="${TRANSCODE_OPTS},width=${WIDTH},height=${HEIGHT}" +fi + # Create unique pids for the stream let VPID=${PARAMETER}+1 let APID=${PARAMETER}+2 let SPID=${PARAMETER}+3 # Capture VLC pid for further management in IPTV plugin -vlc "${URL}" --sout "#transcode{vcodec=mp2v,acodec=mpga,vb=${VBITRATE},ab=${ABITRATE}}:standard{access=udp,mux=ts{pid-video=${VPID},pid-audio=${APID},pid-spu=${SPID}},dst=127.0.0.1:${PORT}}" --intf dummy & +vlc "${URL}" --sout "#transcode{${TRANSCODE_OPTS}}:standard{access=udp,mux=ts{pid-video=${VPID},pid-audio=${APID},pid-spu=${SPID}},dst=127.0.0.1:${PORT}}" --intf dummy & PID=${!}