チェンジセット 8: trunk/install
- コミット日時:
- 2006/12/07 15:00:43 (18 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/perl/foltia_conf1.pl.template
r1 r8 20 20 $haveirdaunit = 1;#Tira-2<http://www.home-electro.com/tira2.php>をつないでいるときに1,なければ0 21 21 $mp4filenamestyle = 1 ;#0:PSP ファームウェアver.2.80より前と互換性を持つファイル名 1;よりわかりやすいファイル名 22 $trconqty = 2; 23 #0:PSP/iPod XviD MPEG4(旧式):faacとMPEG4IPを使って変換 24 #1:iPod Xvid MPEG4 標準画質 15fps 300kbps 25 #2:iPod H.264 中画質 24fps 300kbps 26 #3:iPod H.264 高画質 30fps 300kbps 22 27 23 # デフォルトでインストールしてればいじらなくてもいい28 #以下はデフォルトでインストールしてればいじらなくてもいい 24 29 $main::DBDriv="Pg"; 25 30 $main::DBHost="localhost"; trunk/install/perl/recwrap.pl
r1 r8 29 29 $recch = $ARGV[0] ; 30 30 if ($recch eq "" ){ 31 #引き数なし 出実行されたら、終了31 #引き数なしで実行されたら、終了 32 32 print "usage recwrap.pl ch length(sec) [bitrate(5)] [TID] [NO] [PID]\n"; 33 33 exit; … … 79 79 if ($oserr == 1){ 80 80 &writelog("recwrap ABORT recfile exist. [$outputfilename] $recch $reclength 0 0 $bitrate $tid $countno $pid"); 81 exit; 81 82 }else{ 82 83 &writelog("recwrap RECEND [$outputfilename] $recch $reclength 0 0 $bitrate $tid $countno $pid"); … … 243 244 # print "$pspfilname($pspfilnamehd/$pspfilnameft)\n"; 244 245 }# endif MP4ファイル名が新styleなら 245 246 &writelog("recwrap TRCNSTART vfr4psp.sh $recfolderpath/$outputfilename $pspfilname $pspdirname $psptrcn[1]"); 247 #トラコン開始 248 system("$toolpath/perl/transcode/vfr4psp.sh $recfolderpath/$outputfilename $pspfilname $pspdirname $psptrcn[1]"); 249 250 &writelog("recwrap TRCNEND vfr4psp.sh $recfolderpath/$outputfilename $pspfilname $pspdirname $psptrcn[1]"); 251 252 #最適化 253 254 $DBQuery = "SELECT subtitle FROM foltia_subtitle WHERE tid = '$tid' AND countno = '$countno' "; 255 $sth = $dbh->prepare($DBQuery); 256 $sth->execute(); 257 @programtitle = $sth->fetchrow_array; 258 259 if ( $countno == "0" ){ 260 $pspcountno = ""; 261 }else{ 262 $pspcountno = $countno ; 263 } 264 &writelog("recwrap OPTIMIZE mp4psp -p $pspdirname/M4V$pspfilname.MP4 -t '$psptrcn[2] $pspcountno $programtitle[0]' "); 265 Jcode::convert(\$programtitle[0],'euc'); 266 system ("/usr/local/bin/mp4psp -p $pspdirname/M4V$pspfilname.MP4 -t '$psptrcn[2] $pspcountno $programtitle[0]'") ; 267 246 #2006/12/03_10:30:24 recwrap TRCNSTART vfr4psp.sh /home/foltia/php/tv/591-87-20061203-1000.m2p -591-87-20061203-1000 /home/foltia/php/tv/591.localized/mp4/ 3 247 248 if (($trconqty eq "")||($trconqty == 0 )){ 249 &writelog("recwrap TRCNSTART vfr4psp.sh $recfolderpath/$outputfilename $pspfilname $pspdirname $psptrcn[1]"); 250 system("$toolpath/perl/transcode/vfr4psp.sh $recfolderpath/$outputfilename $pspfilname $pspdirname $psptrcn[1]"); 251 &writelog("recwrap TRCNEND vfr4psp.sh $recfolderpath/$outputfilename $pspfilname $pspdirname $psptrcn[1]"); 252 #最適化 253 $DBQuery = "SELECT subtitle FROM foltia_subtitle WHERE tid = '$tid' AND countno = '$countno' "; 254 $sth = $dbh->prepare($DBQuery); 255 $sth->execute(); 256 @programtitle = $sth->fetchrow_array; 257 if ( $countno == "0" ){ 258 $pspcountno = ""; 259 }else{ 260 $pspcountno = $countno ; 261 } 262 &writelog("recwrap OPTIMIZE mp4psp -p $pspdirname/M4V$pspfilname.MP4 -t '$psptrcn[2] $pspcountno $programtitle[0]' "); 263 Jcode::convert(\$programtitle[0],'euc'); 264 system ("/usr/local/bin/mp4psp -p $pspdirname/M4V$pspfilname.MP4 -t '$psptrcn[2] $pspcountno $programtitle[0]'") ; 265 $mp4filename = "M4V${pspfilname}.MP4"; 266 $thmfilename = "M4V${pspfilname}.THM"; 267 }else{# #2006/12/6 新エンコーダ 268 269 &writelog("recwrap TRCNSTART ipodtranscode.pl $recfolderpath/$outputfilename $pspfilname $pspdirname $pid $psptrcn[1]"); 270 system("$toolpath/perl/ipodtranscode.pl $recfolderpath/$outputfilename $pspfilname $pspdirname $pid $psptrcn[1]"); 271 &writelog("recwrap TRCNEND ipodtranscode.pl $recfolderpath/$outputfilename $pspfilname $pspdirname $psptrcn[1]"); 272 273 if($trconqty >= 2){#H.264/AVCなら 274 $mp4filename = "MAQ${pspfilname}.MP4"; 275 $thmfilename = "MAQ${pspfilname}.THM"; 276 }else{ 277 $mp4filename = "M4V${pspfilname}.MP4"; 278 $thmfilename = "M4V${pspfilname}.THM"; 279 } 280 } 268 281 269 282 #サムネール … … 275 288 &writelog("recwrap THAMI convert -crop 160x120+1+3 -resize 165x126\! $pspdirname/00000002.jpg $pspdirname/M4V$pspdirname.THM "); 276 289 277 if (-e "$pspdirname/ M4V".$pspfilname.".THM"){290 if (-e "$pspdirname/$thmfilename"){ 278 291 $timestamp =`date "+%Y%m%d-%H%M%S"`; 279 292 chomp $timestamp; 280 system("convert -crop 160x120+1+3 -resize 165x126\! $pspdirname/00000002.jpg $pspdirname/ M4V".$pspfilname.".THM.".$timestamp.".THM");293 system("convert -crop 160x120+1+3 -resize 165x126\! $pspdirname/00000002.jpg $pspdirname/$thmfilename".$timestamp.".THM"); 281 294 282 295 }else{ 283 system("convert -crop 160x120+1+3 -resize 165x126\! $pspdirname/00000002.jpg $pspdirname/ M4V".$pspfilname.".THM");296 system("convert -crop 160x120+1+3 -resize 165x126\! $pspdirname/00000002.jpg $pspdirname/$thmfilename"); 284 297 } 285 298 # rm -rf 00000001.jpg … … 293 306 # MP4ファイル名をPIDレコードに書き込み 294 307 $DBQuery = "UPDATE foltia_subtitle SET 295 PSPfilename = ' M4V$pspfilname.MP4'308 PSPfilename = '$mp4filename' 296 309 WHERE pid = '$pid' "; 297 310 $sth = $dbh->prepare($DBQuery); … … 300 313 301 314 # MP4ファイル名をfoltia_mp4files挿入 302 $DBQuery = "insert into foltia_mp4files values ('$tid',' M4V$pspfilname.MP4') ";315 $DBQuery = "insert into foltia_mp4files values ('$tid','$mp4filename') "; 303 316 $sth = $dbh->prepare($DBQuery); 304 317 $sth->execute(); trunk/install/perl/tvrecording.pl
r1 r8 24 24 25 25 26 use Time::HiRes qw(usleep);26 #use Time::HiRes qw(usleep); 27 27 28 28 … … 250 250 } 251 251 #1分前にプロセス起動するから指定時間スリープ 252 srand(time ^ ($$ + ($$ << 15))); 253 my $useconds = int(rand(12000000)); 254 my $intval = int ($useconds / 1000000); 255 my $startupsleeptimemicro = ($startupsleeptime * 1000000) - $useconds; 256 $reclengthsec = $reclengthsec + $intval + 1; 252 #srand(time ^ ($$ + ($$ << 15))); 253 #my $useconds = int(rand(12000000)); 254 #my $intval = int ($useconds / 1000000); 255 #my $startupsleeptimemicro = ($startupsleeptime * 1000000) - $useconds; 256 #$reclengthsec = $reclengthsec + $intval + 1; 257 #&writelog("tvrecording: DEBUG SLEEP $startupsleeptime:$useconds:$intval:$startupsleeptimemicro"); 258 # usleep ( $startupsleeptimemicro ); 259 257 260 # $recch でウェイト調整入れましょう 258 259 260 &writelog("tvrecording: DEBUG SLEEP $startupsleeptime:$useconds:$intval:$startupsleeptimemicro"); 261 262 usleep ( $startupsleeptimemicro ); 261 my $intval = $recch % 50; # 0〜49 262 my $startupsleep = $startupsleeptime - $intval; # 3〜52 (VHF 40-51) 263 $reclengthsec = $reclengthsec + $intval + 1; # 264 265 &writelog("tvrecording: DEBUG SLEEP $startupsleeptime:$intval:$startupsleep"); 266 267 sleep ( $startupsleep); 263 268 264 269 if ($recunits > 1){ trunk/install/php/folcast.php
r1 r8 40 40 $query = " 41 41 SELECT foltia_program.tid,foltia_program.title, 42 foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" ~~ 'M 4V%%' AND foltia_program.tid = foltia_subtitle.tid AND foltia_program.tid = $tid42 foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" ~~ 'M%%' AND foltia_program.tid = foltia_subtitle.tid AND foltia_program.tid = $tid 43 43 ORDER BY \"enddatetime\" DESC 44 44 offset 0 limit $max … … 57 57 $query = " 58 58 SELECT foltia_program.tid,foltia_program.title, 59 foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" ~~ 'M 4V%%' AND foltia_program.tid = foltia_subtitle.tid ORDER BY \"enddatetime\" DESC59 foltia_subtitle.countno , foltia_subtitle.subtitle , foltia_subtitle.startdatetime, foltia_subtitle.pspfilename,foltia_subtitle.lengthmin,foltia_subtitle.enddatetime FROM foltia_subtitle , foltia_program WHERE \"pspfilename\" ~~ 'M%%' AND foltia_program.tid = foltia_subtitle.tid ORDER BY \"enddatetime\" DESC 60 60 offset 0 limit $max 61 61 "; … … 119 119 $mp4thmname = ereg_replace(".MP4", ".THM", $mp4thmname); 120 120 $mp4thmnameuri = "http://". getserverfqdn() . $httpmediamappath ."/$tid.localized/mp4/$mp4thmname"; 121 $mp4filestat = stat("$recfolderpath/$tid.localized/mp4/$mp4filename"); 122 $mp4filesize = $mp4filestat[7]; 121 122 if (file_exists("$recfolderpath/$tid.localized/mp4/$mp4filename")) { 123 $mp4filestat = stat("$recfolderpath/$tid.localized/mp4/$mp4filename"); 124 $mp4filesize = $mp4filestat[7]; 125 } else { 126 $mp4filesize = 0; 127 } 123 128 124 129 if ($rowdata[0] == 0 ){//EPG録画 trunk/install/php/foltia_config2.php.template
r1 r8 17 17 $recfolderpath = '/home/foltia/php/tv'; //録画ファイルの保存先のパス。 18 18 $httpmediamappath = '/tv'; //ブラウザから見える録画ファイルのある位置。 19 $protectmode = 1; //未使用:(ブラウザからの予約削除を禁止するなどの保護モードで動作します)19 $protectmode = 0; //未使用:(ブラウザからの予約削除を禁止するなどの保護モードで動作します) 20 20 $demomode = 0; //未使用:(ユーザインターフェイスだけ動作するデモモードで動作します) 21 21