<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> The menu part is easy since I know how to launch a command from a menu item.
<br>> BUT....does anyone know how to start a stream from the command line?<br><br>Mplayer can play streams so you could just create menu items that<br>invoke mplayer.<br><br>Alternatively you could do the following:<br>
1) Create a playlist file (extension .m3u I think) which contains the<br>URL of the stream.<br>2) Create a mythvideo entry that has a custom command line to call<br>invoke mplayer with the playlist file. In that command line you can
<br>also tell it how much to buffer before it starts plaaying etc. I have<br>an example at home if you'd like me to post it later.</blockquote><div><br>Phil, I'd be interested in seeing your implementation of this.
<br><br>Here is how I handle this. I've written a bash script that parses several of the major movie trailer websites and puts the entries into a custom menu I have inserted into MythTV. <br><br>A typical menu entry looks like this:
<br><br>*****************<br><br><button><br> <type>MOVIETIMES</type><br> <text>The Dark Knight</text><br> <action>EXEC MplayerWrap '<a href="http://movies.apple.com/movies/wb/the_dark_knight/the_dark_knight-tlr1_h720p.mov">
http://movies.apple.com/movies/wb/the_dark_knight/the_dark_knight-tlr1_h720p.mov</a>' </action><br></button><br><br>*****************<br><br></div></div>Now MplayerWrap is just that, a wrapper that uses wget to download the trailer into a specified directory, fires up mplayer and plays it, then deletes it. I keep it in /usr/local/bin/.
<br><br>*****************<br><br>#!/bin/bash<br><br><br>cd /video/trailers/<br><br><br>rm -f *.mov<br><br><br>URL=`echo $1 |sed 's,\&amp\;,\&,g'`<br><br><br># Blind download, it works but you have no idea how long you'll be waiting.
<br><br># wget $URL ; <br><br><br># "Fred Flintstone" quality progress bar, ugly but works.<br><br>xterm -e wget $URL ; <br><br><br># Pretty GUI version - ooooooh. NOTE - this line does not currently work on Fedora Core 6. For functionality zenity must be compiled from source at version
2.2 or higher, plus the
sed statement must be adjusted. I'm working on this. All debian/ubuntu
based distros work out of the box.<br><br># wget $URL 2>&1 | sed -e 's/.*\ \([0-9]\+%\)\ \+\([0-9.]\+\ [KMB\/s]\+\)$/\1\n# Downloading \2/' | zenity --progress --title="Downloading Trailer..." --auto-close --width=700 ;
<br><br><br>mv *.mov* trailer.mov<br><br><br>mplayer -fs -zoom -quiet /video/MythCinema-MovieTrailers/trailers/trailer.mov;<br><br><br># Use this line to stream the media rather than download.<br><br># mplayer -fs -zoom -quiet -user-agent NSPlayer $URL
<br><br><br>rm -f /video/MythCinema-MovieTrailers/trailers/trailer.mov<br><br><br># END<br><br>*****************<br><br>You can easily alter this behavior to play the video directly off the net as a stream by commenting out the wget lines/mplayer line and uncommenting the streaming line. All the sed line does up there is fix the ampersands from the xml valid format of "&amp;" to a standard "&" so that wget and mplayer don't freak out. You can also play with the "-cache" option to adjust your buffer.
<br><br>I have another player script written for Xine if anyone wants it.<br><br><br>Joe<br>