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> <<a href="mailto:jvolckaert@gmail.com">jvolckaert@gmail.com</a>> 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. I call it MythTube. It's very simple to setup and<br>plays video great. Each flash video is about 80M for an hour long
<br>show (minus commercials). It consists of a php page, a transcode<br>script, and a flash player. I run the transcode job after the remove<br>commercials script from the Wiki. The remove commercials may be<br>important as I saw comments about B-Frames being a problem with
<br>mencoder. I believe lossless transcoding removes any B-Frames.<br><br>To setup Mythtube, first create a directory under your webserver<br>called mythtube. Mine was "/data/www/html/mythtube". You will need
<br>to change any references below to whatever your directory is.<br><br>Next, get flvplayer.swf. 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 "play.php" and put it in the mythtube directory as well.<br>Here's play.php:<br><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 TRANSITIONAL//EN"><br><html><br><head><br> <title>Welcome to MythTube!</title><br></head><br> <body bgcolor="#002650"><br><h3>Now playing: <?php echo $_GET["movie"]; ?></h3>
<br><br><br><div style="text-align: center;"><br><object type="application/x-shockwave-flash" width="<?php echo<br>$_GET["h"]; ?>" height="<?php echo $_GET["w"]; ?>"
<br>wmode="transparent" data="flvplayer.swf?file=<?php echo $_GET["movie"]; ?>"><br><param name="movie" value="flvplayer.swf?file=<?php echo $_GET["movie"]; ?>" />
<br><param name="wmode" value="transparent" /><br></object><br></div><br><br><br><h3>Videos:</h3><br><table border="1"><br><?php<br>$files = scandir("/data/www/html/mythtube");
<br>// filter for only .flv files<br>$movies = array();<br>foreach($files as $file) {<br> if(substr($file,-4) == ".flv") {<br> echo "<tr><td>".$file."</td>";<br> echo "<td><a
<br>href=\"".$PHP_SELF."?movie=".$file."&h=640&w=480\">Large</a></td>";<br> echo "<td><a<br>href=\"".$PHP_SELF."?movie=".$file."&h=360&w=240\">Small</a></td></tr>";
<br> $movies[] = $file;<br> }<br>}<br>?><br></table><br></body><br></html><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>"%TITLE%" %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 "$VIDEODIR" -o -z "$FILENAME" ]; then<br> echo "Usage: $0 <VideoDirectory> <FileName> "<Title>" <Starttime>"<br> exit 5<br>fi<br>if [ ! -f $VIDEODIR/$FILENAME ]; then
<br> echo "File does not exist: $VIDEODIR/$FILENAME"<br> 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 -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 -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> echo "Transcoding failed for ${FILENAME} with error $ERROR"<br> 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>