Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
12th August 2006, 00:47 | #1 | Link |
Registered User
Join Date: Feb 2004
Posts: 23
|
writefile not working?
writefilestart works for me, but the other writefile functions do not work. By "do not work", I mean that a text file gets created but nothing gets written into the file. I have tried doing "Scan video for errors", playing the whole clip through, even compressing it.
Examples that do not work: Code:
filename = "test.txt" clip = blankclip() writefile(clip, filename, "current_frame", append=true, flush=true) Code:
filename = "test.txt" clip = blankclip() writefileend(clip, filename, """ "goodbye" """, append=true) Code:
filename = "test.txt" clip = blankclip() writefileif(clip, filename, "I CAN PUT ANYTHING HERE AND I GET NO ERRORS OR COMPLAINTS AT ALL", "current_frame") Example of what works: Code:
filename = "test.txt" clip = blankclip() writefilestart(clip, filename, """ "hello" """) I sense I might be doing something fundamentally wrong.. but, even with the simplest case of writefileend, it doesn't work, while writefilestart does. Anyone experiencing these problems? Last edited by wuziq; 12th August 2006 at 00:51. |
14th August 2006, 06:49 | #3 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
dunno, it seems to work for me with this script:
Code:
angle1=mpeg2source^("%~dpn1.d2v",idct=7,cpu=0^) angle2=mpeg2source^("%~dpn2.d2v",idct=7,cpu=0^) mt_lutxy^(angle1,angle2,expr="x y - abs",y=3^) WriteFileIf^(last, "%~dp1\differences.txt", "yplanemax(.5) > 16", "current_frame", """ ":" """, "yplanemax(.5)"^)
__________________
sucking the life out of your videos since 2004 |
14th August 2006, 16:53 | #4 | Link |
Registered User
Join Date: Feb 2004
Posts: 23
|
yeah it is really weird, and frustrating. originally i was doing it over a network folder, which didn't work.. but i did the same thing on a local drive, and still no go. and you're right, it's not a permissions thing because i have full access to the drives.. and yeah, the text file IS being created, it's just nothing is getting written into it (with the exception of when i use writefilestart). anyway, thanks for trying it out.. if anyone else has any ideas, i'd really appreciate it. thanks
|
15th August 2006, 01:18 | #6 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
When it's outside the processing chain, as far as avisynth is concerned it doesn't exist (mostly...). Anything that inserts it will work. Something as simple as:
Code:
Avisource("...") clip=Blankclip() clip=clip.writefile(clip, filename, "current_frame", append=true, flush=true) #this will still return avisource at this point and ignore clip MergeChroma(clip).MergeChroma(last) #now it will process clip (I never knew about the flush=true, I thought you always had to close first... I guess sometimes I need to rtfm too. ) |
12th September 2012, 15:53 | #7 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
Just to give some closure to this old thread...
I ran into this exact problem and it wasn't due to the clip not being rendered as described here. It was simply that WriteFile() and its variants do not work in Avisynth 2.57. Everything is fine in 2.58 and beyond. That, at least, is my experience. |
12th September 2012, 23:16 | #10 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
The problem was to do with the flush option, relative paths and changing CWD. The significant change was at line 332 in the diff of conditional_reader.cpp 1.9 to 1.10. The other changes to show the "filename" in play made what was happening obvious.
|
25th November 2012, 23:04 | #12 | Link | |
Registered User
Join Date: Apr 2010
Posts: 175
|
Same problem here, using avisynth ver 2.58
Quote:
The version() example works |
|
25th November 2012, 23:31 | #13 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
See http://avisynth.org/mediawiki/WriteFile
Quote:
You need to change the Writefile() line to oo = oo.WriteFile(filename, "current_frame") Last edited by Gavino; 25th November 2012 at 23:37. |
|
26th November 2012, 10:01 | #14 | Link | |
Registered User
Join Date: Apr 2010
Posts: 175
|
Ok.... i past only 2 hours on that.
However the headers are printed, which is leading to some confusion... "oo = oo.WriteFile(filename, "current_frame") " I didn't want to do that because the output in my mind was a log file, not a clip... Ok the result is assigned to last... not to oo ! this is specific to avisynth syntax, that the result name can differ from the input name. Edit : Hurray ! this is the proof : Quote:
Last edited by lisztfr9; 26th November 2012 at 10:06. |
|
26th November 2012, 10:21 | #15 | Link | ||
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
They generate output only on script opening and closure respectively, not for each frame rendered. So they will produce output even if the filter itself does not deliver any frames to the final script result. Quote:
SomeFilter(c) does not change the value of c. Instead, it is equivalent to last = SomeFilter(c) If you want the result to be assigned to c, you need to do it explicitly: c = SomeFilter(c) See http://avisynth.org/mediawiki/Grammar. Last edited by Gavino; 26th November 2012 at 10:24. |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|