Log in

View Full Version : avisynth in a commercial application


fenomeno83
2nd March 2012, 10:22
I don't know if it is correct section, but I want ask you an important question:
can be Avisynth used for commercial purpose?
I know that it is under GPL licence, but what about external filters for example?
thanks

LoRd_MuldeR
2nd March 2012, 13:17
The GPL does not forbid commercial use at all! Commercial use of GPL'd software is explicitly allowed.

What you must not do is re-using GPL'd code in a commercial software and keep that software ClosedSource.

As soon as you want to re-use GPL'd code in your own software, your own software has to be put under the GPL too.

Actually a Non-GPL software wouldn't even be allowed to link against a GPL'd library (DLL). That's what the LGPL is intended for.

The Avisynth developers, however, have added a special GPL exception for the Avisyth DLL - see below!

So you are allowed to use the Avisynth DLL from any software (even ClosedSource), as long as you stick to the "official" interfaces.

Avisynth plug-ins are a different story, of course. It depends on the license of the individual plug-in...


As a special exception, the copyright holders of Avisynth give you
permission to link Avisynth with independent modules that communicate
with Avisynth solely through the interfaces defined in avisynth.h,
regardless of the license terms of these independent modules, and to
copy and distribute the resulting combined work under terms of your
choice, provided that every copy of the combined work is accompanied by
a complete copy of the source code of Avisynth (the version of Avisynth
used to produce the combined work), being distributed under the terms of
the GNU General Public License plus this exception. An independent
module is a module which is not derived from or based on Avisynth, such
as 3rd-party filters, import and export plugins, or graphical user
interfaces.

fenomeno83
6th March 2012, 18:49
Thankyou!
And for plugins without specific GPL information, what policy is used?

For example:
http://strony.aster.pl/paviko/hdragc.htm
http://forum.doom9.org/showthread.php?t=38436

Is there the same special exception added by Avisynth developers, to use them in commercial Closed Source software?

So, I'd like to know if Can I use a code like this (i link avisynth.lib and import external AGC.dll too):

#include "StdAfx.h"
#include "FilteringAvisynth.h"
#include <string>
#include <sstream>
#include "../avisynth/avisynth.h"
using namespace std;

FilteringAvisynth::FilteringAvisynth(void)
{
//env is a IScriptEnvironment* defined into h
env = CreateScriptEnvironment();
}

FilteringAvisynth::~FilteringAvisynth(void)
{
//env is a IScriptEnvironment* defined into h
delete env;
}

void FilteringAvisynth::EqualizeAvs(string src)
{


PVideoFrame pf=NULL;

try
{

//load plugin to equalize source image
env->Invoke("LoadPlugin", "AGC.dll");

//read image from path invoking ImageReader avisynth internal filter
AVSValue input = env->Invoke("ImageReader", src.c_str());

//convert into YV12 (next filter need this color space) invoking ConvertToYV12 avisynth internal filter
input = env->Invoke("ConvertToYV12", input);

//equalize image invoking HDRACC avisynth external filter from AGC.dll
input = env->Invoke("HDRAGC", input);

//convert into RGB invoking ConvertToRGB avisynth internal filter
input = env->Invoke("ConvertToRGB", input);

//adjust rgb image
AVSValue par3[4] = {input,1.0,1.04,1.0};
input = env->Invoke("RGBAdjust", AVSValue(par3,4));

//write image (will write after GetFrame method) in a temp file invoking ImageWriter avisynth internal filter and return it in a PClip invoking AsClip method
//will be write in format (src + "000000.jpg")
AVSValue par7[5] = {input,src.c_str(),0,0,"jpg"};
PClip clip = env->Invoke("ImageWriter", AVSValue(par7,5)).AsClip();

//extract the first frame from PClip, that represents equalized RGB image, using GetFrame method
pf = clip->GetFrame(0,env);

}
catch (AvisynthError err)
{
printf("%s\n", err.msg);
}

}



#include "stdafx.h"
#include "String.h"
#include "FilteringAvisynth.h"
#include <iostream>

int main(int argc, char* argv[])
{
FilteringAvisynth filter;
stringstream str1;

str1 << argv[1];

filter.EqualizeAvs(str1.str().c_str());

return 0;
}


Thanks

LoRd_MuldeR
6th March 2012, 20:15
And for plugins without specific GPL information, what policy is used?

Totally depends on what license the individual plug-in author has chosen. If the author did not note the license, you will have to contact the author and ask...

So, I'd like to know if Can I use a code like this (i link avisynth.lib and import external AGC.dll too)

It is okay to #include the "avisynth.h" in your own code. It's also okay to link the "avisynth.lib" into your own binary, so your binary will use the "avisynth.dll" at runtime.

But that's it. As soon as you use other code from Avisynth (or code from another GPL'd software project) in your own project, your own software must be released under the GPL.

Note that "using code" means that you either copy&paste code from the GPL'd software into your own source file or that you #inlcude that code in your own source file.

Also note that if you modify some code inside Avisynth, then you must make the modified Avisynth sources available along with the modified DLL - no matter what!

fenomeno83
7th March 2012, 14:18
thanks!
I've written to developers, but I don't know if they will reply to me, considering that topics are very old.

So, if a plugin/software hasn't any specific GPL information, it is to consider as totally free to use?

Maccara
7th March 2012, 14:35
So, if a plugin/software hasn't any specific GPL information, it is to consider as totally free to use?

No. You do not have any rights to copy/use/distribute unless you have written consent from the author in some form.

If no license explicitly stated, you have to ask from the author - there's no way around that - even if author can't be contacted/found.

fenomeno83
11th March 2012, 11:07
OK!
And about avisynth, in my case is it necessary include full source code of used version, right?

IanB
12th March 2012, 21:48
Only if you modify it from the original. If you use 100% the same as one of the original releases then just point to the original release.

When you modify any code, then you need to provide at least the modified code.

Chikuzen
14th March 2012, 02:15
Only if you modify it from the original. If you use 100% the same as one of the original releases then just point to the original release.

When you modify any code, then you need to provide at least the modified code.

No.
http://www.gnu.org/licenses/gpl-faq.en.html#UnchangedJustBinary
http://www.gnu.org/licenses/gpl-faq.en.html#DistributingSourceIsInconvenient
GPL requires that all code should be distributed by the re-distributer himself.