I have been trying to write my own avidemux plugin. I successfully installed all the prerequisites following the instructions in http://www.avidemux.org/admWiki/doku.php?id=build:devel_2.6. I can compile the two sample plugins from the folder myOwnPlugins. I can also compile most of the plugins which are a part of avidemux itself, if I update the CMakeLists.txt file in the last section of it, after
################################################
# Now really define our plugin...
###############################################
(I just copy the contents of the CMakeLists.txt which comes with the source code)
My problems start when I try to compile a plugin which use Qt, such as the plugin Crop (avidemux_plugins\ADM_videoFilters6\crop). It doesnt give me an error, it just wont compile. Probably there is more that needs to be changed in CMakeLists.txt but I cant figure out what.
Anybody could give me an example of CMakeLists.txt for a plugin using Qt, so that it could be built standalone?
If your plugin is qt4 only you have to do the following in your plugin CMakelists :
INCLUDE(vf_plugin)
INCLUDE(vf_plugin_qt4) <<<<=== add this
and replace
INIT_VIDEO_FILTER(blah blah)
INSTALL_VIDEO_FILTER(blah blah)
by
INIT_VIDEO_FILTER_QT4(blah blah)
make sure to use that macro
DECLARE_VIDEO_FILTER( CropFilter, // Class
1,0,0, // Version
ADM_UI_TYPE_QT4 <<===
VF_TRANSFORM, // Category
"crop", // internal name (must be uniq!)
"crop", // Display name
"crop filter" // Description
);
and to only build the filter when QT4 is on i.e.
IF(DO_QT4)
INIT_VIDEO_FILTER_QT4(....)
ENDIF(DO_QT4)
It seems to be working now, thanks for the advice.
How to install & set the qt environments?
when 'make', I got error:
error: QWidget: No such file or directory
#include <QWidget>
^~~~~~~~~
I never tried this, but if the system used for plugin development runs Windows, https://wiki.qt.io/MSYS2 may apply to you. Please note that building Qt in msys2 from source may take many, many hours or even days on a modestly powerful hardware. If possible, try to use pre-compiled binaries, but I am not sure what happens if the Qt version in msys2 differs from one used to build the Avidemux app. I hope, Mean has better cues.
On Linux, you would simply build the entire application from source, which is pretty trivial in case of Avidemux.
I install QT(mingw64 mingw-w64-x86_64-qt5 5.10.1-2) on MSYS2, and generated qt related files "ui_crop.h", "moc_Q_crop.cpp" by using uic.exe and moc.exe.
then add #include "moc_Q_crop.cpp" at the end of Q_crop.h
modified CMakeLists.txt as below :
https://imgur.com/a/iuPd8hq
when 'make', still get error like:
https://imgur.com/a/eS1QjrS
Can anyone help?
Honestly don't know why linking fails. I would suggest setting up a Linux/MXE cross-compiling environment as used to compile win64 Avidemux builds (https://github.com/mean00/avidemux2/blob/master/cross-compiling.txt (https://github.com/mean00/avidemux2/blob/master/cross-compiling.txt)). Apart from that, could you please explain what do you try to change in the crop filter?