Index: trunk/install/perl/foltialib.pl =================================================================== --- trunk/install/perl/foltialib.pl (リビジョン 50) +++ trunk/install/perl/foltialib.pl (リビジョン 70) @@ -227,4 +227,34 @@ +sub getphpstyleconfig{ +my $key = $_[0]; +my $phpconfigpath = ""; +my $configline = ""; + # read +if (-e "$phptoolpath/php/foltia_config2.php"){ + $phpconfigpath = "$phptoolpath/php/foltia_config2.php"; +}elsif(-e "$toolpath/php/foltia_config2.php"){ + $phpconfigpath = "$toolpath/php/foltia_config2.php"; +}else{ + $phpconfigpath = `locate foltia_config2.php | head -1`; + chomp($phpconfigpath); +} + + +if (-r $phpconfigpath ){ +open (CONFIG ,"$phpconfigpath") || die "File canot read.$!"; +while(){ + if (/$key/){ + $configline = $_; + $configline =~ s/\/\/.*$//; + $configline =~ s/\/\*.*\*\///; + }else{ + } +} +close(CONFIG); +}#end if -r $phpconfigpath +return ($configline); +}#end sub getphpstyleconfig + 1; Index: trunk/install/perl/envpolicyupdate.pl =================================================================== --- trunk/install/perl/envpolicyupdate.pl (リビジョン 70) +++ trunk/install/perl/envpolicyupdate.pl (リビジョン 70) @@ -0,0 +1,73 @@ +#!/usr/bin/perl +# +# Anime recording system foltia +# http://www.dcc-jpl.com/soft/foltia/ +# +# +# envpolicyupdate.pl +# +# 環境ポリシー利用時に.htpasswdを再編する。 +# +# +# DCC-JPL Japan/foltia project +# +# + +use DBI; +use DBD::Pg; + +$path = $0; +$path =~ s/envpolicyupdate.pl$//i; +if ($pwd ne "./"){ +push( @INC, "$path"); +} + +require "foltialib.pl"; + +# 環境ポリシーを使っているかPHPコンフィグファイル解析 +$returnparam = getphpstyleconfig("useenvironmentpolicy"); +eval "$returnparam\n"; + +if ($useenvironmentpolicy == 1){ +$returnparam = getphpstyleconfig("environmentpolicytoken"); +eval "$returnparam\n"; + + my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d", + $DBDriv,$DBName,$DBHost,$DBPort); + $dbh = DBI->connect($data_source,$DBUser,$DBPass) ||die $DBI::error;; + +$DBQuery = "SELECT userclass,name,passwd1 FROM foltia_envpolicy "; + + $envph = $dbh->prepare($DBQuery); + $envph->execute(); + +#なければつくる +unless (-e "$toolpath/.htpasswd"){ + $oserr = `touch $toolpath/.htpasswd`; +}else{ + $oserr = `mv $toolpath/.htpasswd $toolpath/htpasswd_foltia_old`; + $oserr = `touch $toolpath/.htpasswd`; +} + +while (@ref = $envph->fetchrow_array ){ + +if ($ref[0] == 0){ +#ユーザクラス +#0:特権管理者 +#1:管理者:予約削除、ファイル削除が出来る +#2:利用者:EPG追加、予約追加が出来る +#3:ビュアー:ファイルダウンロードが出来る +#4:ゲスト:インターフェイスが見れる + + $htpasswd = "$ref[2]"; +}else{ + $htpasswd = "$ref[2]"."$environmentpolicytoken"; +} + +$oserr = `htpasswd -b $toolpath/.htpasswd $ref[1] $htpasswd`; + + +}#end while +&writelog("envpolicyupdate htpasswd updated."); + +}#endif Index: trunk/install/perl/foltia_conf1.pl.template =================================================================== --- trunk/install/perl/foltia_conf1.pl.template (リビジョン 8) +++ trunk/install/perl/foltia_conf1.pl.template (リビジョン 70) @@ -25,4 +25,5 @@ #2:iPod H.264 中画質 24fps 300kbps #3:iPod H.264 高画質 30fps 300kbps +$phptoolpath = $toolpath ;#php版の初期設定の位置。デフォルトではperlと同じ位置 #以下はデフォルトでインストールしてればいじらなくてもいい Index: trunk/install/perl/ipodtranscode.pl =================================================================== --- trunk/install/perl/ipodtranscode.pl (リビジョン 62) +++ trunk/install/perl/ipodtranscode.pl (リビジョン 70) @@ -103,12 +103,13 @@ $encodeoption = "-y -i $inputmpeg2 -target ipod -profile 51 -level 30 $cropopt -acodec aac -ab 96 -vcodec h264 -maxrate 700 -minrate 0 -deinterlace -b 300 -ar 32000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 320x240 -r 30000/1001 -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 $movietitle ${mp4outdir}MAQ${mp4filenamestring}.MP4"; $mp4file = "${mp4outdir}MAQ${mp4filenamestring}.MP4"; -}elsif($trconqty == 4){ #sample:src 106.6sec encode 334.8sec x3.14 kbps @Celeron2.6GHz 904kbps -$encodeoption = "-y -i $inputmpeg2 -target ipod -profile 51 -level 30 $cropopt -s 480x320 -b 350 -r 24 -acodec aac -ar 32000 -ac 2 $movietitle ${mp4outdir}MAQ${mp4filenamestring}.MP4"; +}elsif($trconqty == 4){ #sample:src 106.6sec encode 239sec x2.24 1036kbps @Celeron2.6GHz + +$encodeoption = "-y -i $inputmpeg2 -target ipod -profile 51 -level 30 $cropopt -s 480x360 -b 400 -r 24 -acodec aac -ar 32000 -ac 2 $movietitle ${mp4outdir}MAQ${mp4filenamestring}.MP4"; $mp4file = "${mp4outdir}MAQ${mp4filenamestring}.MP4"; -}elsif($trconqty == 5){ #sample:src 106.6sec encode 684.5sec x6.42 kbps @Celeron2.6GHz 667kbps +}elsif($trconqty == 5){ #sample:src 106.6sec encode 1012sec x9.49 727kbps @Celeron2.6GHz -$encodeoption = "-y -i $inputmpeg2 -target ipod -profile 51 -level 30 $cropopt -acodec aac -ab 96 -vcodec h264 -maxrate 700 -minrate 0 -deinterlace -b 350 -ar 32000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 480x320 -r 30000/1001 -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 $movietitle ${mp4outdir}MAQ${mp4filenamestring}.MP4"; +$encodeoption = "-y -i $inputmpeg2 -target ipod -profile 51 -level 30 $cropopt -acodec aac -ab 96 -vcodec h264 -maxrate 700 -minrate 0 -deinterlace -b 400 -ar 32000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 480x360 -r 30000/1001 -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 $movietitle ${mp4outdir}MAQ${mp4filenamestring}.MP4"; $mp4file = "${mp4outdir}MAQ${mp4filenamestring}.MP4"; } Index: trunk/install/perl/recwrap.pl =================================================================== --- trunk/install/perl/recwrap.pl (リビジョン 60) +++ trunk/install/perl/recwrap.pl (リビジョン 70) @@ -278,7 +278,13 @@ # 既にトラコンプロセスが走っているなら適当に待機 if ($trcnprocesses >= $cpucores){ - &writelog("recwrap TRCN WAITING :$trcnprocesses / $cpucores :$outputfilename "); - sleep 53; - sleep $recch; + if (-e "/proc/uptime" ){ + $loadaverage = `uptime`; + chomp($loadaverage); + }else{ + $loadaverage = ""; + } + &writelog("recwrap TRCN WAITING :$trcnprocesses / $cpucores :$outputfilename $loadaverage"); + sleep 113; + sleep ($recch)*5; } } until ($trcnprocesses < $cpucores);