say, could you email me these files as attachments, gmail and my other email clients both wrapped the lines and I can't seem to get them to work.<br>at least the flashtranscode file. <br><br><br><br><br><div><span class="gmail_quote">
On 11/4/06, <b class="gmail_sendername">Jeff volckaert</b> &lt;<a href="mailto:jvolckaert@gmail.com">jvolckaert@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Everybody,<br><br>I have created a userjob and webpage to play Myth videos in a browser<br>over the internet.&nbsp;&nbsp;I call it MythTube.&nbsp;&nbsp;It's very simple to setup and<br>plays video great.&nbsp;&nbsp;Each flash video is about 80M for an hour long
<br>show (minus commercials).&nbsp;&nbsp;It consists of a php page, a transcode<br>script, and a flash player.&nbsp;&nbsp;I run the transcode job after the remove<br>commercials script from the Wiki.&nbsp;&nbsp;The remove commercials may be<br>important as I saw comments about B-Frames being a problem with
<br>mencoder.&nbsp;&nbsp;I believe lossless transcoding removes any B-Frames.<br><br>To setup Mythtube, first create a directory under your webserver<br>called mythtube.&nbsp;&nbsp;Mine was &quot;/data/www/html/mythtube&quot;.&nbsp;&nbsp;You will need
<br>to change any references below to whatever your directory is.<br><br>Next, get flvplayer.swf.&nbsp;&nbsp;Download<br><a href="http://www.jeroenwijering.com/upload/flash_flv_player.zip">http://www.jeroenwijering.com/upload/flash_flv_player.zip
</a> and move<br>flash_flv_player/extras/flvplayer.swf into your mythtube directory<br>under your webserver.<br><br>Then create &quot;play.php&quot; and put it in the mythtube directory as well.<br>Here's play.php:<br>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 
4.01 TRANSITIONAL//EN&quot;&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Welcome to MythTube!&lt;/title&gt;<br>&lt;/head&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;body bgcolor=&quot;#002650&quot;&gt;<br>&lt;h3&gt;Now playing: &lt;?php echo $_GET[&quot;movie&quot;]; ?&gt;&lt;/h3&gt;
<br>&lt;br&gt;<br>&lt;div style=&quot;text-align: center;&quot;&gt;<br>&lt;object type=&quot;application/x-shockwave-flash&quot; width=&quot;&lt;?php echo<br>$_GET[&quot;h&quot;]; ?&gt;&quot; height=&quot;&lt;?php echo $_GET[&quot;w&quot;]; ?&gt;&quot;
<br>wmode=&quot;transparent&quot; data=&quot;flvplayer.swf?file=&lt;?php echo $_GET[&quot;movie&quot;]; ?&gt;&quot;&gt;<br>&lt;param name=&quot;movie&quot; value=&quot;flvplayer.swf?file=&lt;?php echo $_GET[&quot;movie&quot;]; ?&gt;&quot; /&gt;
<br>&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;<br>&lt;/object&gt;<br>&lt;/div&gt;<br>&lt;br&gt;<br>&lt;h3&gt;Videos:&lt;/h3&gt;<br>&lt;table border=&quot;1&quot;&gt;<br>&lt;?php<br>$files = scandir(&quot;/data/www/html/mythtube&quot;);
<br>// filter for only .flv files<br>$movies = array();<br>foreach($files as $file) {<br>&nbsp;&nbsp; if(substr($file,-4) == &quot;.flv&quot;) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&lt;tr&gt;&lt;td&gt;&quot;.$file.&quot;&lt;/td&gt;&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&lt;td&gt;&lt;a
<br>href=\&quot;&quot;.$PHP_SELF.&quot;?movie=&quot;.$file.&quot;&amp;h=640&amp;w=480\&quot;&gt;Large&lt;/a&gt;&lt;/td&gt;&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&lt;td&gt;&lt;a<br>href=\&quot;&quot;.$PHP_SELF.&quot;?movie=&quot;.$file.&quot;&amp;h=360&amp;w=240\&quot;&gt;Small&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $movies[] = $file;<br>&nbsp;&nbsp; }<br>}<br>?&gt;<br>&lt;/table&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><br><br>Next you need to create the userjob which generates the flv files.<br><br>Here's the MYSQL commands I used in creating userjob 3:
<br>use mythconverg;<br><br>UPDATE settings SET data='/usr/local/bin/flashtranscode %DIR% %FILE%<br>&quot;%TITLE%&quot; %STARTTIME%' WHERE value='UserJob3';<br><br>UPDATE settings SET data='Flash Transcode' WHERE value='UserJobDesc3';
<br><br>UPDATE settings SET data='1' WHERE value='JobAllowUserJob3';<br><br><br><br>Here's the /usr/local/bin/flashtranscode script:<br>#!/bin/sh<br># flashtranscode<br>#<br># created by Jeff Volckaert (inspired by Zach White)
<br># modified 11/03/06 to use Flash<br>VIDEODIR=$1<br>FILENAME=$2<br>TITLE=$3<br># Remove non-alpha characters from TITLE<br>TITLE=${TITLE//[^a-zA-Z0-9]/}<br>STARTTIME=$4<br><br># Sanity checking, to make sure everything is in order.
<br>if [ -z &quot;$VIDEODIR&quot; -o -z &quot;$FILENAME&quot; ]; then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Usage: $0 &lt;VideoDirectory&gt; &lt;FileName&gt; &quot;&lt;Title&gt;&quot; &lt;Starttime&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit 5<br>fi<br>if [ ! -f $VIDEODIR/$FILENAME ]; then
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;File does not exist: $VIDEODIR/$FILENAME&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit 6<br>fi<br><br># Transcode the file<br><br>mencoder -ofps 12 -of lavf -lavfopts<br>i_certify_that_my_video_stream_does_not_use_b_frames -oac lavc
<br>-lavcopts acodec=mp3:abitrate=32 -channels 1 -srate 22050&nbsp;&nbsp;-ovc lavc<br>-lavcopts vcodec=flv:vbitrate=200:cbp:mv0:mbd=2:trell:v4mv:predia=2:dia=2:last_pred=3<br>-vop spp,scale=360:240,harddup -o<br>/data/www/html/mythtube/$TITLE-$STARTTIME.flv $VIDEODIR/$FILENAME
<br><br># For a smaller file use this instead.<br># (It take three times longer to encode though)<br># mencoder -ofps 12 -of lavf -lavfopts<br>i_certify_that_my_video_stream_does_not_use_b_frames -oac lavc<br>-lavcopts acodec=mp3:abitrate=32 -channels 1 -srate 22050&nbsp;&nbsp;-ovc lavc
<br>-lavcopts vcodec=flv:vbitrate=100:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:vmax_b_frames=0:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2<br>-vop spp,scale=320:240 -o<br>/data/www/html/mythtube/$TITLE-$STARTTIME-
2.flv $VIDEODIR/$FILENAME<br><br># Uncomment this if you want to insert MetaData tags into the file<br># /usr/bin/flvtool2/flvtool2 -U /data/www/html/mythtube/$TITLE-$STARTTIME.flv<br><br>ERROR=$?<br>if [ $ERROR -ne 0 ]; then
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Transcoding failed for ${FILENAME} with error $ERROR&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit 3<br>fi<br><br><br>After at least one file has been transcoded you can pull up the<br>play.php page and start watching video.
<br><br>Enjoy,<br>Jeff<br>_______________________________________________<br>mythtv-users mailing list<br><a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br><a href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users">
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</a><br></blockquote></div><br>