Skip to content

Instantly share code, notes, and snippets.

@shiwork
Created June 16, 2013 17:45
Show Gist options
  • Save shiwork/5792795 to your computer and use it in GitHub Desktop.
Save shiwork/5792795 to your computer and use it in GitHub Desktop.
foltia ANIME LOCKERでTSの保存拡張子をtsに変更する差分 foltia ANIME LOCKER v3.0.2
diff --git a/perl/captureimagemaker.pl b/perl/captureimagemaker.pl
index 384e979..47a6d4d 100755
--- a/perl/captureimagemaker.pl
+++ b/perl/captureimagemaker.pl
@@ -117,7 +117,7 @@ unless (-e $capimgdirname ){
# キャプチャ入れるディレクトリ作成
# $captureimgdir = "$tid"."-"."$countno"."-"."$date"."-"."$time";
$captureimgdir = $filename;
-$captureimgdir =~ s/\.m2p$|\.m2t$|\.m2v$//;
+$captureimgdir =~ s/\.m2p$|\.m2t$|\.ts$|\.m2v$//;
unless (-e "$capimgdirname/$captureimgdir"){
mkdir "$capimgdirname/$captureimgdir" ,0777;
@@ -134,7 +134,7 @@ unless (-e "$capimgdirname/$captureimgdir"){
# ETVとか黒線入るから左右、もうすこしづつ切ろう。
#system ("mplayer -ss 00:00:10 -vo jpeg:outdir=$capimgdirname/$captureimgdir/ -vf crop=690:460:12:10,scale=160:120 -ao null -sstep 14 -v 3 $recfolderpath/$filename");
-if ($filename =~ /m2t$|m2v$/){
+if ($filename =~ /m2t$|m2v$|ts$/){
&writelog("captureimagemaker DEBUG ffmpeg -ss 20 -i $recfolderpath/$filename -r 0.1 -s 192x108 -f image2 -vcodec mjpeg $capimgdirname/$captureimgdir/%08d.jpg");
system ("nice -n 15 ffmpeg -ss 20 -i $recfolderpath/$filename -r 0.1 -s 192x108 -f image2 -vcodec mjpeg $capimgdirname/$captureimgdir/%08d.jpg");
}
diff --git a/perl/deletemovie.pl b/perl/deletemovie.pl
index ae72356..f6c8927 100755
--- a/perl/deletemovie.pl
+++ b/perl/deletemovie.pl
@@ -36,7 +36,7 @@ if ($fname eq "" ){
}
#ファイル名正当性チェック
-if ($fname =~ /.m2p$|.m2t$|.MP4$|.aac$/){
+if ($fname =~ /.m2p$|.m2t$|.ts$|.MP4$|.aac$/){
}else{
# print "deletemovie invalid filetype.\n";
diff --git a/perl/digitaltvrecording.pl b/perl/digitaltvrecording.pl
index 14577a8..db52333 100755
--- a/perl/digitaltvrecording.pl
+++ b/perl/digitaltvrecording.pl
@@ -39,6 +39,11 @@ $extendrecendsec = 10; #recording end second. 尻尾10秒
$startupsleeptime = 32; #process wait(MAX60sec)
#-------------------------------
+### CONFIG ###
+$file_extension = "ts";
+#$file_extension = "m2t";
+### END ###
+
require 'foltialib.pl';
#DB接続
$dbh = DBI->connect($DSN,$DBUser,$DBPass) ||die $DBI::error;;
@@ -127,7 +132,7 @@ if ($countno eq "0"){
}else{
$outputfile .= strftime("%Y%m%d-%H%M", localtime(time + 60));
chomp($outputfile);
- $outputfile .= ".m2t";
+ $outputfile .= $file_extension;
$outputfilewithoutpath = $outputfile ;
&writelog("digitaltvrecording: DEBUG FILENAME is null \$outputfile $outputfile ");
}
@@ -399,7 +404,7 @@ if ($bssplitflag == 101){
# BS1
system("wine $toolpath/perl/tool/TsSplitter.exe -EIT -ECM -EMM -OUT \"$outputpath\" -HD -SD2 -SD3 -1SEG -LOGFILE -WAIT2 $outputfile");
$splitfile = $outputfile;
- $splitfile =~ s/\.m2t$/_SD1.m2t/;
+ $splitfile =~ s/\.m2t$|\.ts$/_SD1.m2t/;
if (-e "$splitfile"){
system("rm -rf $outputfile ; mv $splitfile $outputfile");
&writelog("digitaltvrecording DEBUG rm -rf $outputfile ; mv $splitfile $outputfile: $?.");
@@ -414,7 +419,7 @@ if ($bssplitflag == 101){
# BS2
system("wine $toolpath/perl/tool/TsSplitter.exe -EIT -ECM -EMM -OUT \"$outputpath\" -HD -SD1 -SD3 -1SEG -LOGFILE -WAIT2 $outputfile");
$splitfile = $outputfile;
- $splitfile =~ s/\.m2t$/_SD2.m2t/;
+ $splitfile =~ s/\.m2t$|\.ts$/_SD2.m2t/;
if (-e "$splitfile"){
system("rm -rf $outputfile ; mv $splitfile $outputfile");
&writelog("digitaltvrecording DEBUG rm -rf $outputfile ; mv $splitfile $outputfile: $?.");
diff --git a/perl/ipodtranscode.pl b/perl/ipodtranscode.pl
index d7ac92a..03d2afa 100755
--- a/perl/ipodtranscode.pl
+++ b/perl/ipodtranscode.pl
@@ -684,7 +684,7 @@ my $thmfilename = "MAQ${mp4filenamestring}.THM";
#system ("mplayer -ss 00:01:20 -vo jpeg:outdir=$pspdirname -ao null -sstep 1 -frames 3 -v 3 $outputfilename");
#
#&writelog("ipodtranscode DEBUG mplayer -ss 00:01:20 -vo jpeg:outdir=$pspdirname -ao null -sstep 1 -frames 3 -v 3 $outputfilename");
-if($outputfilename =~ /.m2t$|.m2v$/){
+if($outputfilename =~ /.m2t$|.m2v$|.ts$/){
#ハイビジョンTS
system ("mplayer -ss 00:01:20 -vo jpeg:outdir=$pspdirname -ao null -vf framestep=300step,scale=160:90,expand=160:120 -frames 1 $outputfilename");
&writelog("ipodtranscode DEBUG mplayer -ss 00:01:20 -vo jpeg:outdir=$pspdirname -ao null -vf framestep=300step,scale=160:90,expand=160:120 -frames 1 $outputfilename");
diff --git a/perl/recwrap.pl b/perl/recwrap.pl
index c8aaf61..28b591e 100755
--- a/perl/recwrap.pl
+++ b/perl/recwrap.pl
@@ -65,7 +65,8 @@ if ($conf{'productkey'} eq ""){
if ($usedigital == 1){
- $extension = ".m2t";#TSの拡張子
+ #$extension = ".m2t";#TSの拡張子
+ $extension = ".ts";#TSの拡張子
}else{
$extension = ".m2p";#MPEG2の拡張子
}
@@ -271,8 +272,8 @@ $now = time();
&writelog("recwrap retry recording $now $starttime");
#アナログ録画
$starttime = time();
-if($outputfilename =~ /.m2t$/){
- $outputfilename =~ s/.m2t$/.m2p/;
+if($outputfilename =~ /.m2t$|\.ts$/){
+ $outputfilename =~ s/.m2t$|\.ts$/.m2p/;
}
$oserr = system("$toolpath/perl/tvrecording.pl $recch $reclength N $outputfilename $bitrate $tid $countno");
$now = time();
@@ -477,7 +478,7 @@ foreach $pid (@pid){
my @lsofoutput = `/usr/sbin/lsof -p $pid`;
my $filename = "";
foreach (@lsofoutput){
- if (/m2t/){
+ if (/m2t|ts/){
@processline = split(/\s+/,$_);
$filename = $processline[8];
$filename =~ s/$recfolderpath\///;
diff --git a/php/setup/emptytrash.php b/php/setup/emptytrash.php
index bb396a9..6d43651 100644
--- a/php/setup/emptytrash.php
+++ b/php/setup/emptytrash.php
@@ -138,7 +138,7 @@ print "<ul>\n";
//キーワード録画用にfoltia_keywordlibfilesに追加
addfoltia_keywordlibfiles($con,$tid[0],$keywordrestoresqltarget,$ufname[0]);
- } elseif($ext[0] === 'm2t' || $ext[0] === 'aac'){
+ } elseif($ext[0] === 'ts' || $ext[0] === 'm2t' || $ext[0] === 'aac'){
//ファイル移動
rename("$trashpath/$ufname[0]", "$m2precfolderpath/$ufname[0]");
writelog ("emptytrash.php DEBUG $trashpath/$ufname[0] -> $m2precfolderpath/$ufname[0]");
@@ -177,6 +177,7 @@ print '<input type="button" value="戻る" onClick="location=\'emptytrash.php\'"
$oserr3 = system("nice -n 18 rm -rf $trashpath/*.aac > /dev/null &");
$oserr1 = system("nice -n 18 rm -rf $trashpath/*.MP4 > /dev/null &");
$oserr2 = system("nice -n 18 rm -rf $trashpath/*.m2t > /dev/null &");
+ $oserr2 = system("nice -n 18 rm -rf $trashpath/*.ts > /dev/null &");
closedir($handle);
print '<input type="button" value="戻る" onClick="location=\'emptytrash.php\'">';
@@ -220,7 +221,7 @@ $res_dir = opendir( $trashpath );
//ディレクトリ内のファイル一覧を取得
while( $entry = readdir( $res_dir ) ){
//詳細情報抽出用SQL
- if(preg_match('/.MP4/',$entry) || preg_match('/.m2t/',$entry) || preg_match('/.aac/',$entry) || preg_match('/.m2p/',$entry)){
+ if(preg_match('/.MP4/',$entry) || preg_match('/.m2t/',$entry) || preg_match('/.ts/',$entry) || preg_match('/.aac/',$entry) || preg_match('/.m2p/',$entry)){
//mp4file版query
if(preg_match('/.MP4/',$entry)){
if(preg_match('/MHD/',$entry)){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment