PDA

View Full Version : AviSynth, Directshow, Vista64


SJM
14th April 2009, 06:38
I am unable to play AviSynth scripts on 64 Vista with directshow.
I am using the playback code from the SourceForge sample code, Dxtext, to play videos.
The following avisynth script does not play with this code on 64 bit Vista:
DirectShowSource("C:\\test.avi")
separateFields

I receive the exception:
Could not get interfaces,
System.Runtime.InteropServices.COmException(0x80040154): Class not registered.

The offending code is:
hr = filterGraph.AddSourceFilter(clipFile, "Ds.NET FileFilter", out capFilter);

The code runs successfully when I play the "test.avi" file without the avisynth script on 64 bit Vista.
The code plays the script successfully on 32 bit Vista.
I can play the script with GraphEdit and Window Media Player on 64 bit Vista, so I assume that I have the correct version of avisynth and it is registered.

I am using:
avisynth version 2.5.8
DirectShowLib-2005.dll, version 2.0.0, runtime version v2.0.50727, dated 7/9/2007

I am using Visual C# 2008 Express Edition to compile. There is no compile option for 64 or 32 bit code with the Express Edition. The compiled code runs on 32 bit systems, so I assume that it is compiling 32 bit code.

I am not very familiar with DirectShow or AviSynth. Could it be that I am leaving out a reference or "using" statement?

I appreciate any help you can give me. Thank you.

IanB
14th April 2009, 07:18
1. Are you trying to build/run a 64bit executable or a 32bit executable?

Avisynth is 32bit only. DirectShow loads all the components into the address space of the current process, so they must be all the same bitness. There are no 64bit to 32bit marshalling services for DirectShow.

Squid80 has been tinkering with a 64bit build of Avisynth but as a lot of the code is 32bit assembler with no C++ equivalent, it has some features missing.

or

2. Avisynth interfaces as a driver for the Video for Windows (VFW), AVIFile layer. The implementation under DirectShow is in the quartz.dll module, "AVIFile Source", it is slightly buggy, but most versions work. May be the version shipped with Vista64 is more screwed than usual.

Leak
14th April 2009, 10:21
I am using Visual C# 2008 Express Edition to compile. There is no compile option for 64 or 32 bit code with the Express Edition. The compiled code runs on 32 bit systems, so I assume that it is compiling 32 bit code.
No, it is compiling it to MSIL code, and that usually is just-in-time compiled to whatever bitness your operating system happens to have unless your generated assembly tells it otherwise.

Set the "Platform target" on the build page of your project's properties to "x86" instead of "Any CPU", and it should run in 32 bit mode. More info about that can be found here (http://msdn.microsoft.com/en-us/library/zekwfyz4(VS.80).aspx).

EDIT: awww, crap - that setting isn't available in VC#2008 EE - I guess you'll have to compile at least your executable via the command line, then... but here (http://social.msdn.microsoft.com/forums/en-US/netfx64bit/thread/331660b6-8e12-4100-9382-bd94745c36d4/)'s a work-around.

np: Andreas Tilliander - Track 08 (Ljud)