![]() |
Avisynth 2,5/2,6 Plugin
Liste der Anhänge anzeigen (Anzahl: 2)
Hallo,
ich möchte ein einfaches Avisynth-Plugin schreiben und da ich keine Delphi-Beispiele fand mit dem CBuilder XE5 ein paar Avisynth Filter SDK Sample ausprobieren. Konkret habe ich dann das ![]() ![]() Das "Filter SDK/Simple sample 1.0b" wurde sofort ohne Fehler compoliert. Beim "Filter SDK/Two-Five fast Invert" musste ich #include "windows.h" einfügen und ein "```}}" entfernen damit es compiliert werden konnte. Das Ergebnis war in beiden Fällen ein schwarzes Bild mit einem weißen senkrechten Streifen und ein Absturz von Avisynth (Siehe Anhang). Dann habe ich das ![]() Im Anhang sind die beiden CBuilder XE 5 und das Delphi 7 Projekt sowie die Testscripte. Mein Testvideo habe ich von der ![]() ![]() Kennt sich jemand da mit aus und kann mir helfen, in irgendeiner Weise weiter zu kommen? |
AW: Avisynth 2,5/2,6 Plugin
Code:
Das ist das einzige was ich zu den verschiedenen Versionen von AvisynthPluginInit gefunden habe.
AVSValue LoadPlugin(AVSValue args, void* user_data, IScriptEnvironment* env){
extern const AVS_Linkage* const AVS_linkage; // In interface.cpp bool quiet = (user_data != 0); args = args[0]; const char* result=0; for (int i=0; i<args.ArraySize(); ++i) { HMODULE plugin; const char* plugin_name = args[i].AsString(); if (MyLoadLibrary(plugin_name, &plugin, quiet, env)) { typedef const char* (__stdcall *AvisynthPluginInit3Func)(IScriptEnvironment* env, const AVS_Linkage* const vectors); AvisynthPluginInit3Func AvisynthPluginInit3 = (AvisynthPluginInit3Func)GetProcAddress(plugin, "AvisynthPluginInit3"); if (!AvisynthPluginInit3) { AvisynthPluginInit3 = (AvisynthPluginInit3Func)GetProcAddress(plugin, "_AvisynthPluginInit3@8"); if (!AvisynthPluginInit3) { // Try for 2.5 version typedef const char* (__stdcall *AvisynthPluginInit2Func)(IScriptEnvironment* env); AvisynthPluginInit2Func AvisynthPluginInit2 = (AvisynthPluginInit2Func)GetProcAddress(plugin, "AvisynthPluginInit2"); if (!AvisynthPluginInit2) { AvisynthPluginInit2 = (AvisynthPluginInit2Func)GetProcAddress(plugin, "_AvisynthPluginInit2@4"); if (!AvisynthPluginInit2) { // Older version FreeLibrary(plugin); if (quiet) { // remove the last handle from the list HMODULE* loaded_plugins = (HMODULE*)env->GetVar("$Plugins$").AsString(); int j=0; while (loaded_plugins[j+1]) j++; loaded_plugins[j] = 0; } else { env->ThrowError("Plugin %s is not an AviSynth 2.6 or 2.5 plugin.",plugin_name); } } else { result = AvisynthPluginInit2(env); } } else { result = AvisynthPluginInit2(env); } } else { result = AvisynthPluginInit3(env, AVS_linkage); } } else { result = AvisynthPluginInit3(env, AVS_linkage); } } } if (loadplugin_prefix) free((void*)loadplugin_prefix); // Tritical May 2005 loadplugin_prefix = 0; return result ? AVSValue(env->SaveString(result)) : AVSValue(); } |
AW: Avisynth 2,5/2,6 Plugin
Wenn ich das richtig lese, schlägt die Initialisierung fehl.
In dem Beispiel wird so initialisiert:
Code:
In meinem Delphiprojekt:
// This is the function that created the filter, when the filter has been called.
// This can be used for simple parameter checking, so it is possible to create different filters, // based on the arguments recieved. AVSValue __cdecl Create_SimpleSample(AVSValue args, void* user_data, IScriptEnvironment* env) { return new SimpleSample(args[0].AsClip(),env); // Calls the constructor with the arguments provied. } // The following function is the function that actually registers the filter in AviSynth // It is called automatically, when the plugin is loaded to see which functions this filter contains. extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) { env->AddFunction("SimpleSample", "c", Create_SimpleSample, 0); // The AddFunction has the following paramters: // AddFunction(Filtername , Arguments, Function to call,0); // Arguments is a string that defines the types and optional names of the arguments for you filter. // c - Video Clip // i - Integer number // f - Float number // s - String // b - boolean return "`SimpleSample' SimpleSample plugin"; // A freeform name of the plugin. }
Delphi-Quellcode:
function avisynth_c_plugin_init(env: PAVS_ScriptEnvironment): PChar; stdcall;
begin avs_add_function(env, 'avsBasic', avsBasic.AviSynthDescription, @create_avsBasic, nil); Result := 'avsBasic'; end; exports avisynth_c_plugin_init; end.
Delphi-Quellcode:
const
AviSynthDescription = '[src]c'; function create_avsBasic(args: MSVC_AVS_Value; use_inplace: Pointer; env: PAVS_ScriptEnvironment): MSVC_AVS_Value; stdcall; var avsargs : AVS_Value; begin; { * Parameter übernehmen. } avsargs := AVS_Value(args); end; |
AW: Avisynth 2,5/2,6 Plugin
Wenn ich das
![]()
Code:
Und das Beispiel von sf lässt sich nicht ausführen.
[Fataler Fehler] Package 'a429comm_dcl' wird benötigt, konnte aber nicht gefunden werden
Zitat:
|
AW: Avisynth 2,5/2,6 Plugin
In der dering.cfg ist -$J+ und in der dering.dof J=1 und UsePackages=1 gesetzt.
|
AW: Avisynth 2,5/2,6 Plugin
Liste der Anhänge anzeigen (Anzahl: 2)
Die CBuilder DLL vom SimpleSample 1.7 ist 177 kB groß. Jetzt habe ich das Sample mit Microsoft Visual Studio Express 2012 zum Laufen bekommen. Da ist die DLL nur 13 kB groß.
Bei dem Delphi-Plugin habe ich den Verdacht, dass es am OS (64bit) liegt. Obwohl Avisynth und Plugin 32bit sind. |
AW: Avisynth 2,5/2,6 Plugin
Ich habe die DLLs unter Windows XP getestet.
Kann mir jemand sagen, wie ich die CBuilder DLL C++ kompatible bekomme oder wie man die VC++ zum Laufen bekommt ohne Visual Studio installieren zu müssen? |
AW: Avisynth 2,5/2,6 Plugin
Hi Garfield,
normalerweise gibts ja eine VC-Redistribution zum installieren wo die benötigten DLL's je nach Studio Version enthalten sind. bg |
AW: Avisynth 2,5/2,6 Plugin
Hallo bg,
es gibt ja eine passende Redist zum Download. Diese Installation wollte ich vermeiden. Mittlerweile habe ich ein wenig mit den Einstellungen gespielt und die DLL ist ein wenig größer geworden. Unter XP funktioniert sie nicht, aber unter Windows 7 ohne weitere Installation. Am liebsten wäre mir ja, wenn ich die Delphi-DLL zum funktionieren bringen könnte. Dann könnte ich in Delpi weitermachen und müsste nicht noch C++ lernen. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:12 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz