Modify

Ticket #7575 (closed defect: invalid)

You must read the TicketHowTo before creating a new ticket or commenting on an existing ticket.

Opened 2 years ago

Last modified 17 months ago

Mythweb flashplayer (flowplayer) does not display correct aspect in fullscreen

Reported by: justin.johnson3@… Owned by: kormoc
Priority: minor Milestone: unknown
Component: Plugin - MythWeb Version: 0.22
Severity: medium Keywords:
Cc: Ticket locked: no

Description

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.

Attachments

stream_flv.diff Download (1.1 KB) - added by justin.johnson3@… 2 years ago.
detail.php.diff Download (877 bytes) - added by justin.johnson3@… 2 years ago.

Change History

comment:1 Changed 2 years ago by anonymous

To make a patch file:

If you modified the file where you checked out MythTV using SVN, type

SVN diff > some_file_name.diff

If you modified it elsewhere

diff -c old_file your_new_file > some_file_name.diff

the old_file must be what's currently in Trunk/Head? otherwise it won't apply correctly.

Good luck!

Changed 2 years ago by justin.johnson3@…

Changed 2 years ago by justin.johnson3@…

comment:2 Changed 2 years ago by justin.johnson3@…

This actually seems to be fixed in the latest version of ffmpeg

comment:3 Changed 2 years ago by robertm

  • Status changed from new to closed
  • Resolution set to invalid

Closing as a) reporter no longer experiencing issue, and b) flash player is not considered a supported feature (please re-read the red warning box when enabling the feature).

comment:4 Changed 17 months ago by anonymous

I don't know if this is related, however, flash playback with recent updates for mythbuntu 10.04 has flash playback not working anymore. In such that the aspect ratios are all incorrect. HD playback is dramatically squished from the sides and SD recordings are dramatically squished from the top and bottom making video un-viewable full screen or not. I attempted to implement the above code with no luck. This auto hight thing definitely needs to be polished.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.