I created a script called stream.sh that I use all of the time. I ssh into my knoppmythbox and run the script, which streams either a recording, a video, a dvd or even live TV. I use a Verizon Samsung PDA and run TCPMP video player and point it to my box. Works wonderfully, and can use with any computer running vlc or mplayer, etc. I'm not a php programmer, but I would like to one day figure out how to run the script from mythweb.<br>
<br>Note: On Debian, if apt-get remove vlc, you must also do apt-get remove vlc vlc-nox AND libvlc0, libvlc0 will not autoremove and will cause problems!<br>steam.sh: (change your local IP on line 119, pwd and IP on line 148 and port forward 8001 to your box)<br>
<br>#!/bin/bash<br><br>clear<br>VSPEED=0<br>ASPEED=0<br>VSIZE=0<br>VSIZE2=0<br>FPS=0<br>CHAPTER=0<br><br>## CHECK FOR PRESETS, ADD YOUR OWN HERE<br>echo "Use Presets for work or ppc (work,ppc,n)?"<br> read vPRESET<br>
if [ $vPRESET == "work" ]; then<br> VSPEED='300'<br> ASPEED='48'<br> VSIZE='75'<br> VSIZE2='.75'<br> FPS='25'<br> elif [ $vPRESET == "ppc" ]; then<br>
VSPEED='128'<br> ASPEED='32'<br> VSIZE='25'<br> VSIZE2='.25'<br> FPS='15'<br> fi<br><br>## PROMPT IF NO PRESET SELECTED<br> if [ $VSPEED == "0" ]; then<br>
echo "Video Speed (500,300,256,192,128)?"<br> read VSPEED<br> echo<br> fi<br><br> if [ $ASPEED == "0" ]; then<br> echo "Audio Speed (128,96,64,48,32)?"<br> read ASPEED<br>
echo<br> fi<br><br> if [ $VSIZE2 == "0" ]; then<br> echo "Video Size% (100,75,50,25)?"<br> read VSIZE<br> if [ $VSIZE == "100" ]; then<br> VSIZE2='1.0'<br>
elif [ $VSIZE == "75" ]; then<br> VSIZE2='.75'<br> elif [ $VSIZE == "50" ]; then<br> VSIZE2='.50'<br> elif [ $VSIZE == "25" ]; then<br> VSIZE2='.25'<br>
fi<br> fi<br> echo<br><br> if [ $FPS == "0" ]; then<br> echo "FPS (25,20,15,10,5)?"<br> read FPS<br> echo<br> fi<br><br>## SELECT STREAM MODE <br>echo "1. Stream Rec."<br>
echo "2. Stream Live."<br>echo "3. Stream Video."<br>echo "4. Stream DVD."<br>read vMODE<br> <br> ## BEGIN STREAM RECORDED SCRIPT##<br> if [ $vMODE == "1" ]; then <br> echo<br>
echo "Recorded Programs:"<br> echo<br> ls /myth/pretty<br> echo<br> echo "Which File? (d)-view filenames for duplicate titles"<br> read VIDEO<br><br> if [ $VIDEO == "d" ]; then <br>
ls -All /myth/pretty<br> echo "Which filename?"<br> read VIDEOFILE<br> fi<br><br> echo "File: "$VIDEO $VIDEOFILE<br><br>if [ $VIDEO == "d" ]; then <br> vlc -I http --http-host=:8002 --sout-transcode-fps=$FPS --sout-transcode-deinterlace /myth/tv/$VIDEOFILE ":sout=#transcode{vcodec=DIV3,acodec=mpga,vb=$VSPEED,ab=$ASPEED,scale=$SIZE2}:std{access=http{user='',pwd='',mime=video/x-ms-asf},mux=asf,url=:8001}"<br>
exit 1<br>fi <br><br> vlc -I http --http-host=:8002 --sout-transcode-fps=$FPS --sout-transcode-deinterlace /myth/pretty/$VIDEO ":sout=#transcode{vcodec=DIV3,acodec=mpga,vb=$VSPEED,ab=$ASPEED,scale=$SIZE2}:std{access=http{user='',pwd='',mime=video/x-ms-asf},mux=asf,url=:8001}"<br>
exit 1<br> ### END OF RECORDED SCRIPT ###<br><br> ## BEGIN LIVE SCRIPT ##<br>elif [ $vMODE == "2" ]; then<br> MYTHWEB_STATUS=status<br> ### Taken from parseTunerStatus of mythstreamtvLive scripts<br>
MYTH_WEB_STATUS=<a href="http://192.168.0.1/mythweb/status">http://192.168.0.1/mythweb/status</a><br> # Figure out if tuner has a recording scheduled and when - add message to ddl <br> FindNextSchedule()<br>
{<br> PARM=${1}<br> DEVICE=${2}<br><br> TUNER=`echo ${PARM} | awk '{ print $1, $2}'`<br> ScheduleBegin=`grep -n "The next 10 shows" ${STATUS} | cut -f1 -d:`<br> NEXTTIME=`tail -n +${ScheduleBegin} ${STATUS} | \<br>
grep " - ${TUNER} - " | \<br> head -1 | cut -f2 -d\> | cut -f1 -d- `<br> <br> if [ -z "${NEXTTIME}" ]<br> then<br> echo "\"$LINE - No scheduled recordings."<br>
else<br> echo "\"$LINE - Next recording at ${NEXTTIME}."<br> fi <br> }<br><br> #----------------------------------------------------------------------------<br> # Main Routine<br>
#----------------------------------------------------------------------------<br> cd /tmp<br><br> # get the HTML status page<br> wget --http-user=mythtv --http-passwd=youpassword <a href="http://192.168.0.1/mythweb/status">http://192.168.0.1/mythweb/status</a> 2> /tmp/wget.error<br>
STATUS=/tmp/status<br><br> # grab local Encoder status lines<br> EncoderStatusBegin=`grep -n "Encoder status" ${STATUS} | cut -f1 -d:`<br><br> tail -n +${EncoderStatusBegin} ${STATUS} | head -5 | \<br>
egrep "^[ ]*Encoder.*local" > /tmp/tunerstatus<br><br> # Clean up the the status text<br> cat /tmp/tunerstatus | awk '/not recording/ {print $1, $2, "- Free"} <br> /is recording/ {print $1, $2, "- Recording"}' > /tmp/tnrsts.terse<br>
<br> # Now loop through each tuner and create ddl entry<br> while read LINE <br> do<br> TUNER_NUM=`echo ${LINE} | awk '{ print $2}'`<br> DEVICE="/dev/video$((${TUNER_NUM}-1))"<br> <br>
if [ ! -z "`echo $LINE | grep Recording`" ]<br> then<br> # if recording - just ues 'cleaned up' terse text<br> echo "<option value=\"${DEVICE}\">$LINE</option>"<br>
else<br> # if not recording, figure out next scheduled recording for tuner<br> FindNextSchedule "${LINE}" "${DEVICE}"<br> fi<br> <br> done < /tmp/tnrsts.terse<br>
<br> # cleanup<br> rm -f /tmptnrsts.terse /tmp/tunerstatus /tmp/status<br><br> ## MY SCRIPT STARTS HERE <br><br> echo<br> echo "Use CaptureCard 1(Myth) or 2(Reg)?"<br> read DEVICE<br> if [ $DEVICE == "1" ]; then<br>
DEV='/dev/video0'<br> echo "Channel?"<br> read CHAN<br> echo "Changing to Channel: "$CHAN<br> change_channel.csh $CHAN<br> elif [ $DEVICE == "2" ]; then <br>
DEV='/dev/video1'<br> fi<br> echo<br><br> xterm /home/mythtv/stream_channel_prompt.sh -geometry 24x10+10+10 &<br> echo "Starting VLC..."<br> vlc -I http --http-host=8002 pvr:$DEV --sout-transcode-fps=$FPS --sout="#transcode{vcodec=DIV3,vb=$VSPEED,scale=$VSIZE2,acodec=mpga,ab=$ASPEED}:std{access=http{user='',pwd='',mime=video/x-ms-asf},mux=asf,url=:8001}" <br>
exit 1<br> ## END STREAM LIVE TV ##<br><br> ## BEGIN STREAM VIDEO SCRIPT ##<br>elif [ $vMODE == "3" ]; then<br> echo<br> echo "Recorded Programs:"<br> echo<br> ls /myth/video<br>
echo<br> echo "Which File?"<br> read VIDEO<br><br> echo "Starting VLC..."<br> vlc -I http --http-host=:8002 --sout-transcode-fps=$FPS --sout-transcode-deinterlace /myth/video/$VIDEO ":sout=#transcode{vcodec=DIV3,acodec=mpga,vb=$VSPEED,ab=$ASPEED,scale=$SIZE2}:std{access=http{user='',pwd='',mime=video/x-ms-asf},mux=asf,url=:8001}"<br>
<br>elif [ $vMODE == "4" ]; then <br> echo <br> echo "Which Chapter?"<br> read CHAPTER<br> echo "Starting VLC..."<br> vlc -vvv --color dvdsimple:/dev/dvd@1:$CHAPTER --sout udp://<a href="http://192.168.0.255">192.168.0.255</a> --ttl 12 --sout-all<br>
fi<br><br><br>This script also calls a small window that makes it easy to change channels when viewing live TV:<br><br>stream_channel_prompt.sh:<br><br>#!/bin/bash<br><br>NEWCHAN=0<br>while [ $NEWCHAN -lt 9999 ]; do<br> clear<br>
echo "Change to Channel?"<br> read NEWCHAN<br> change_channel.csh $NEWCHAN<br>done<br><br><br><br>Hope anyone else can use this. You may need to tweak more to fit your installation.<br><br><br><br><br><br>
<br>