New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AvisynthNeo-r2822におけるAutoVfrのログ出力について #2
Comments
Neoでは、ランタイムスクリプト系の挙動が変更されています。GRunTのlocal=true相当の挙動になっているので、local=false前提で書かれたスクリプトは動きません。 なぜこの変更をしたかと言うと、以下のスクリプトで3と表示される挙動が許せなかったからです。
AutoVfrについては、Neo用に書き換えたバージョンを使っていただくか、WriteFileのところを自分でfunction使って書き換えるかしてください。 |
早速回答いただきありがとうございます。 頂いたAvisynthNeo対応版Auto_Vfr.avsを試してみたところ、一応正常にログが出力できました。 avs2pipemod[error]: Write: File 'C:\work\tmp\tmp\AutoVFR_log_temp.txt' cannot be opened. ※line 190: WriteFileStart(file, "str_total", append=false) 上記の例ですと、いつもは"C:\work"をカレントディレクトリにした状態で Auto_VFR(".\tmp\AutoVFR_log_temp1.txt", cut=1, number=1, cthresh=80, mi=60, blockx=16, blocky=32, chroma=false, IsCrop=true, crop_height=136, IsTop=false, IsBottom=true, show_crop=false) お手数ですが、修正いただけますと助かります。 以上、よろしくお願いします。 |
ダウンロードできるページは作っていませんが、Amatsukazeからダウンロードできるようになっています。公開ツールと考えて問題ありません。
相対パスの起点が、ランタイムスクリプト内と通常とで異なるので、挙動が変わったものと思います。avisynthでは通常、avsファイルのある場所を相対パスの起点とします。ただし、ScriptClip等のランタイムスクリプト内では、プロセスのカレントディレクトリが相対パスの起点になります。仕様が一貫していないのは、多分、実装上の都合でしょう。 今回の場合、avsファイルは AutoVfrの元のバージョンは、ScriptClipを使っているので、相対パスの起点がプロセスのカレントディレクトリとなり、Neo対応版と挙動が異なりますが、Neo対応版は元のAutoVfrと挙動が完全一致することを目指しているわけではないので、修正しないこととします。
そのリンク先からダウンロードできなくなっていたので、入手できませんでした。もし、ver0.1.1.1をお持ちでしたら、私がver0.1.1.1を同梱できるように、どこかに上げていただけると助かります。 |
ここについて少し補足。ScriptClipからWriteFileすると、フレームごとにファイルを開く操作が入るので遅くなります。Neo対応版では、ScriptClipを使っていません。1度ファイルを開くだけなので、速くなっています。1並列だと、あまり変わらないかもしれませんが、複数並列(4並列とか6並列)で実行すると結構変わるようです。 |
回答ありがとうございます。
論理CPU数まで並列化しても遅いと感じていたので助かります。 ver0.1.1.1についてはこちらで公開されています。 ちなみに… 以上、よろしくお願いします。 |
こんにちは、よろしくお願いします。
AviSynth CUDA Filters関係を使ってみたいと思い
Avisynth2.6.0(32bit) -> AvisynthNeo-r2822(32bit) に変更してみたのですが、
AutoVfrのログが正しく出力されない症状が発生しました。
(Avisynth2.6.0時点では正常に処理されていたスクリプトです)
スクリプト中でプラグイン読み込みエラーや書式エラーは発生していません。
またAvsPModNeoのプレビューなどでも特におかしな挙動はありませんでした。
何かお分かりになりますでしょうか?
AutoVFR_log_temp.avs: スクリプトファイル本体
AutoVFR_log_temp1.txt: AutoVfrの出力先ログファイル
AutoVFR_log_temp.avs
※LoadPlugin関係省略
function Auto_VFR(clip c,string file,int "cut",int "number"
,int "cthresh",int "mi", bool "chroma", int "blockx", int "blocky"
,bool "IsCrop",int "crop_height",bool "IsTop",bool "IsBottom",bool "show_crop"
,bool "IsDup",int "thr_m",float "thr_luma"){
h=c.height()
count=c.framecount()
dwc=c.DoubleWeave()
dcount=dwc.framecount()
Iscut=Defined(cut)?true:false
Isnumber=Defined(number)?true:false
Assert(Iscut==Isnumber,"specify 'cut' and 'number'")
start=Isnumber?int(dcount*float(float(number-1)/float(cut))):0
end=Isnumber?int((dcount *float(float(number)/float(cut))))-1:0
dwc=Iscut?dwc.Trim(start,end):dwc
HDsize=720
IsDup=default(IsDup,false)
cthresh_default=(IsDup==true)?7:(h>=HDsize)?9:7
mi_default=(IsDup==true)?50:(h>=HDsize)?80:50
blocks_default=(h>=HDsize)?16:32
cthresh=default(cthresh,cthresh_default)
mi=default(mi,mi_default)
chroma=default(chroma,false)
blockx=default(blockx,16)
blocky=default(blocky,blocks_default)
crop_height=default(crop_height,(h==HDsize)?280:120)
mod=(IsYV12(c)==true)?4:2
Assert((h-crop_height)%mod==0,"crop_height is invalid.")
IsCrop=default(IsCrop,false)
IsTop=default(IsTop,false)
IsBottom=default(IsBottom,true)
show_crop=Default(show_crop,false)
thr_m=default(thr_m,10)
thr_luma=default(thr_luma,0.010)
int_t=( IsCrop==true && IsTop==true)?crop_height:0
int_b=( IsCrop==true && IsBottom==true)?crop_height:0
ScriptClip(dwc,"""
prg="0"
cmb="1"
start="""+string(start)+"""
count="""+string(count)+"""
dcount="""+string(dcount)+"""
file=""""+file+""""
cth="""+string(cthresh)+"""
mi="""+string(mi)+"""
chrm="""+string(chroma)+"""
bx="""+string(blockx)+"""
by="""+string(blocky)+"""
int_t="""+string(int_t)+"""
int_b="""+string(int_b)+"""
show="""+string(show_crop)+"""
isDup="""+string(IsDup)+"""
thr_m="""+string(thr_m)+"""
thr_luma="""+string(thr_luma)+"""
crnt=current_frame+start
str_num=string(crnt)
str_line=string("-")
str_total=(start==0)?string("total_f-")+string(count):""
str_dtotal=string("doubleweave_f-")+string(dcount)
(current_frame==0)?WriteFile(last,file,"str_total",append=false):nop
(crnt==0)?WriteFile(last,file,"str_dtotal",append=true):nop
str_main=(IsCombedTIVTC(last,
\cthresh=cth,MI=mi,chroma=chrm,blockx=bx,blocky=by)==true)?cmb:prg
str_crop=(int_t>0 || int_b>0)?(IsCombedTIVTC(last.crop(0,int_t,0,-int_b),
\cthresh=cth,MI=mi,chroma=chrm,blockx=bx,blocky=by)==true)?cmb:prg
:str_main
str_motion=(isDup==true && crnt%2 == 0)?
(Interleave(SelectEven().mt_motion(thY2=thr_m),SelectOdd()).AverageLuma() >thr_luma)?cmb:prg
:prg
result=str_num+str_line+str_main+str_line+str_crop+str_line+str_motion
(show==false)?WriteFile(last,file,"string(result)",append=true,flush=false):last
""")
return (show_crop==true)?last.crop(0,int_t,0,-int_b):last
}
MPEG2VIDEO("C\src\clip.ts")
clip0.AssumeTFF()
Trim(598,951)
Auto_VFR("C:\temp\AutoVFR_log_temp1.txt", cut=1, number=1, cthresh=80, mi=60, blockx=16, blocky=32, chroma=false, IsCrop=true, crop_height=136, IsTop=false, IsBottom=true, show_crop=false)
AutoVFR_log_temp1.txt
I don't know what 'str_total' means.
I don't know what 'str_dtotal' means.
I don't know what 'str_total' means.
I don't know what 'str_dtotal' means.
I don't know what 'str_total' means.
I don't know what 'str_dtotal' means.
I don't know what 'result' means.
I don't know what 'result' means.
I don't know what 'result' means.
I don't know what 'result' means.
I don't know what 'result' means.
I don't know what 'result' means.
(以下繰り返し、略)
以上、よろしくお願いします。
The text was updated successfully, but these errors were encountered: