Talk:Stream mythtv recordings from mythweb using flash video

From MythTV Official Wiki
Revision as of 14:25, 17 November 2007 by Cleverca22 (talk | contribs) (RE: ffpeg and nuv)

Jump to: navigation, search

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.

geoff.fox@gmail.com

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


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...

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

https://192.168.1.200/mythweb/data/FLVPlayer.swf?file=/mythweb/data/recordings/futurama.nuv.flv

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.

https://192.168.1.200/mythweb/data/FLVPlayer.swf?file=/mythweb/data/recordings/futurama.nuv.flv

Any help would be appreciated.

Scott

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.

Instructions:

  1. Save the code below to /usr/local/bin/mythflash_cleanup.pl (or wherever you want to put your script).
  2. Change the directory listed to reflect your recordings folder & save
  3. Chmod the mythflash_cleanup.pl 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.
#!/usr/bin/perl 
# 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.

Regards,

Selbram

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.

Barry253

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.

Selbram


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.

Grant


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)

Brad

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 http://chiefhacker.com/2007/01/22/streaming-mythtv-from-mythweb-using-flash/

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 http://chiefhacker.com/2007/01/22/streaming-mythtv-from-mythweb-using-flash/ 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

UKDude