What is the "official" way of building in 2020?

The sox module says it is optional, but it is an incorrect message

Thank you. I suspected something like that, but (if I understood correctly) as I’m a kind of beta-tester external newcomer I thought you would be interested to know where I’ve been stucked.

Next episode coming soon … :slight_smile:

If you don’t mind me asking, what do you plan on tackling? :slightly_smiling_face:

I planned to try to propose to the team an implementation of markers (because this is on the readmap, but it’s a priority for me, and it looks like a “quite simlpe” one).

Note that I’m totally aware that I’m probably totally wrong by thinking that this is a more or less “easy pieck” :wink:

Actually, looking into this more, sox should be optional as Shotcut is not using anything from it. However, our builds include it for sake of a more comprehensive build of MLT (some people use things from MLT from Shotcut builds outside of Shotcut). I will change the script to make this dependency truly optional.

I planned to try to propose to the team an implementation of markers

That is not easy for someone new to Shotcut code. You are better off trying to fix some bugs first to learn. I found that is one of the easiest way to learn.
If you want markers now, add a video track, make it not visible, and add a color clip to it. Then, you can copy and paste this color clip as-needed. You can change independently the color, duration, and name of these color clips as well. There are some finer points of that you might want to look into. For example, today if you double-click a clip it selects and seeks to its start (good). However, that does not work when you double-click the clip’s trim handle on the left or right edge of the clip. That makes using a short color clip as a marker less usable.

Thanks @shotcut. Indeed, I’ve seen this technique explained somewhere on the forum. I started to try using it, but it’s really not easy to use

Thanks. I installed libsox-dev and I can now progress one step ahead on MLT compilation and the next error is:

make[1]: Entering directory '/home/bruno/shotcut/src/mlt/src/melt'
cc -I/home/bruno/shotcut/Shotcut/Shotcut.app/include -DNDEBUG -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -I.. -rdynamic -DVERSION=\"6.25.0\" -DHAVE_SDL2 -D_REENTRANT -I/usr/include/SDL2   -c -o melt.o melt.c
cc -I/home/bruno/shotcut/Shotcut/Shotcut.app/include -DNDEBUG -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -I.. -rdynamic -DVERSION=\"6.25.0\" -DHAVE_SDL2 -D_REENTRANT -I/usr/include/SDL2   -c -o io.o io.c
cc -o melt melt.o io.o -L/home/bruno/shotcut/Shotcut/Shotcut.app/lib -Wl,--no-undefined -Wl,--as-needed -Wl,--no-undefined -Wl,--as-needed -L../framework -lmlt -lpthread -lSDL2
make[1]: Leaving directory '/home/bruno/shotcut/src/mlt/src/melt'
qimage_wrapper.cpp:177:35: error: missing binary operator before token "("
  177 | #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
      |                                   ^
qimage_wrapper.cpp:188:34: error: missing binary operator before token "("
  188 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
      |                                  ^
qimage_wrapper.cpp:428:35: error: missing binary operator before token "("
  428 | #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
      |                                   ^
consumer_qglsl.cpp:25:34: error: missing binary operator before token "("
   25 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
consumer_qglsl.cpp:157:34: error: missing binary operator before token "("
  157 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
consumer_qglsl.cpp:181:34: error: missing binary operator before token "("
  181 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
consumer_qglsl.cpp:208:34: error: missing binary operator before token "("
  208 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
make[2]: *** [Makefile:60: depend] Error 1
make[1]: *** [Makefile:5: depend] Error 1
make: *** [Makefile:9: all] Error 1
ERROR: Unable to build mlt
LOG: Process has finished. Reason: FAILURE Some kind of error occurred: Unable to build mlt

This is strange, I understand it as a syntax error in precompiler directives :thinking:
Anyone had this issue before ?

I tried to fix it by adding #include <QtGlobal> in qimage_wrapper.cpp but the script complains about local changes.
Is there a way to disable local changes check ? (in the meanwhile I’ve added a commit but this is not really clean)

My first guess would be that it is not finding the QtGlobal header file it needs.

Do you have this file in exactly this location?
/home/bruno/Qt/5.15.1/gcc_64/include/QtCore/QtGlobal

If not, you should download and install Qt from the Qt website and install in your home directory.

If you have gotten this far in the process, you can flop these around so that it quits trying to download the code every time:
ACTION_GET_COMPILE_INSTALL=0
ACTION_COMPILE_INSTALL=1

Thank you for your answer

No ! But I have ~/Qt/5.9.7/gcc_64/include/QtCore/QtGlobal. So I suppose I shouldn’t have followed Shotcut - How To Use the Linux SDK to downloaded “Our special build of the Qt 5.9.7 SDK that includes QtWebKit” ?

I’ll try with Qt v5.15.1

Thanks, I’ll give it a try.
It would be awesome to have some comments after each script config constant to understand how to combine then by the way.

I’ll try this and let you informed.

Thanks again

Unfortunately, that instruction is outdated. No special build required. Just install the Qt build into the location.

Feel free to add some breadcrumbs as you go so that someone in the future can follow them.

Thanks for your patience. It is worth it in the end!

I tried this but I didn’t noticed any difference: I still have to rm -rf ~/shotcut/src/bigsh0t; rm -rf ~/shotcut/src/nv-codec-headers before launching the script to workaround the git changes error, and I’m still waiting for a time (that appears to be infinite :s) for tar --exclude-vcs -cJf /home/bruno/shotcut/src.txz src command to achieve (why a tar is made before compilation ?), then still waiting for h264, libavfilter and so to compile.

The fact that you use a custom script instead of standard tools make the compilation really complex, and the comprehension of the script is really not easy (I hope the main Shotcut code is more documented :wink: ).

Yes I took notes of all that I’ve done to make some notes somewhere. But I’d absolutely not be able to write anything about those script’s globals as it’s really obscure to me.

This makes me think that your configuration file is not working. Please recheck the instructions here:

Setting ACTION_GET_COMPILE_INSTALL=0 will cause it to not download (clone) sources
Setting ARCHIVE=0 will cause it to skip the tar step.

You should have two files in a directory:

  • build-shotcut.sh
  • build-shotcut.conf

Within that directory, run ./build-shotcut.sh
build-shotcut.sh will load the parameters from build-shotcut.conf
Some inspection may be required to determine why that is not working for you.

You should set your expectations now so you are no disappointed later. Shotcut does not have an army of contributors. So there is not a lot of convenience available in scripting and documentation. But Dan and I are happy to help people who put in a reasonable effort themselves (as you are now). We genuinely welcome help in this area.

Shotcut builds do use industry standard tools, but there is no industry standard way to build a C++ project with all of its dependencies across most Linux distributions as well as macOS that is not based strictly on a package system. Yes, there are some things you can do with CMake and Conan, but with just as much as work as this script in my experience.

All you really need to hack on Shotcut is a rather complete installation of MLT and frei0r based on their latest release versions and Qt 5.12 or higher. That is the primary reason I discontinued the Linux SDK after dropping the esoteric WebVfx and QtWebKit dependencies. With that out-of-the way most developers on Linux do not work a SDK but rather distro packages. Unfortunately, many Linux distributions are slow to provide the latest MLT version, and many users are not running a rolling or bleeding edge distro version. Debian testing and unstable and Arch has it but not Ubuntu.

Often another way to get the latest MLT if you do not have it, is to install all of MLT’s build dependencies using something like apt build-dep libmlt6 and then manually compile and install MLT.

Shame on me (really!) I thought I tried to run the script in the same directory as the conf file but I don’t know, I missed something maybe.
Indeed going on the same directory makes the script find the config file and I can now have a more quick compilation process :slight_smile: Thanks

So this is an important thing to note for newcomers: the script is intended to be started from within script/ sub-directory. I presume this is not a good idea to run ./scripts/build-shotcut.sh -c scripts/build-shotcut.conf from the project root ?

So ACTION_GET_COMPILE_INSTALL have no effect on controlling any compilation if I got the point ? (I had a look to the script source code, in set_globals(), I’ve seen that

  • a combination of ACTION_GET_ONLY and ACTION_GET_COMPILE_INSTALL controls GET that controls the call of get_all_sources()
  • a combination of ACTION_GET_COMPILE_INSTALL and ACTION_COMPILE_INSTALL controls COMPILE_INSTALL that controls the call of configure_compile_install_all() that configures, compiles, and installs all subprojects
ACTION_GET_ONLY ACTION_GET_COMPILE_INSTALL ACTION_COMPILE_INSTALL => GET COMPILE_INSTALL
0 0 0 0 0
0 0 1 0 1
0 1 0 1 1
0 1 1 1 1
1 0 0 1 0
1 0 1 1 1
1 1 0 1 1
1 1 1 1 1

I’m right ?
Sorry for this long message but I don’t want to miss something here, but I don’t understand why is there 3 boolean variables to control only 2 quite simple steps:

  • get_all_sources()
  • configure_compile_install_all()

I suppose this is for historical reasons, no offence ! But maybe could I suggest a PR to merge those 3 variables onto 2:

  • GET_ALL_SOURCES
  • CONFIGURE_COMPILE_INSTALL_ALL

What do you think about ?

I have never done that. Kind of makes a chicken/egg situation. How do you run the script before you have downloaded it?

Your understanding is correct. And yes, it is historical.

In my mind, there are three steps:

  1. Get sources
  2. Configure sources
  3. Compile and install

I recently added the “CONFIGURE_SOURCES” flag so that I could do #3. The script has evolved over time and since it works for me I have not made it a priority to improve the logic.

Were you able to make a successful build and run Shotcut?

Today, I worked on the build script to add a new dependency dav1d. I consolidated actions, renamed SOURCES_CONFIGURE, and removed the unmaintained INSTALL_AS_ROOT option. Now, the options look like:

ACTION_GET=1
ACTION_CONFIGURE=1
ACTION_COMPILE_INSTALL=1

We also have the following options that could be considered steps or actions that changed:

CLEANUP => ACTION_CLEANUP
ARCHIVE => ACTION_ARCHIVE
SOURCES_CLEAN => ACTION_CLEAN_SOURCE

The order is

  1. ACTION_CLEAN_SOURCE (only acts on previously “GET” sources)
  2. ACTION_GET
  3. ACTION_CONFIGURE
  4. ACTION_COMPILE_INSTALL
  5. ACTION_ARCHIVE
  6. ACTION_CLEANUP
2 Likes

Thanks you @shotcut. I didn’t had time to jump onto this for some days now. I’m using Shotcut as an user those days to finish an animation film made with children. (you probably noticed our long discuss around Del key in this Github issue).

Not for now ! I didn’t had time to continue on this.

I’ll keep you informed !

This topic was automatically closed after 90 days. New replies are no longer allowed.