Log in

View Full Version : AviSynth 2.5.6 and MPEG-2 import - nothing I've tried works!


kungfujoe
25th February 2006, 00:42
I'm a bit new to AviSynth, so please bare with me. I've been using it for at least a year, but my use has been limited to a basic script resizing AVI files for encoding to DVD. Now I'm trying to do the reverse, but I can't get my MPEG2 streams to play with AviSynth, no matter what I do. I'm testing the files with MediaPlayer Classic, to minimize issues with interactions with other programs (I've read about certain AviSynth plugins apparently not playing nice with certain programs upon output). I've tried these methods (all of which are paired with a WavSource("filename.wav") command):

DirectShowSource("filename.m2v",audio=false)

This gives me no error message, but also no video.

LoadPlugin("MPEG2Dec3.dll")
MPEG2Source("filename.m2v",cpu=4,iPP=true)

This gives me an error message about being unable to load the plugin. I put the plugin in the default directory, but just in case, I tried this:

LoadPlugin("D:\Progam Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")
MPEG2Source("filename.m2v",cpu=4,iPP=true)

No go. Same error. Maybe AviSynth doesn't like spaces? Nope. I also tried this:

LoadPlugin("D:\PROGRA~1\AVISYN~1\plugins\MPEG2Dec3.dll")
MPEG2Source("filename.m2v",cpu=4,iPP=true)

And just for good measure, I tried another decoder, DGDecode.dll, using all three methods of loading. Always, the same error.

I've got a few MPEG-2 decoders installed. I can open the M2V files themselves in MediaPlayer Classic and in Windows MediaPlayer without any problem (and in MPC's case, it finds the WAV file of the same name and automatically plays it with the M2V file).

My eventual goal is to use AviSynth and some other program (TBD) to convert a whole bunch of M2V/WAV files into lower-resolution, lower-framerate, XviD files to create kind of a "web-DVD" of sorts. But if I can't even get AviSynth to open the files to begin with, I'm kinda stuck (I can think of other ways to do what I want, but none are quite as simple or elegant as the AviSynth solution).

Guest
25th February 2006, 00:53
You're not reading the documentation if you can write this:

>MPEG2Source("filename.m2v",cpu=4,iPP=true)

The MPEG2Source() function takes a D2V file, not an M2V file.

I suggest using DGIndex/DGDecode. First create the D2V file using DGIndex. Then use DGDecode to load the D2V file. It's all described very clearly in the Quick Start Guide that comes with DGMPGDec.

kungfujoe
25th February 2006, 01:05
You're not reading the documentation if you can write this:

>MPEG2Source("filename.m2v",cpu=4,iPP=true)

The MPEG2Source() function takes a D2V file, not an M2V file.

I suggest using DGIndex/DGDecode. First create the D2V file using DGIndex. Then use DGDecode to load the D2V file. It's all described very clearly in the Quick Start Guide that comes with DGMPGDec.Thanks for the tip - I missed the part in the MPEG2Dec3 documentation about D2V files specifically being DVD2AVI (now DGMPGDEC) project files.

Is there any way to get AviSynth to read MPEG2 files natively? It seems a bit silly to run one frame server (DVD2AVI) to feed to another frame server (AviSynth) to feed to an encoder (or am I misunderstanding what DVD2AVI is? I never really looked into using it before, but from what little bit I saw, I got the impression that it was a frame server). From what the AviSynth webpage says, it sounds like SirectShowSource should do it, but I can't get that to read the MPEG2 streams.

kungfujoe
25th February 2006, 01:18
This still doesn't help. I dropped all of the DGMPGDEC files into the AviSynth plugin directory, created a D2V file of one of the MPEG sets I'm trying to convert, and AviSynth still can't load the plugin (again, trying all three locations - filename only, full path name, short path name). It appears that it's not even getting to the point of not loading the video file itself - it's choking on attempting to load the plugin itself.

Guest
25th February 2006, 01:21
Is there any way to get AviSynth to read MPEG2 files natively? It seems a bit silly to run one frame server (DVD2AVI) to feed to another frame server (AviSynth) to feed to an encoder (or am I misunderstanding what DVD2AVI is)? I never really looked into using it before, but from what little bit I saw, I got the impression that it was a frame server). You could perhaps refrain from calling something silly when you admit that you know basically nothing about it.

You can try Nic's MPEGDecoder.dll, but it has fallen into disuse it appears. That's because DGMPGDec (IMHO) has become the preferred way to serve MPEG video via Avisynth.

Guest
25th February 2006, 01:28
This still doesn't help. I dropped all of the DGMPGDEC files into the AviSynth plugin directory That's not a good idea. You can put the DGDecode.dll there if you want it to be autoloaded, but don't put anything else in there. Put it in a directory like c:\DGMPGDec.

created a D2V file of one of the MPEG sets I'm trying to convert, and AviSynth still can't load the plugin (again, trying all three locations - filename only, full path name, short path name). Loading is not necessary if you have put the DLL in the Avisynth plugins directory.

It appears that it's not even getting to the point of not loading the video file itself - it's choking on attempting to load the plugin itself. Have you tried following the steps in the Quick Start Guide?

Also try this: Put a copy of DGDecode.dll in the same directory as your AVS script, and remove it from the Avisynth plugins directory. Then use this:

LoadPlugin("dgdecode.dll")

What happens?

kungfujoe
25th February 2006, 01:58
You could perhaps refrain from calling something silly when you admit that you know basically nothing about it.You're right. Sorry.
Loading is not necessary if you have put the DLL in the Avisynth plugins directory.I just tried it without the LoadPlugin function (I had that in there because one page on MPEG2 loading that I read explicitly said that AviSynth 2.5 doesn't have plugin auto-loading "yet" - I guess it's been added since that was written?), and it gives another error: MPEG2Source: couldn't open file
My AVS file contained only these two lines:

MPEG2Source("filename.d2v")
WavSource("filename.wav")
Have you tried following the steps in the Quick Start Guide?Yep, though to be honest, I followed all of those steps before reading the Quick Start guide. :o
Also try this: Put a copy of DGDecode.dll in the same directory as your AVS script, and remove it from the Avisynth plugins directory. Then use this:

LoadPlugin("dgdecode.dll")

What happens?It works exactly like DirectShowSource - audio, no video, and no error (i.e. just like I loaded the WAV file alone into MPC).

Guest
25th February 2006, 03:32
My AVS file contained only these two lines:

MPEG2Source("filename.d2v")
WavSource("filename.wav") Ha ha. Try this:

vid=MPEG2Source("filename.d2v")
aud=WavSource("filename.wav")
audiodub(vid,aud)

It's right there in the Quick Start Guide. :)

For your file open problem, are you sure the parameter "filename.d2v" is correct. Try a full path name. It has to point to the D2V file you got when you did Save Project in DGIndex.

Start again, and don't move any files around.

Finally, please use DGMPGDec 1.4.6 as the error messages are more explanatory.

kungfujoe
25th February 2006, 04:29
vid=MPEG2Source("filename.d2v")
aud=WavSource("filename.wav")
audiodub(vid,aud)

It's right there in the Quick Start Guide. :)Dang, missed that - I kinda glossed over it when that section appeared to be about DGIndex creating WAV files (not a concern for me, since I'm using elemental streams). That did the trick. I appreciate the help, and apologize for missing and misunderstanding so much in the docs the first time around.

I also figured out why the plugin didn't appear to be auto-loading - since I hadn't deleted the MPEG2Dec3.dll file when I started trying to use DGDecode.dll, there were two plugins that both had an MPEG2Source function (i.e. I could've used "DGDecode_MPEG2Source" - instead I just deleted the other dll, since I don't need both of them).

Now I'm off to bed, and tomorrow I'll play with adjusting the size and frame rate and piping it into VirtualDub or VirtualDubMod to encode the output.
For your file open problem, are you sure the parameter "filename.d2v" is correct. Try a full path name. It has to point to the D2V file you got when you did Save Project in DGIndex.The D2V, M2V, WAV, and AVS files are all in the same directory, so the filenames were not among my numerous issues. :)
Finally, please use DGMPGDec 1.4.6 as the error messages are more explanatory.I've been using a fresh copy DGMPGDec 1.4.6 downloaded this afternoon, so the errors I've been relaying are the ones provided by AviSynth 2.5.6 and DGMPGDec 1.4.6.