Avidemux Forum

Avidemux => Windows => Topic started by: KoolAidMan on November 25, 2014, 07:36:45 AM

Title: Quick guide to Avidemux development
Post by: KoolAidMan on November 25, 2014, 07:36:45 AM
QuoteHi, KoolAidMan

Your recent spurt of development work to include the x265 encoder in avidemux is facinating.
I look forward to a release from mean that includes all your efforts.

I noticed from one of your reactions in another thread, that you have tried to compile avidemux under windows.
I am currently trying to do that, using MinGW, and running the bootstrap.bash script in a MSYS CLI shell.
Obviously the avidemux build environment works under linux but porting it to a quasi windows build environment throws inconsistencies.

Unfortunately, I know nothing about linux, unix shells, C, C++, Cmake etc and so this whole thing is like a foreign language to me.
Each issue is therefore quite an effort to unravel.

After you complete this H265 intergration exercise would you be willing to set up a buildroot under windows, and see the issues that I am getting. They are probably much much easier for you to resolve.

You may ask why I am even trying to do this without the appropriate programming credentials.
Well - its a good way to learn new programming skills (I do have some old school skills!).
And - A windows native debugger for Avidemux might shed some light on avidemux-windows only issues (eg unhandled segmentation fault caused by fast forward/reverse on HD streams).

Anyway I am just asking.

Aquar

In order to develop avidemux, you will need a decent computer. My most precious resource is RAM, which I can use a lot of when I am debugging. I have windows installed; however, I do not develop avidemux in Windows. The reason being, one of the most useful tools in my debugging arsenal is valgrind (http://valgrind.org/ (http://valgrind.org/)), which is available only in Linux. In order to develop avidemux, I do the following:

Installing the virtual machine:

Eject the virtual DVD and reboot your VM.

Updates and Guest Additions

You will have to reboot your VM now. It is recommended that you actually shut down the VM and cold boot to ensure the hypervisor is working properly with the guest additions.

Preparing your development environment:

Now that you have all of the dependencies, you need an IDE to develop (or, you could just use gedit). You can use whichever IDE you want, but I would recommend netbeans.

Preparing your IDE:

To open a project in netbeans, go to File > New Project and select C/C++ Project with Existing Sources. Browse to any directory with a CMakeLists.txt file AND BE SURE TO SELECT CUSTOM CONFIGURATION MODE BEFORE PRESSING NEXT. Also uncheck the box "Run the 'configure' Script after Finish". If you do not select custom configuration mode, netbeans will not do the right thing and will cause you a world of pain. On the next screen, clear the "Configure Arguments" textbox. You can then continue to press next until it is configured. I would not recommend you compile avidemux from the IDE (although you could configure it to do so), instead, compile from the shell.

Compiling avidemux:
Go to the cloned directory in the terminal and simply run bash bootStrap.bash. You can also run bash bootStrap.bash --help for additional commands, including compiling specific components and compiling a debug build.
Once it has compiled, you can install avidemux by executing sudo cp -R install/usr/* /usr/. You can repeat that command as many times as you would like. The application will be available in your PATH as avidemux3_qt4.

If you are unable to compile, it is probably because you did not select custom configuration mode when configuring netbeans, and netbeans has created a lot of garbage CMake-related files. You should be able to revert this by typing git reset --hard in your workspace. Note this will undo any pending changes you may have.

Debugging avidemux:
In order to debug avidemux, you must run bash bootStrap.bash --debug. Then deploy the debug dlls as you did above. There are many wonderful tools for debugging; however, these are my two favorites:

One more thing: Have you ever used git grep? It is awesome for finding whatever I need in the avidemux repository fast.

Thanks, and let me know if you all have any additional questions, comments, recommendations, or things you might do differently.
Title: Re: Quick guide to Avidemux development
Post by: mean on November 25, 2014, 08:54:23 AM
you might also want to install ccache
That speeds up rebuilding from scratch a lot
Title: Re: Quick guide to Avidemux development
Post by: KoolAidMan on November 25, 2014, 08:59:23 AM
Quote from: mean on November 25, 2014, 08:54:23 AM
you might also want to install ccache
That speeds up rebuilding from scratch a lot
Oh wow! This is a life-saver. Thanks! I have added it to the original post.
Title: Re: Quick guide to Avidemux development
Post by: AQUAR on November 26, 2014, 10:23:44 AM
@ KoolAidMan

Thanks for that very generous response.
The detailed explanation of your build environment will help any member here trying to build/debug avidemux from  source. And it is a great wiki augmentation that covers this topic.

I have a little bit of familiarity with linux (Ubuntu) by way of running an OpenWRT port for my Mvix NAS box.
(That port was done by a Frenchman with a tiny bit of input from me - http://opengemini.free.fr/wiki/doku.php?id=start.)

My first objective really is to see the complete work flow involved with the build process.
Since I am stuck at the moment with the MinGW/Windows project, I will try your way as a parallel exercise.
(Probably by multibooting to fedora on a separate HDD !).
I am sure this will also generate plenty of noob problems - but with a common operational platform it will be easier to help out.

Ultimately I want to avoid cross compiling the windows versions ( like in the days of avidemux 2.5).
(But I'll keep that discussion to http://avidemux.org/smuf/index.php/topic,16289.0.html.).
Title: Re: Quick guide to Avidemux development
Post by: KoolAidMan on December 13, 2014, 06:22:23 PM
Updated guide for Fedora 21...
Title: Re: Quick guide to Avidemux development
Post by: AQUAR on December 15, 2014, 12:08:21 PM
It takes a bit of patience to become familiar with virtualbox and fedora.
(it's kind of strange for a windows user!)

I tried the live desktop version but it seems to be a bit of a "look see but don't use" edition.
Suggest to go straight to the full DVD iso and work with that.

There is a Gnome tweak utility that I installed to get some familiar "windows" features (like windows minimise & maximise on title bar!).

Will have to make a new VM for fedora 21 now.
Title: Re: Quick guide to Avidemux development
Post by: AQUAR on December 16, 2014, 11:03:43 AM
@ KoolAidMan

What happened to the "sudo debuginfo-install" component of the guide?
Is it not needed with fedora 21?

Appears a full install DVD is no longer made for fedora post v20.
If I understand I now need the server edition and need to rumage the repositories to get to a full install.
Title: Re: Quick guide to Avidemux development
Post by: KoolAidMan on December 17, 2014, 02:29:00 AM
Quote from: AQUAR on December 16, 2014, 11:03:43 AM
@ KoolAidMan

What happened to the "sudo debuginfo-install" component of the guide?
Is it not needed with fedora 21?

Appears a full install DVD is no longer made for fedora post v20.
If I understand I now need the server edition and need to rumage the repositories to get to a full install.

It changes too often to keep in the guide. Just run gdb. It will tell you what debuginfo you need to install. Also, the workstation version of fedora should be adequate for development.
Title: Re: Quick guide to Avidemux development
Post by: AQUAR on December 17, 2014, 05:02:05 AM
Okay - Thanks,

Since fedora v20 refused to restart after doing various installs, I have to restart with a new VM anyway.
Title: Re: Quick guide to Avidemux development
Post by: AQUAR on December 24, 2014, 03:54:35 AM
After a bit of familiarisation with Virtualbox and Fedora, then following KoolAidMan's Guide.
Its a case of "so far so good" with the build environment creating a working linux avidemux out of the box.

The Git Cloning was painfully slow/unresponsive (took 3 tries to clone the avidemux branch!).

It would be good if the quick guide could be extended with some info about crosscompiling to windows.
Eg which Mingw-w64 packages are to be installed from the repositories plus dependencies for cross building ADM.

- For now I am just trying to duplicate what was needed by the windows native build environment.
-- starting with the 32 bit and 64 bit gcc and c++ crosscompiler and all the dependencies that these invoke.

Also I found that Yumex and GnomeTweak were usefull Dl's from a windows user operability perspective (we are spoiled with GUI's!).