[mythtv-commits] Ticket #4644: Fix to allow correct aspect ratio to play in mythweb flash player.

MythTV mythtv at cvs.mythtv.org
Wed Sep 24 00:09:36 UTC 2008


#4644: Fix to allow correct aspect ratio to play in mythweb flash player.
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |        Owner:  xris   
     Type:  patch      |       Status:  closed 
 Priority:  minor      |    Milestone:  unknown
Component:  mythweb    |      Version:  unknown
 Severity:  medium     |   Resolution:  wontfix
  Mlocked:  0          |  
-----------------------+----------------------------------------------------

Comment(by anonymous):

 Ewwww.  Sorry about that -- try this one:

 {{{

 tlunde at test810a6:~$ cat handler.pl.diff
 103d102
 <     my $height = int($width * 10/16);
 155c154
 < <embed src="${web_root}tv/flvplayer.swf" width="$width" height="260"
 bgcolor="#FFFFFF"
 ---
 > <embed src="${web_root}tv/flvplayer.swf" width="320" height="260"
 bgcolor="#FFFFFF"
 163,192d161
 <
 <   # Find out the video dimensions (this is a quick hack)
 <        if (!open(FINFO,"$ffmpeg -y -i $filename -r 24 -f flv -ac 2 -ar
 11025 -ab 64k -b 256k -vframes 1 -ss 65 /dev/null 2> /dev/stdout|"))  {
 <            print header(),
 <                "Error: Can not get ffmpeg output for file
 $filename..\n";
 <            CORE::exit;
 <        }
 <
 <   my $horz;
 <               my $vert;
 <
 <               while (<FINFO>) {
 <                   if (/mpeg2video/) {
 <                       ($horz, $vert) = /\s(\d+)x(\d+)\s/;
 <                       last;
 <                   }
 <               }
 < if (! $horz) { $horz=$width;}
 < if (! $vert) { $vert=$height;}
 <
 <  $ratio = $vert / $horz;
 <               $newhorz = $width;
 <               $newvert = int($newhorz * $ratio);
 <
 <               $newvert += $newvert % 8; # make the new vert a multiple
 of 8
 <
 <        close FINFO;
 <
 <
 <
 194c163,170
 <  $ffmpeg_pid = open(DATA, "$ffmpeg -y -i $filename -s " . $newhorz . "x"
 . $newvert . " -r 24 -f flv -ac 2 -ar 11025 -ab 64k -b 256k /dev/stdout
 2>/tmp/ffmpeg-output.log |");
 ---
 >         $ffmpeg_pid = open(DATA,
 >             "$ffmpeg -y -i ".shell_escape($filename)
 >             .' -s '.shell_escape("${width}x$height")
 >             .' -r 24 -f flv -ac 2 -ar 11025'
 >             .' -ab '.shell_escape("${abitrate}k")
 >             .' -b '.shell_escape("${vbitrate}k")
 >             .' /dev/stdout 2>/dev/null |'
 >             );
 tlunde at test810a6:~$


 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/4644#comment:7>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list