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