[mythtv-commits] Ticket #7575: Mythweb flashplayer (flowplayer) does not display correct aspect in fullscreen

MythTV mythtv at cvs.mythtv.org
Sun Nov 15 08:21:18 UTC 2009


#7575: Mythweb flashplayer (flowplayer) does not display correct aspect in
fullscreen
---------------------------------------+------------------------------------
 Reporter:  justin.johnson3@…          |       Owner:  kormoc
     Type:  defect                     |      Status:  new   
 Priority:  minor                      |   Milestone:        
Component:  Plugin - MythWeb           |     Version:  0.22  
 Severity:  medium                     |     Mlocked:  0     
---------------------------------------+------------------------------------
 When watching a recording in fullscreen, the video simply fills the
 available space, rather than displaying in the proper aspect ratio. I'm
 not sure how to make a patch since I've never submitted a ticket before,
 but the way to fix it is to change /mythweb/modules/stream/stream_flv.pl
 thusly:
 {{{
 # auto-detect height based on aspect ratio
     $sh = $dbh->prepare('SELECT data FROM recordedmarkup WHERE chanid=?
 AND starttime=FROM_UNIXTIME(?) AND data IS NOT NULL ORDER BY data DESC');
     $sh->execute($chanid,$starttime);
     $x = $sh->fetchrow_array;
     $y = $sh->fetchrow_array if ($x);
     $width = round_even($width);
     if ($x && $y) {
         $height = round_even($width * ($y/$x));
         $aspect = $x/$y;
     } else {
         $height = round_even($width * 3/4);
         $aspect = 4/3;
     }
     $sh->finish();
 }}}
 And later:
 {{{
       my $ffmpeg_command = $ffmpeg
                         .' -y'
                         .' -i '.shell_escape($filename)
                         .' -s '.shell_escape("${width}x${height}")
                         .' -g 30'
                         .' -r 24'
                         .' -f flv'
                         .' -aspect '.shell_escape($aspect)
                         .' -deinterlace'
                         .' -ac 2'
                         .' -ar 11025'
                         .' -ab '.shell_escape("${abitrate}k")
                         .' -b '.shell_escape("${vbitrate}k")
                         .' /dev/stdout 2>/dev/null |';
 }}}

 The detail.php template also needs to change
 /mythweb/modules/tv/tmpl/default/detail.php:
 {{{
                 flowplayer(
                     "player",
                     "<?php echo root_url ?>tv/flowplayer-3.1.5.swf", {
                     playlist: [
                         // this first PNG clip works as a splash image
                         {
                             url: '<?php echo $program->thumb_url($flv_w,0)
 ?>',
                             scaling: 'orig'
                             },
                         // Then we have the video
                         {
                             url: "<?php echo video_url($program, 'flv');
 ?>",
                             duration: <?php echo $program->length ?>,
                             autoPlay: false,
                             // Would be nice to auto-buffer, but we don't
 want to
                             // waste bandwidth and CPU on the remote
 machine.
                             autoBuffering: false,
                             scaling: 'fit'
                             }
                         ]}
                     );
 }}}

 My apologies for the lack of an actual patch, but this is a pretty easy
 fix.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/7575>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list