Talk:Stream mythtv recordings from mythweb using flash video

From MythTV Official Wiki
Jump to: navigation, search

This section should be deleted, (I'll come back and remove it after suitable time for dissent) iPhone and iPod streaming is covered elsewhere and the new flowplayer plugin uses flash to stream from mythweb, making all of the following complex setup unnecessary

I have attempted to follow the instructions on the connected page, but have gotten nowhere. If I enter the ffmpeg commands manually, I am told it doesn't recognize nuv files. I must be doing something wrong.

I would appreciate any any help at all.

Another Flash Player

Thanks for this great howto! I got it working using a different swf player that I found in freshmeat. It's called flowplayer. Mythuser 13:22, 1 September 2006 (UTC)

RE: ffpeg and nuv

Geoff, I think there is a patch floating around somwhere to allow ffmpeg to deal with nuv files, but I don't have the link handy. I could be totally off too but I seem to recall running across this with one of my tuners that recorded nuv files.

Lynchmv 15:10, 1 September 2006 (UTC)

i made a small hackish fix by using mencoder to decode the nuv to raw video and pipe it to ffmpeg it seems to fix the ffmpeg seg faulting on nuv files and the video plays fine but still no sound i'll post a link to the patch when i get arround to it

--Cleverca22 14:26, 17 November 2007 (UTC)

Can't get FLVPlayer.swf to play

This isn't working for me. I was able to make FLV files using FFMPEG from MPEG files and I hacked up a copy of nuvexport on my machine to make FLV files from NUV files. No apparent problems there. I've never played any of these FLV files (see below).

I followed all the instructions (or at least I think I did) and I can't get anything to play. FLVPlayer.swf is in /mythweb/data I modified the recordings.php file so that when I click on an png image in the recordings page it generates this URL...

( is of course the local address of my Myth Box.)

Firefox simply opens a new blank window. Internet Explorer reports an error "The page cannot be found".

So I copied the flv file to the /mythweb/data directory to remove the soft link "recordings" from consideration. Still same thing.

Any help would be appreciated.


abbydog _at_ cfl _dot_ rr _dot_ com

"Cleanup Script" for Flash videos created with MythFlash

Below is a Perl script to perform 2 functions:

  1. Delete any 0-byte .flv (Flash) files that exist in the recordings folder (this happens to me sometimes).
  2. Fill in any missing Flash videos that for some reason didn't get created with MythFlash.


  1. Save the code below to /usr/local/bin/ (or wherever you want to put your script).
  2. Change the directory listed to reflect your recordings folder & save
  3. Chmod the file to make it executable
  4. Add a line to /etc/crontab to run it as often as you want. Note that encoding missing files can take a long time, so I chose every day at 4am.
# deletes 0-byte flv files from recording directory
#Checks the myth recording directory for .mpg files that don't have a corresponding .flv file. If so, creates them.

#Change below to your myth recordings directory
$directory = "/pvr/videos";

$results2 = system("find $directory/*.flv -size 0c -delete") ;  #deletes any .flv files that are 0 bytes
foreach $f (<$directory/*>) {  
	$flash = $f . ".flv";
	if ( $f =~ /.mpg$/ )  #look for mpg files
	  if (!( -e $flash )) {   # if there's no corresponding .flv, make one
		print "Running mythflash on $f\n";
		$results3 = system("ffmpeg -y -i $f -r 20 -s 320x240 -deinterlace -ar 22050 $f.flv");  # change to your pref
		$results4 = system("cat $f.flv | flvtool2 -U stdin $f.flv");  #optional

Barry253 22:13, 19 September 2006 (UTC)

-- I'm finding this method can cause some problems, especially after a heavy recording evening (when the job queue is still being processed) or when there is a late night recording. It'd be slick if, instead of actually generating the flash, we figure out how to inject a job to build it into the queue. This way, the queue manager will handle assigning the system/time to balance the loads, AND we don't clobber/interfere with an existing flash transcode job. As a note for myself later (or anyone else who might be interested in figuring this out), check out JobQueue.cpp for relevant SQL statements and the like. JobQueue::QueueJob and JobQueue::IsJobQueuedOrRunning look particularly relevant. Perhaps write a small executable that uses a JobQueue object to insert the job if it's not already inserted? Just brainstorming. --Foosinho 15:18, 12 January 2007 (UTC)

Any one running 0.20 with flash working? (09/30/2006)

I have followed the directions listed and can create the .flv files and can even get the link to read properly. The flvplayer is not working though. I have tried using a streamer.php file and that did not work either. Any suggestions on what can be done to get this working.



Try accessing the flvplayer directly through a URL - does the program load? The next step would see if it can play a test file in the same directory.


That was not working either. I ended up redownloading the player and I can now get the video up.

Next problem.

I have great video but no sound. Any ideas.

UPDATE: I had to recompile ffmpeg to enable faad support. You will need to install libfaad2-devel for this to work right. I got perfectly good sound now.


Anyone got this working with .20-fixes? (11/12/06)

The recorded.php file has changed. Here is the relevant code (I think):

           if (file_exists(cache_dir.'/'.basename($show->filename).'.png')) {
               list($width, $height, $type, $attr) =    getimagesize(cache_dir.'/'.basename($show->filename).'.png');
               echo "<a href=\"$show->url\" name=\"$row\">"
                   .'<img id="'.$show->filename.'" src="'.$show->thumb_url.'.png" '.$attr.' border="0">'

Any help getting this to work with latest .20-fixes is appreciated.


Can try the following patch if you'd like - this is all I used (assuming everything else is installed in data/flvplayer.swf etc)

--- includes/utils.php.orig     2006-12-04 22:09:40.000000000 -0600
+++ includes/utils.php  2006-12-04 22:16:38.000000000 -0600
@@ -322,6 +322,13 @@
  * @return string URL to access recordings
     function video_url($show) {
+       $flv_path = "data/recordings/".basename($show->filename).".flv";
+       if (file_exists($flv_path)) {
+           return "/mythweb/data/flvplayer.swf?file=/mythweb/$flv_path";
+       } else {
+           return "#";
+       }
     // Global override?
         $video_url = setting('WebVideo_URL');
         if ($video_url)


Easy Install Instructions 1/21/07

This page is now outdated. I have taken the time to compile all the suggestions on this page and create a zip containing all the necessary scripts to get this working under MythTv 0.20. You can get more information at

I have also added a few enhancements: Shows can be encoded directly from MythWeb You can watch shows at 1X 2X 3X or Full screen magnification Added streaming support so you can jump ahead without having to download the full file

So again check out to download the files and get it running!

Added some pertinent information to the streaming mobile section

Check the streaming mobile discussion section for a bunch of files I've taken from here and modified to my tastes.. includes SPEC files for some fc7 RPMs that didnt compile properly for me


MEncoder for higher quality

I set up some scripts that use mythtranscode to cut out commercials and MEncoder for higher quality transcodes than ffmpeg. I've also set it up so that shows start transcoding when you start watching them, and it will stream while it transcodes. Just click a link from the recordings page, and it will start playing. It's also worth noting that MEncoder makes flvtool2 unnecessary, as it keeps the necessary data intact. You can't scroll back and forth through the video until it's done encoding, but once it's done you can.

My current implementation is not well integrated into the mythweb structure, and it has some big security holes (but is blocked by .htaccess). If I ever get around to cleaning it up, I might distribute it to those who are interested. If you have any questions, e-mail me:


AusIV 01:24, 14 February 2008 (UTC)