Log in

View Full Version : Evil AVS Script Hates Me - Read All About It!


kalorx
16th July 2005, 22:55
(First let me say that I have installed AviSynth 2.5.6 Beta4 on my PC using an automatic installer -- nothing manual about it. No way to screw up.)

I have here an AVS script. I've modified it some eight different times, but to no effect. Here's the code:


LoadPlugin("D:\Rips1\MPEG2Dec3.dll")
LoadPlugin("D:\Rips1\Decomb521.dll")
mpeg2source("D:\Rips1\PROJECT.d2v")
FieldDeinterlace()
LanczosResize(640,360)
ConvertToYV12()


If I try to open it in VirtualDub 1.6.9, it just flashes me an error message, either saying that one of my plugins isn't a valid AviSynth plugin (and they are), or it refuses to open my d2v file. Hell, it always seems to refuse my AVIs, too.

If I try to open it in x264 (the one I really want to open it in), I get a message saying that my input is of an unsupported format (DIB), and that it could not open the AVS file. In that order.

The source video is a DVD backup, in case that makes any difference.

Any help would be greatly appreciated.

Thanks,

Robert Aronson (KalorX)

Wilbert
16th July 2005, 23:11
1) What AviSynth version are you using?

2) Does

LoadPlugin("D:\Rips1\MPEG2Dec3.dll")
mpeg2source("D:\Rips1\PROJECT.d2v")

work?

If not what dvd2avi and what mpeg2dec3 version did you use?

mg262
16th July 2005, 23:11
You probably tried some or most of these but for what it's worth, some suggestions...

Is that the minimal script producing an error? Have you tried commenting out some or all of these three lines and seeing if it still screws up:

FieldDeinterlace()
LanczosResize(640,360)
ConvertToYV12()

Similarly might be worth commenting out the second plug-in. Also try emptying your auto-load plug-ins directory and seeing if that helps.

I take it you've checked that the version of ...index that produced the d2v file is the same as the version of the mpeg2source that you are using? I would recommend using the latest DGIndex/decode/etc. versions rather than MPEG2Dec3.dll .

>Hell, it always seems to refuse my AVIs, too.
That suggests there is a problem with VirtualDub rather than/as well as whatever problems you have with avisynth. Maybe try opening scripts with a few media players and the preview inside avsedit?

Abond
17th July 2005, 11:28
Try with avisynth 2.5.5

Seed
17th July 2005, 18:59
LoadPlugin("D:\Rips1\MPEG2Dec3.dll")
LoadPlugin("D:\Rips1\Decomb521.dll")
mpeg2source("D:\Rips1\PROJECT.d2v")
...
ConvertToYV12()

1) Since mpeg2 is in YV12 format (and I believe MPEG2Dec3.dll keeps as YV12), why ConvertToYV12()?

2) Have you installed a codec capable of decoding YV12. e.g. DivX, Xvid, ffdshow?

kalorx
17th July 2005, 23:19
Sorry it's taking me so long to properly reply... it's my job... I'll post the results of your suggestions and the answers to your questions when I get a moment to work on this.

Just please don't forget about this post! It shouldn't be more than another day or two! :scared:

kalorx
18th July 2005, 17:28
What AviSynth version are you using?

2.5.6B4 as I said in my first post.

Does [only trying to open the d2v] work?

Nope. VirtualDub won't open the file, saying that it can't open the "MPEG2 source." AVSEdit is not going on my system, because it requires that the .NET Framework be installed. Microsoft can go set themselves on fire along with their supposed "updates".

If not what dvd2avi and what mpeg2dec3 version did you use?

I used DGMPGDec (DGIndex) 1.4.0 and as for mpeg2dec3, 1.1.0.

I take it you've checked that the version of ...index that produced the d2v file is the same as the version of the mpeg2source that you are using? I would recommend using the latest DGIndex/decode/etc. versions rather than MPEG2Dec3.dll.

I have no clue what you're talking about. Please expand. I used DGIndex 1.4.0 to create the D2V file, and then tried to use mpeg2dec3 1.1.0 as a plugin to open the D2V file within AviSynth. How would I have used DGIndex to open the D2V file within AviSynth??

Try with avisynth 2.5.5

I will if absolutely nothing at all works.

Since mpeg2 is in YV12 format (and I believe MPEG2Dec3.dll keeps as YV12), why ConvertToYV12()?

I had people telling me to include that line, so I did.

Have you installed a codec capable of decoding YV12. e.g. DivX, Xvid, ffdshow?

I have all three of those and Helix 1.2 installed.

mg262
18th July 2005, 17:44
I have no clue what you're talking about. Please expand. I used DGIndex 1.4.0 to create the D2V file, and then tried to use mpeg2dec3 1.1.0 as a plugin to open the D2V file within AviSynth. How would I have used DGIndex to open the D2V file within AviSynth?? I think you will need to remove mpeg2dec3 from your plug-ins directory (and preferably from your system completely) and replace it with DGDecode.dll, which (like DGIndex) comes as part of the DGMPGDec package. You can get the whole package here:

http://neuron2.net/dgmpgdec/dgmpgdec.html

... just grab the latest 'executables' and unzip it. Also worth reading the whole of the page I link to and then perhaps the manual inside the zip file.

HTH,

M.

kalorx
18th July 2005, 19:06
Okay, using DGDecode.dll I can now open the AVS file in VirtualDub, but x264 still won't read it.

mg262
18th July 2005, 19:25
It may be that this is now an x264 issue. Could you try saving a small chunk of the AVS (using VirtualDub or VirtualDubMod) in

a) Direct stream copy
b) Fast recompress to a lossless codec YV12 codec (like FFdshows FFV1 set to YV12)

and opening those in x264?

Also please post the exact error message.

kalorx
18th July 2005, 19:42
I fast compressed one minute of video using the Helix YV12 codec. x264 still won't open the file. No matter what I have ever input into x264, it gives me the following error message:

avis [error]: unsupported input format (DIB )
could not open input file '\input.avs'

...and input.avs is indeed in the same directory as x264.exe. However, x264.exe and all of this isn't in the C:\Program Files\x264 directory -- would that make a difference? I suppose it could... but there were no other files in the x264 directory except a GUI and uninstall EXE. Could be a DLL issue or some-such.

mg262
18th July 2005, 20:03
If you're having trouble opening .AVI files, then you're not facing an AVISynth problem... or at least, from your error message it looks like x264 might be using AVISynth internally, but I still think you're more likely to find the answer on a subforum dealing with x264.

By the way, can I ask where you got the impression that you should use mpeg2dec3 1.1.0 and/or the DLL itself? It's possibly something that should be flags/modified to make sure it doesn't mislead anyone else...

kalorx
18th July 2005, 22:25
Doom9 himself in another post told me to use mpeg2dec.dll -- or, at least, the guides he to which he himself pointed me advised the DLL's use. Actually, if I remember correctly, the example AviSynth code he gave me employed mpeg2dec.dll. The reason he advised me to use mpeg2dec was so I could let go of VFAPI, bypassing TMPG and all the like, and cut a bunch of steps out of the ripping process simply by outputting DGIndex straight to AviSynth. I'm also quite sure he knew about the colorspace issue, as the post mostly talked out that.

While doing a little research on the forum, I learned that mpeg2dec3 was good to use in YV12 cases (or that's what I got out of what I read at any rate). I don't remember where I found that.

And I know of no sub-forum for x264. Of course, I say this without performing a thorough search... but nothing comes to mind. I already have a post titled "x264 Command Line Won't Open AVS Input" under the MPEG-4 AVC sub-forum, where Doom9 and others and I had a little chat about this, coming to no solution.

Wilbert
18th July 2005, 23:59
@kalorx,

Like mg262 says, it's not an AviSynth problem. If it is able to encode your avi, it should also be able to encode the script


# dgdecode+dgindex
mpeg2source("D:\Rips1\PROJECT.d2v")
FieldDeinterlace()
LanczosResize(640,360)


So, first you need to find out why x264.exe can't open your avi files. Btw, what kind of codec is used in the avi you tried (XviD, DivX5, something else)?

edit: i didn't test it, but VFAPI AVI file or a Huffyuv AVI might not work because it doesn't output YV12. So, try to encode a XviD/DivX5 avi.

kalorx
19th July 2005, 00:22
I encoded a Helix YV12 AVI from the original YV12 DVD/MPEG2 source material.

kalorx
19th July 2005, 16:12
Oh, here we go again... no one knows how to fix this. I wish I would stop encountering unsolvable problems...

Wilbert
19th July 2005, 16:23
I see that AMED has the same problem. I guess DIB is some sort of codec? Perhaps someone knows?

Anyway, try the following. Look up the name of the helix codec (say helix.dll; not sure) and add the following in to registry

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]
"VIDC.YV12"="helix.dll"

This means that helix will be used to open your YV12 stuff. Does that help?

Nic
19th July 2005, 16:30
DIB stands for Device Independent Bitmap. It's a windows term mainly. Probably means AviSynth is throwing up an error and returning it in RGB.

The problem probably stems from using MPEG2Dec3. Use:
http://neuron2.net/dgmpgdec/dgmpgdec.html
And use DGIndex to create your d2v and then DGDecode.dll instead of mpeg2dec3.dll. Mpeg2dec is obselete now.

That will probably fix things. You will still need a YV12 codec to allow YV12 over VFW, but you probably already have a codec capable of supporting that (such as DivX, XviD, etc)

-Nic

kalorx
19th July 2005, 17:30
Um, Nic, I've said repeatedly over this post that I created the D2V using DGIndex. I also clarified that I was no longer using mpeg2dec, but rather DGDecode. And it fixed nothing. I don't mean to sound snappy, I'm just a little fried at this point...

As for the regedit idea, I know that won't work, because I have no such DLL on my system (despite having Helix installed via auto install). This was the DLL already being used for that purpose: yv12vfw.dll.

EDIT: I also just tried using AviSynth 2.5.5RC3. No luck.

mg262
19th July 2005, 17:39
Oh, here we go again... no one knows how to fix this. I wish I would stop encountering unsolvable problems...@kalorx,

Your problem was a combination of an AVISynth related problem and a non-AVISynth problem. The AVISynth bit has been dealt with and you will almost certainly be able to find help on the rest if you go back to a forum appropriate for x264, state the problem very clearly, and make it obvious that you have made some effort to solve it yourself, for example by making a clear list of everything you have tried. I would suggest leaving aside AVISynth and .avs files until you have the problem fixed; create a reference AVI in a YV12 format and quote error messages relating to that file rather than to .AVS scripts (which just confuse the issue).

Edit:
I have also just looked at your original thread, and it wasn't quite a case of no one knowing how to fix it:A lot of your questions could've answered with a little more reading up so I'm stopping here now giving you some time to read up. Change does require a certain amount of learning.It can be quite hard to know where to start learning these things, but the FAQs of all the relevant forums are a good place to start. For example, the DVD2AVI/DGIndex forum FAQ contains information about which DLL version you should be using. I'm speaking in a very abstract sense because x264 isn't something I've used; but if you do make the effort to read through all its documentation and the main threads relating to it, and make it clear that you have done that, I think you will probably find someone willing to help you.

I hope you find a solution;
regards,
M.

Wilbert
19th July 2005, 17:40
As for the regedit idea, I know that won't work, because I have no such DLL on my system (despite having Helix installed via auto install). This was the DLL already being used for that purpose: yv12vfw.dll.
Yes, that's the one from helix. Sorry, i can't help you further.

kalorx
19th July 2005, 17:42
Well, we know the AVS script isn't the problem now, so I don't see the harm in leaving it as it is. That, and, well, I don't know how to create reference AVI. Are you talking about a frameserver?

mg262
19th July 2005, 17:47
Well, we know the AVS script isn't the problem now, so I don't see the harm in leaving it as it is. That, and, well, I don't know how to create reference AVI. Are you talking about a frameserver?

Sorry, I just meant an AVI file. Just open up any video in VirtualDub and save it in a YV12 format. Then try and feed that AVI into x264. (I assume you've already done this based on your earlier error report.) You can then obtain the error message relating to this file and search for that on the forums and perhaps using Google. If you really don't find anything and post a request for help, make sure to cite the exact error message, every piece of information you can get about the file you're using, the exact version of x264 you're using, etc.

Nic
19th July 2005, 19:03
@kalorx: Sorry kalorx, you're dead right, I missed that bit. You did say you were using DGIndex and MPEG2Dec3 at one point, and I didn't spot the reply where you stated you started using DGDecode....it's been a long day at the office ;)

Very strange...Could you try my QuEnc program? I know it's pretty irrelevant in this situation. But if that works and x264 doesn't, it means something is cr*ppy in the x264 AviSynth handling and i'll look at changing the code.
(QuEnc can be got from http://nic.dnsalias.com/QuEnc.zip ...Just load up your AVS and encode don't worry about settings, if it doesn't error and creates an MPEG file then it's working fine)

-Nic

kalorx
19th July 2005, 21:19
The AVS loads up fine and encodes perfectly in your QuEnc program.