diff -ur /var/www/localhost/htdocs/mythweb_ori/modules/stream/handler.pl /var/www/localhost/htdocs/mythweb/modules/stream/handler.pl
old
|
new
|
|
30 | 30 | elsif ($ENV{'REQUEST_URI'} =~ /\.flvp$/i) { |
31 | 31 | require "modules/$Path[0]/stream_flvp.pl"; |
32 | 32 | } |
33 | | elsif ($ENV{'REQUEST_URI'} =~ /\.flv$/i) { |
| 33 | elsif ($ENV{'REQUEST_URI'} =~ /\.flv\?.+$/i) { |
34 | 34 | require "modules/$Path[0]/stream_flv.pl"; |
35 | 35 | } |
36 | 36 | # Mpeg4? |
diff -ur /var/www/localhost/htdocs/mythweb_ori/modules/stream/stream_flv.pl /var/www/localhost/htdocs/mythweb/modules/stream/stream_flv.pl
old
|
new
|
|
62 | 62 | $vbitrate = 256 unless ($vbitrate && $vbitrate > 1); |
63 | 63 | $abitrate = 64 unless ($abitrate && $abitrate > 1); |
64 | 64 | |
| 65 | |
| 66 | # approximation of the final size of the stream |
| 67 | $sh = $dbh->prepare('SELECT unix_timestamp(endtime)-unix_timestamp(starttime) FROM recorded WHERE chanid=? AND starttime=FROM_UNIXTIME(?)'); |
| 68 | $sh->execute($chanid,$starttime); |
| 69 | $timelength = $sh->fetchrow_array; |
| 70 | $length = ((($abitrate + $vbitrate)/8) * 1024 * $timelength ); |
| 71 | |
| 72 | |
| 73 | if ("$ENV{'REQUEST_URI'}" =~ /start\=(\d+)$/i) { |
| 74 | $start = $1; } |
| 75 | else { |
| 76 | $start = 0; } |
| 77 | |
65 | 78 | my $ffmpeg_command = $ffmpeg |
66 | 79 | .' -y' |
| 80 | .' -ss '.shell_escape("$start") |
67 | 81 | .' -i '.shell_escape($filename) |
68 | 82 | .' -s '.shell_escape("${width}x${height}") |
69 | 83 | .' -g 30' |
… |
… |
|
83 | 97 | "Can't do ffmpeg: $!\n${ffmpeg_command}"; |
84 | 98 | exit; |
85 | 99 | } |
86 | | print header(-type => 'video/x-flv'); |
| 100 | |
| 101 | print header(-type => 'video/x-flv', -Content_length => "${length}"); |
87 | 102 | my $buffer; |
88 | 103 | while (read DATA, $buffer, 262144) { |
89 | 104 | print $buffer; |
diff -ur /var/www/localhost/htdocs/mythweb_ori/modules/tv/tmpl/default/detail.php /var/www/localhost/htdocs/mythweb/modules/tv/tmpl/default/detail.php
old
|
new
|
|
548 | 548 | }, |
549 | 549 | // Then we have the video |
550 | 550 | { |
| 551 | provider: 'pseudo', |
551 | 552 | url: "<?php echo video_url($program, 'flv'); ?>", |
552 | 553 | duration: <?php echo $program->length ?>, |
553 | 554 | autoPlay: false, |
… |
… |
|
555 | 556 | // waste bandwidth and CPU on the remote machine. |
556 | 557 | autoBuffering: false |
557 | 558 | } |
558 | | ]} |
| 559 | ], |
| 560 | plugins: { |
| 561 | pseudo: { |
| 562 | url: 'flowplayer.mythpseudostreaming.swf' |
| 563 | } |
| 564 | } |
| 565 | } |
559 | 566 | ); |
560 | 567 | </script> |
561 | 568 | <?php } elseif (file_exists('modules/tv/MFPlayer.swf')) { ?> |