Opened 18 years ago
Closed 18 years ago
Last modified 17 years ago
#4644 closed patch (wontfix)
Fix to allow correct aspect ratio to play in mythweb flash player.
Reported by: | anonymous | Owned by: | xris |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythweb | Version: | unknown |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
This is a patch to determine the aspect ratio of the video before playing in the mythweb flash player. Thus playing HD or none 4:3 aspect video correctly. Patch should be applied directly to handler.pl in the mythweb stream. Also fixed minor error in print statement.
Attachments (1)
Change History (8)
by , 18 years ago
Attachment: | streamhandler.diff added |
---|
comment:1 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 18 years ago
Resolution: | invalid |
---|---|
Status: | closed → new |
comment:3 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:4 by , 18 years ago
Resolution: | wontfix |
---|---|
Status: | closed → new |
how can this be implemented in backend if the frame of the flash player is hard coded in the mythweb? The file being played has correct ratio, the flash player is the one that has the wrong aspect ratio, this cannot be implemented on backend side as backend is already playing correct ratio, the flash player needs to be adjusted accordingly and since its hard coded to 4:3, everything it plays (even if the source is 16:9) is displayed in 4:3.
comment:5 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The aspect ratio will be calculated on the backend at the time it is recorded and stored in the database. Mythweb will then use this information.
Your patch is not acceptable because it uses ffmpeg. The final version of the flash player in mythweb will not use ffmpeg at all and it won't be required on the web server.
comment:6 by , 17 years ago
Here is an updated version that works with 0.21-fixes and streams from my HD Homerun
tlunde@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@test810a6:~$
comment:7 by , 17 years ago
Ewwww. Sorry about that -- try this one:
tlunde@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@test810a6:~$
I'm not accepting patches against this proof of concept for features that should be implemented properly in the backend.