ShawnFumo
26th March 2005, 20:17
Hey.. a question for anyone more experienced with python than me. I'd pretty much decided on using wxPython to build a NLE on top of avisynth. At first I thought the best way to do it would just be to write out .avs files and load WMP as activex to preview it. But then it was pointed out to me that it'd be much more efficient to call avisynth.dll directly, since I wouldn't have to write out text files or reload the original video clip when changing filters.
My lack of experience with c wrapping and python in general is making this really hard for me though. I found ctypes for python, which lets you call a c dll directly. That meant I should be able to call either avisynth_c, or Myrsloik's c wrapper called asif:
http://kevin.atkinson.dhs.org/avisynth_c/
http://yatta.mellbin.org/asif.rar
Now it seems like I should be able to call those fine with ctypes, but my problem is getting the data structures worked out in python to send to and receive from the dll. I tried using the h2xml utility that comes with ctypes (which would be followed by xml2py), but can't get that to work. In asif, it gives an error about needing MSVC (I think because of the "__cdecl" in it). Then I tried grabbing the stdcall version of avisynth_c, but that errored out with no information to tell me what was wrong.
If I can just manage to get the python equivilant of asif.pas and asifadditions.pas in Myrsloik's package, I think I'd be set. As it stands now, though, I may be stuck embedding media player and reloading avs files. I think I'll be able to make that work ok, but it seems like calling avisynth directly would be a better solution in the end. I suppose I could also try writing my program in C++ with regular wxWidgets (no wrapping needed then), but wxPython seemed like a nice solution for building a GUI quickly (and I could also leverage the NLE OpenVIP, which was made in wxPython).
If anyone has any ideas, I'd be very thankful! It is just frustrating because I think I can make a useful app, but I'm really inexperienced with more low-level programming like this. If I can just get past these initial groundwork stages, I should be able to do the rest on my own...
Thanks!
Shawn
My lack of experience with c wrapping and python in general is making this really hard for me though. I found ctypes for python, which lets you call a c dll directly. That meant I should be able to call either avisynth_c, or Myrsloik's c wrapper called asif:
http://kevin.atkinson.dhs.org/avisynth_c/
http://yatta.mellbin.org/asif.rar
Now it seems like I should be able to call those fine with ctypes, but my problem is getting the data structures worked out in python to send to and receive from the dll. I tried using the h2xml utility that comes with ctypes (which would be followed by xml2py), but can't get that to work. In asif, it gives an error about needing MSVC (I think because of the "__cdecl" in it). Then I tried grabbing the stdcall version of avisynth_c, but that errored out with no information to tell me what was wrong.
If I can just manage to get the python equivilant of asif.pas and asifadditions.pas in Myrsloik's package, I think I'd be set. As it stands now, though, I may be stuck embedding media player and reloading avs files. I think I'll be able to make that work ok, but it seems like calling avisynth directly would be a better solution in the end. I suppose I could also try writing my program in C++ with regular wxWidgets (no wrapping needed then), but wxPython seemed like a nice solution for building a GUI quickly (and I could also leverage the NLE OpenVIP, which was made in wxPython).
If anyone has any ideas, I'd be very thankful! It is just frustrating because I think I can make a useful app, but I'm really inexperienced with more low-level programming like this. If I can just get past these initial groundwork stages, I should be able to do the rest on my own...
Thanks!
Shawn