PDA

View Full Version : writefile not working?


wuziq
12th August 2006, 01:47
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:


filename = "test.txt"
clip = blankclip()
writefile(clip, filename, "current_frame", append=true, flush=true)



filename = "test.txt"
clip = blankclip()
writefileend(clip, filename, """ "goodbye" """, append=true)



filename = "test.txt"
clip = blankclip()
writefileif(clip, filename, "I CAN PUT ANYTHING HERE AND I GET NO ERRORS OR COMPLAINTS AT ALL", "current_frame")


Do I need to do anything in particular to get them to work?


Example of what works:


filename = "test.txt"
clip = blankclip()
writefilestart(clip, filename, """ "hello" """)


I am using AviSynth v2.5.6, WinXP.. I tried both vdub and vdubmod.. any other info that I need to put here, let me know.

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?

wuziq
14th August 2006, 07:28
bump.. any ideas, anyone? :confused:

Mug Funky
14th August 2006, 07:49
dunno, it seems to work for me with this script:

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)"^)

perhaps there's some weird permissions going on in the folder you're writing to? probably not seeing as a file is being created.

wuziq
14th August 2006, 17:53
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 :)

wuziq
15th August 2006, 01:18
i think i figured out my problem.

it's not possible to use writefile on a clip that is not the final returned clip, correct? IS there a way for that to work?

foxyshadis
15th August 2006, 02:18
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:

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

should do the trick.

(I never knew about the flush=true, I thought you always had to close first... I guess sometimes I need to rtfm too. ;))