Jump to content
Sign in to follow this  
Tin2tin

Avisynth integration

Recommended Posts

Do you think that it would be possible run avisynth scripts in autoit with stuff like this?

http://forum.doom9.org/showthread.php?p=772595#post772595

(I don't know anything about dllcalls and such)

Or are there better ways?

I would really like to try to give this a shot, but it would be really helpful if anyone could point me in the right direction of how to implement the AVSredirect.dll(from the link above) functions in autoitscript? Are there any turorials or examples I could look at or simply point me to the main function I should use in autoitscript?

Share this post


Link to post
Share on other sites

Found your post on Doom9. I am also interested in this...

Here is the header for the DLL. DLL is C or C++

#ifndef AVISYNTHDLL_H
#define AVISYNTHDLL_H

typedef struct AVSDLLVideoInfo {
    // Video
    int width;
    int height;
    int raten;
    int rated;
    int aspectn;
    int aspectd;
    int interlaced_frame;
    int top_field_first;
    int num_frames;
    int pixel_type;

    // Audio
    int audio_samples_per_second;
    int sample_type;
    int nchannels;
    int num_audio_frames;
    int64_t num_audio_samples;
} AVSDLLVideoInfo;

typedef struct AVSDLLVideoPlane {
    int width;
    int height;
    int pitch;
    BYTE *data;
} AVSDLLVideoPlane;


typedef struct FRAME {
    int *data;
} FRAME;



typedef struct AVSDLLVideoFrame {
    AVSDLLVideoPlane plane[3];
} AVSDLLVideoFrame;

typedef struct AVSDLLAudioPos {
    int64_t start;
    int64_t count;
} AVSDLLAudioPos;


#endif /* AVISYNTHDLL_H */

I converted all struct's excpet for AVSDLLVideoFrame, which by the name sounds fairly important.

DllOpen("AVSredirect.dll")
$str = "int width; int height; int raten; int rated; int aspectn; int aspectd; int interlaced_frame; int top_field_first; int num_frames; int pixel_type; int audio_samples_per_second; int sample_type; int nchannels; int num_audio_frames; int64 num_audio_samples;"
$AVSDLLVideoInfo = DllStructCreate($str)
$str = "int width; int height; int pitch; BYTE *data;"
$AVSDLLVideoPlane = DllStructCreate($str)
$str = "int width; int height; int pitch; BYTE *data;"
$AVSDLLVideoPlane = DllStructCreate($str)
$str = "int64 start; int64 count;"
$AVSDLLAudioPos = DllStructCreate($str)

Functions that are available in AVSredirect.dll

_avs_close
_avs_create
_avs_getaframe
_avs_getlasterror
_avs_getlasterrorb
_avs_getvframe
_avs_open
_avs_script

What to put in DllCall() is what's needed as well as the missing AVSDLLVideoFrame struct, how can that be done in AviSynth?

An Example using PureBasic is here (Post #59)

http://forum.doom9.org/showthread.php?p=800030#post800030

I second Tin2tin's request for some help...

Share this post


Link to post
Share on other sites

It appears that the AVSredirect has been changed into AvisynthWrapper. C++ sourcecode included. I hope that helps someone to write an Autoit UDF that wrapper, so the great Avisynth video scripting language finally can partner up with Autoit.

Btw. if you don't know what Avisynth can do for you, then take a look at the link at my signature. All the videos in the flv player are made with Avisynth.

Edited by Tin2tin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...