Log in

View Full Version : wmv3 problem with Avisynth


sany
8th November 2005, 18:13
Hi
I know it's not the best introduction to open a thread with my first post but I just couldn't find a thread where I could post my question.
My problem is that my virtualdub mod can't open an avs which is working with an avi file which seems to have been coded in wmv3. At first virtualdub mod couldn't open the avi file it self alone which I wanted to work with but I looked up and dl-ed a codec form microsoft homepage here's the link:http://download.microsoft.com/download/a/0/3/a0398036-25b9-410c-b371-c59957c1b0f4/WM9Codecs.exe so now virtualdub mod can play the file but when I open the .avs file to edit the film it says:Avisynth open failure:AviSource autodetect:couldn't open file Error Code 2
I'm suspecting that Avisynth is having a problem with wmv3 coding but I'm not sure and I'm still new in the job. If anyone could give me a link to a codec that helps my Avisynth(if I'm really only having a codec trouble) I'd be really greatfull or just some advice what I should do.

Here's the script I'm using:
#I wrote video filename instead of the real file name but what comes after "videofilename" is what there is in my avi's filename I'm working with.
video1 = AVISource("D:\Bleach munka\videofilename(640x480_LameVBR_WMV9).[1950D180].avi").ChangeFPS(23.976)
fmrate1 = Framerate(video1)
#missing function in avs 2.5
function isYv12(clip) {
return !(clip.isRGB() || clip.isYuY2())
}
#AutoColorSpace Function
function convertToColorSpace(clip1,clip2) {
clip1 = (clip2.isRGB32() && !clip1.isRGB32()) ? clip1.convertToRGB32(): clip1
clip1 = (clip2.isRGB24() && !clip1.isRGB24()) ? clip1.convertToRGB24(): clip1
clip1 = (clip2.isYUY2() && !clip1.isYUY2()) ? clip1.convertToYuy2(): clip1
clip1 = (clip2.isYV12() && !clip1.isYV12()) ? clip1.convertToYv12(): clip1
return clip1
}
pic = ImageSource("D:\Bleach munka\bleach_logo08 copy.jpg",end = 100,use_DevIL = true).FlipVertical().AssumeFPS(fmrate1).convertToColorSpace(video1)
audio = BlankClip(video1)
pic = AudioDub(pic,audio).FadeOut(15)

#pic ++ video1
killaudio( pic ++ video1)

IanB
9th November 2005, 07:38
Error 2 is ENOENT, or "File not found!" check the spelling of your filename argument.

sany
9th November 2005, 09:46
OK I checked it out and it's what it should be. In the mean time I came up with a temporary solution. I reencoded my avi in Xvid and currently I'm working with the reencoded file and now I can open the avs script I'm using if I give the reencoded file as video source. Altough I don't think this is the best solution and this way I have to encode plus one hour long. Luckily the quality of the video didn't drop too much because of the double encoding (or I'm so lame that I didn't notice it :D ). Anyway if somebody could come up with anything better (advice/link) as to where I should be checking I'd still be greatfull.

IanB
9th November 2005, 12:34
#missing function in avs 2.5
function isYv12(clip) {
return !(clip.isRGB() || clip.isYuY2())
}What version of AviSynth are you running? IsYV12() was added May 15, 2003. If it is not at least 2.5.5 get the lastest released version 2.5.6

In the current version, the partial error message you quoted comes from the following piece of code. We just preopen the file and take a quick peek to see if it openDML, nothing to do with avi or codecs, just open it and read it. :-HANDLE h = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (h == INVALID_HANDLE_VALUE) {
env->ThrowError("AVISource autodetect: couldn't open file '%s'\nError code: %d", filename, GetLastError());
}Part of the message is the actual filename the internals passed to the open system call, check it carefully.

Also try renaming your file to something really simple like D:\Fred.avi just in case something weird is happening, like with unprintable chars, code pages or foreign character sets.

sany
10th November 2005, 13:42
Thanks for the help now everything is working fine. :thanks: