Avidemux Forum

Avidemux => Windows => Topic started by: AQUAR on November 01, 2014, 12:16:09 PM

Title: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 01, 2014, 12:16:09 PM
Has anyone build Avidemux 2.6.x using MinGW lately?

There are a few issues with the crosscompiled windows version of avidemux.
I am curious if they still would exist if avidemux was build with this more native build environment.

If it has been successfully done before, I could try it (with some help!).
There is also the debugger that might help shed some light on such issues.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on November 01, 2014, 12:52:53 PM
If you did not see this: avidemux wiki: Microsoft Windows.: This is a guide to building Avidemux from SVN in Microsoft Windows. It is intended for people who are familiar with compiling software but not necessarily using MinGW. (http://www.avidemux.org/admWiki/doku.php?id=build:compiling_avidemux#microsoft_windows)
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 02, 2014, 01:07:47 AM
Yes I've read the guide but have the impression it was written back in the days of Avidemux 2.5x.
For example: there are some URL's to fetch dependencies that point to 404's (no longer exist!).

I've DL MinGW (looking for the debugger!).
Time permitting I'll set it up and see what issues will crop up.
If esoteric issues do crop up to get to a working windows build platform, then I will be out of my depth.
Hence the reason why I was asking if others have paved the way.
 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 02, 2014, 07:12:47 AM
It should work with mingw still
The thing is that EVERYTHING must have been built with the same compiler / libc/libstdc++
else you'll have weird crashes
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 02, 2014, 10:18:12 AM
I'll give it go on and see how far I get without pulling my hair out.
It won't be quick due to time constraints, having to relearn how to do this, and my now aging mind.

Last time I did any compiling was 20 years ago, on a turbo pascal program I wrote.
A reliability/availability program using Markov models (modelling creates a set of non linear differential equations - Kolmogorof equations).





Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 06, 2014, 05:51:18 AM
In case any windows based members are interested in this topic and want to join in.
 
No real problems, installing MinGW and the MSYS unix like CLI shell, using the installer from the MinGW site.
I was able to compile the "hello world" program but only after sorting out some issues with windows 7 Path variables .

Problem 1:

Seems windows 7 doesn't like Path variables in the User environment.
Instead I had to add the MinGW/MSYS paths to the Path variable in the System Environment (not the best idea!).

Even then the assembler was unable to find library entry points called for by the simple "hello world" program.
Problem here being that on my system there are various programs that also include these libraries.
The assembler finds these instead, unless in the Path variable string you shift the position of "MinGW/bin" to be ahead of these other program path entries.

In turn that broke the functioning of some of these other programs.

Problem 2:
The original MinGW project doesn't include QT which is one of the windows Avidemux dependencies.
The avidemux developer (J. Mean) made one thing clear in that everything needs to be compiled with the same compiler.
So I either compile QT with this version or maybe better - apparently QT is available as a binary that comes with a compatible MinGW (If I understand it correctly!).

Problem 3:
The original MinGW project is also only for 32 bit systems.
But there is a fork MinGW-w64 (for 32 bit and 64 bit systems) that seems more suited for this task.

So it seems I picked the wrong MinGW and also a too cluttered OS to create the avidemux/windows build environment.

Hence, I'll have to start again and better do it on a fresh windows 7 SP1 64 bit system (the KISS princple!).
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 06, 2014, 07:08:58 PM
The mingw64 version is better
Warning, you'll probably need to recompile QT
It's not difficult, it just takes forever
Title: Re: Building Avidemux 2.6x with MINGW
Post by: pitoloko on November 08, 2014, 02:42:45 AM
This is to try to solve the forward/backward problem I'm right?

A brief guideline is possible to those newbies like me who are not experienced with Linux and all what is related about that such as compilling under Windows using mingw ?

@Aquar talked about the problems, but for example someone could link the proper urls to download the software requisites to accomplish this task and explain how to compile it.

1. Is this the right Avidemux source that I should download?
http://sourceforge.net/projects/avidemux/files/avidemux/2.6.8/avidemux_2.6.8.tar.gz/download

2.  Is this the right MingW version that I should download?
http://sourceforge.net/projects/mingw-w64/
http://sourceforge.net/projects/mingw-w64/files/latest/download?source=files

3. Is this the right QT version that I should download?
http://download.qt-project.org/official_releases/online_installers/qt-opensource-windows-x86-1.6.0-5-online.exe

4. I should use the default installer config options when installing MingW or I select x86_x64 arquitecture?

5. What to do next about this task to compile AviDemux, and how?.

I'm under Windows 8 and 8.1 x64.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on November 08, 2014, 04:09:31 AM
Once you have this working, perhaps switching source code to git clone https://github.com/mean00/avidemux2.git
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 08, 2014, 07:07:04 AM
Thanks Jan.
Mean seems to have settled on Github following the Berlios reorganisation.

Its nice that Github has a few options for cloning the source code repository.
Will try the SVN method!.
 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on November 08, 2014, 02:58:43 PM
I think it would be prudent to stay with QT 4.8.6, unless mean tells you otherwise ;)
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 09, 2014, 01:28:51 AM
I did wonder about that, whilst looking through various scripts in the source code.
Means comment, that I will probably need to recompile QT, suggests that as well
(ie - only since QT 5 that MinGW installer versions became available with QT 5 bundled as a binary).

I am certain I will make lots of false starts in setting up this windows based build environment.
Unavoidable on account of the steep learning curve (don't know much about C++, nor much about the modern programming methodology).
The fresh windows install is just for this project and will be configured for quick regression/recovery.
Plan is to break it down in small steps (try it - fix it - seek help if needed - move on).

Also send grunster a private email for help - just on the off chance he has some free time and willing to do that.
Hopefully he occasionally reads his avidemux emails.

 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 09, 2014, 11:39:58 AM
Gruntster did write a small doc about that
Not sure where it is now
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 10, 2014, 01:29:33 AM
That would be another very helpful document.
The Wiki and the PDF from Grant Pedersen (very similar content) are also very useful.

If any member has a copy of Gruntsters doco - would you please share.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 11, 2014, 10:52:44 AM
It might be interesting if I add an occasional progress update (dot summary format) on this thread.
These will be from a totally green perspective, so will be low in techno babble and full of setup mistakes.

Try 2:
. Installed a fresh windows 7, SP1, 64 bit, onto a SSD, and created a multiboot to it.
. With earlier comments in mind (same compiler for all, QT 4.8.6, 64 bit OS etc) I DL these:
  From the QT site:  qt-4.8.6-x64-mingw482r3-seh-rev1.exe (turnd out to be a POSIX threading model)
  From sourceforce: msys+7za+wget+svn+git+mercurial+cvs-rev13.7z
. From these 2 packages I installed the QT binaries and the included MinGW (used to compile these QT binaries).
  Extracted the msys package that seems to include lots of the packages needed by the build system.
. Used SVN from the msys package to checkout the trunk branch of avidemux2 source from the github repository.
  (It got cloned in the \home\user virtual directory structure of MSYS - not sure if that is the desired location)
. Tested the helloworld program after adding all the Path variables in the windows environment variables GUI.
. G++ compiled the helloworld okay (I was amazed!).

Now it gets hard as I have no idea yet how to configure this all for building avidemux.
Judging from the avidemux wiki there is a lot of preliminary stuff to digest.
I did find one cmakelist.txt (probably not where it  begins!).

Next I will check-off all the dependencies listed in the WIKI (hope that this list is still valid for V2.6).   

 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on November 12, 2014, 05:54:35 AM
most likely (pure guessing): you need to edit and adapt to your environment:
- bootStrapCrossMingw
- bootStrapCrossMingw_w64
- bootStrapCrossMingw_w32
probably use only one of these w32 or w64.

see response below
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 12, 2014, 06:42:06 AM
dont use the cross ones
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 12, 2014, 10:36:16 AM
@ Jan - Pure quesses are most welcome (at the very least they are usefull food for thought!). 

Thanks for the hints.
There are 25 shell scripts in trunk and of these it seems the bootStrap.bash script is the one I should play with.
I tried it just to see what would happens - of course the build process failed very quickly (no cmake!).
After cmake the check for pthreads fails (just another item needed as listed in the wiki dependency list!).
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 13, 2014, 11:10:58 AM
Try 2 continued:

- The bootstrap.bash seems to be for building as well as creating installable linux packages.
----Only interested in the building element for now (ie ignoring the rest of the script).
----By running this script it will give some insight and it will also throw up the next missing dependency to be fixed. 
----Will worry later about building these dependencies from source (for proper compiling of avidemux).
- First missing dependency Cmake - got it from Cmake.org.
- Next missing dependency is Pthreads - DL the latest pthreads-w32-2-9-1-release.zip (as it has 64 bit binaries!).
----Cmake wouldn't find pthreads (tried various other releases but no go!).
----Tried to compile a popular pthreads "helloworld" program to see if G++ sees pthreads (at first it failed, needed long long integer values!).
----G++ sees Pthreads but Cmake does not (prefex issue that I don't quite understand yet).
----Quick fix for Cmake is to add some more environment variables (LIB, LIBPATH and INCLUDE) in "system settings"
----It now sees Pthreads (probably these environment variables can be placed in code somewhere!).

A lot of googling to fix each tangent problem that pops up (the steep learning curve!).   
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 16, 2014, 04:02:03 AM
Try 2 continued:

The last few items that CMake wants are:
- Gettext.exe plus associated libintl.dll (from GTK+ bundle)
- SDL from libsdl.org
- SQLite (from sourceforce winbuilds64 packages)
---- winbuilds64 packages downloadable using a package manager yypkg.exe!)
- last one is YASM (bundled in with mingw-w64-bin-x86_64-20140529) 
- Missing still is execinfo.dll
---- execinfo.dll seems to not be available.
---- best I can establish its a backtrace debugging item

Now Cmake creates makefiles with all these frankenstein sourced dependencies.
Of course make fails with error2 - but at least its a bit of a start to see the bootstrap.bash script process in action.
Pushing the envelope with "make install" does create some object files! 

Not sure about the next step.
- try make -i and see what happens (just learned about the -i parameter!)?
- maybe try compiling some of these frankensteins?
- maybe simpler to try the build environment on 32 bit windows (better support!)?
---- noticed void cast warnings as in the Pthreads helloworld test program (integer range problem?)

 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 16, 2014, 07:26:03 AM
2 options
1- Make sure you used the MSYS generator
2- Generate a codeblocks project and use codeblocks
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 16, 2014, 11:07:46 AM
Thanks mean.

After a quick google on these two options.
- these are build generator options you specify to Cmake with the -G parameter.
- tested these two options via the CMake GUI on the cmakelist.txt (in avidemux_core!)
--- with msys generator and G++  options it generated a bunch of makefiles into a test folder.
--- with codeblocks it finds sh shell and stops.
--------- renamed the sh.exe and it still fails with invalid project files (need to dig more about codeblocks projects!).
- the bootstrap.bash file has a BUILDER string variable set to "Unix Makefiles".
---- guess that would need to change to "MSYS Makefiles" (first mod for the windows environment!).
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 16, 2014, 12:19:40 PM
Try 2 continued:

- Changed the Bootstrap.bash script to set the CMake build generator to "MSYS Makefiles".
--- Make files get build as before and is followed by 'make fails'.
--- A quick look at the log file for the make process shows "does not name a type" kind of error on header files.
------- eg on avifmt.h, ADM_colourspace.   
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 17, 2014, 12:08:42 PM
An interesting newbie trap for those using SVN to make a local clone of the avidemux code branch.

Yesterday the bootstrap.bash script created make files.
Today it failed at CmakeZ (not sure what the Z is for!).
Eventually I worked out that the problem was due to a failed check for SCM (because it could not resolve github.com).
Now I used svn to DL the avidemux source from github.com and it un beknown to me it comes with this SCM (System Control Management) item.
So it seems that SCM requires a live internet connection - but I disabled my network card - and hence the bootstrap.bash script failed.

I deleted all hidden .SVN folders from my test copy of the source code branch (trunk).
It now works again without being connected to the net.
There is probably a proper way to configure this SCM feature so it doesn't want to check for changes to the code.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 20, 2014, 12:25:29 PM
Try 2 continued:

- Very slow progress as I have to learn how to interpret the error messages in the logbuildCore text file.
----- That in turn leads me onto all sorts of tangents about C++ and header files.

- Currently looking into issues with avifmt.h from the mingw-w64 runtime package.

- The first message about avifmt.h is:   
c:/AvidBuild/mingw64/x86_64-w64-mingw32/include/avifmt.h:2:8: error: expected constructor, destructor, or type conversion before 'file'
 * This file is part of the mingw-w64 runtime package.
          ^
c:/AvidBuild/mingw64/x86_64-w64-mingw32/include/avifmt.h:3:25: error: 'refer' does not name a type
 * No warranty is given; refer to the file DISCLAIMER within this package.
                                      ^
----- Turns out this is due to a missing / at the beginning (needed to block comment out the first 4 lines!).
----- Did not expect that from a MinGW package.

- In turn a new "second" message about avifmt.h appears:
C:/AvidBuild/mingw64/x86_64-w64-mingw32/include/avifmt.h:13:1: error: expected unqualified-id before 'extern'
 extern "C" {
 ^
----- No idea about that so far (looks fine with my limited ability!)
----- Might delete extern "C" and see if C++ will cope?
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 20, 2014, 04:46:20 PM
Looks like a comment has been damaged, it's trying to compile a comment
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 21, 2014, 01:33:34 AM
There seem to be are a few issues with avifmt.h.
After fixing the damaged comment the MinGW compiler then found the next issue in avifmt.h.
This being, it won't recognise the extern "C"  directive .

It seems that this extern "C" issue has cropped up before with MinGW but I am not understanding the techno babble around it.
One suggestion was to remove it (that I understand!) and I will try that.

If I have a corrupt avifmt.h then it might be indicative of other corrupted files in the package.
So I will try another MinGW source without the precompiled QT package.
Assuming I can run the bootstrap.bash with the --without QT option and in the absense of QT binaries (I'll soon learn!). 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 21, 2014, 06:33:28 AM
is it using g++/c++ ?
Extern "C" is a valid c++ stanza but not a C one
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 21, 2014, 08:19:10 AM
One of the definition files that includes avifmt.h is ADM_coreUtils/src/avidemutils.cpp
Looking at the logfile MinGW uses the g++ compiler for that definition file.

The compile process switches between gcc and g++ (I guess based on the file extentsion!).
FFMPEG code seems to be done with gcc.

I checked other releases of MinGW W64, and they are all propagating the same avifmt.h file (with the corrupted block comment).

I'll try to modify the helloworld program with an extern "C" directive and see how MinGW reacts with gcc and g++ (to see if it is recognized).
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 21, 2014, 10:45:02 AM
you shouldnt have to do all this
Something is wrong
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 21, 2014, 12:09:21 PM
Hi Mean,

For sure something is wrong (mostly me learning everything about issues I encounter on the fly).
Eg, I just learned that the extern "C" (wrapped in "#ifdef __cplusplus") is intended to prevent name mangling, when including headers that link to libraries compiled with C.

I still tried it in on a C++ hello world program - neither gcc or c++ cares if I wrap it with extern "C" - still compiles fine.
Its not the extern "C" directive per se but something that is preventing its use.

There was a similar kind of thing described here  http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/355154.aspx
I need to understand what the techno babble is about so I can see if it applies here.

I did write to Gruntster and Lord Mulder for help in setting up a windows build-environmemt, but they haven't replied.
I think avifmt.h maybe a winapi item concerning video for windows (as it includes winapifamily.h)!.

Also, I read in the forum that Gruntster was using codeblocks, so  maybe using that IDE is a better approach.
Without them I'll stick to running the bootstrap.bash script using the shell CLI provided by MSYS (that should be do-able!).

 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 23, 2014, 06:24:49 AM
Try 2 continued.

. I could not work out the issue with the extern "C" directive in avifmt.h, so I removed it.
-- hopefully g++ will compile the code wrapped inside the extern "C" without causing name mangling.
-- only thing I can postulate is that extern "C" is already being applied and so the second directive is not recognised a C stanza.

. The compile process now goes a lot further and creates a lot of binaries in a newly created install folder.

. Eventually it snags with a cmake error.
-- CMake Error at C:/AvidBuild/msys/home/John/trunk/cmake/admFFmpegUtil.cmake:2 (FILE):
  file failed to open for reading (Invalid argument):
-- admFFmpegUtil.cmake:2 is
    FILE(READ "${headerFile}" FFMPEG_H)
-- That line is part of a macro that I think parses a file for information.
-- No idea how to interpret that cmake line, but maybe its not looking at the right file.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on November 23, 2014, 02:06:57 PM
make sure you have "patch", tar, gzip and gunzip installed
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on November 24, 2014, 03:59:10 AM
During bootstrap.bash the script checks for patch and tar passed.
gzip.exe exists in the MSYS bin folder along with a gunzip file with no extension.
gunzip also responds in the MSYS shell (probably invokes gzip -d).

Not sure if separate gunzip.exe still exists after consulting dr Google.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 03, 2014, 11:50:20 AM
Still trying to get past this Cmake error.

Problem is presented as:

CMake Error at C:/AvidBuild/msys/home/John/trunk/cmake/admFFmpegUtil.cmake:2 (FILE):
  file failed to open for reading (Invalid argument):

admFFmpegUtil.cmake:2 is a line in a macro:

MACRO (getFfmpegVersionFromHeader description headerFile definition ffmpegVersion)
   FILE(READ "${headerFile}" FFMPEG_H)
   STRING(REGEX MATCH "#define[ ]+${definition}[ ]+([0-9]+)" FFMPEG_H "${FFMPEG_H}")
   STRING(REGEX REPLACE ".*[ ]([0-9]+).*" "\\1" ${ffmpegVersion} "${FFMPEG_H}")
ENDMACRO (getFfmpegVersionFromHeader)

The variable called "headerfile" holds the following path name:
C:/AvidBuild/msys/home/John/trunk/install/C:/AvidBuild/msys/include/avidemux/2.6/libavcodec/version.h
(don't know how to interpret this unix path, but it appears to be short hand for 2 actual windows paths)

The header file "version.h" exists in these two windows folder:
 C:\AvidBuild\msys\home\John\trunk\install\AvidBuild\msys\include\avidemux\2.6\libavcodec
 C:\AvidBuild\msys\include\avidemux\2.6\libavcodec

It seems to me that:
Either syntax in the macro is not understood by Cmake (unlikely) or
That unix path name is problematical in a unix shell simulation under windows or
Who knows?

Also replacing ${headerFile} with an absolute path to either version.h header file ,breaks the build process.
Kind of expected that but worth a try. 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on December 05, 2014, 10:00:04 AM
Possible cmake version issue? Can't tell my used version. Probably 2.8.10? I'll be back next week.
See reply by ajschult in CPack Error earlier.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 05, 2014, 11:31:24 AM
I am using Cmake-3.1.0-rc1-win32-x86.
If the code requires the earlier/stable release of Cmake, then hopefully that is the root of the problems I am getting.

Easy enough to test it out.

Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on December 05, 2014, 11:45:30 AM
Hope lower version solves issues. rc (release candidate) is always a warming for me.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 05, 2014, 11:55:43 AM
I am Dling V2.8.10.2 and V2.8.9 and will see how these versions behave.

Update:
Same result with cmake V2.8.9.
I wonder if its some windows access issue.
Interestingly, with cmake V2.8.9 the extern "C" problem (mentioned earlier) is gone.
(surely cmake has no impact on how g++ interprets cpp code!).

Also running bootstrap.bash --without-qt --without-plugins will complete the core build.
But, just --without-qt or just --without-plugins and Cmake gives the same error.
So I am half way there (just need qt and plugins to get past this read error!). 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 06, 2014, 08:09:15 AM
Just a question:
Is the normal build environment on 32 bit Linux or 64 bit Linux?
I am obviously doing this on 64 bit windows, but could try 32 bit (simplify locations of executables).
Title: Re: Building Avidemux 2.6x with MINGW
Post by: mean on December 06, 2014, 10:58:04 AM
all are supported
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 07, 2014, 03:24:53 AM
Thanks mean.

There is a thread here that presents the same read error,
viz http://avidemux.org/smuf/index.php/topic,10702.0.html - reply 13.
From what I can glean - the issue seems to have been resolved by going to Cmake 2.8.
But, Ive tried 2.8.7 and up to the latest RC but that hasn't resolved the read error.
So something else must also be at play here - maybe the version of GCC?.
Again I've tried some versions of GCC - currently using 4.9.2 - all giving the same read error result.

If some members can give me some combinations of GCC/Cmake that works for them, I'll try it out.

Another observation:
admFFmpegUtil.cmake has this read statement FILE(READ "${headerFile}" FFMPEG_H)
When the variable "headerfile" holds a normal (proper!) absolute path to some version.h header file, everything proceeds fine.
But when it gets to the libavcodec version.h file this variable has a (to me!) strange path name viz,
there are actually two C:\ entries in the one path (on windows that isn't proper as C:\ is a device root directory!).
Almost seems like that this variable isn't wiped/cleared properly?
I presumed it was a unix shorthand for 2 path names but haven't been able to verify that.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 09, 2014, 09:40:51 AM
I've verified that the read error is due to the strange path name (ie with rogue extra C:) .

By trapping that strange path name and replacing it with the proper path name and running bootstrap.bash --without-core --without-plugins the build process reads the version.h file and the process moves on.
It fails at the next issue viz Cmake_Install_Prefix does not including some folder/file (probably another misnamed directory path!).

Starting to think Cmake is borked with the MSYS generator.

Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 11, 2014, 04:18:28 AM
Try 2 continued.

Well, the good news is that I can "sort of" build an avidemux with Mingw W64 and MSYS on windows 7 - 64 bit.
The bad new is that it fails to playback the video files (but renders the individual frames) and I've broken the process.
The install directory has become fragmented and missing various run time libraries (from the package depenencies).
Not tried anything else with frankenADM!

Please note: I am way out of my depth with going through the code and attempting to bypass issues, any help would be most welcome.

The strange path name issue:
The MSYS shell echo's these 2 lines
AVIDEMUX_SEARCH_INCLUDE_DIR: C:/AvidBuild/msys/home/John/trunk/install/C:/AvidBuild/msys/include
AVIDEMUX_SEARCH_LIB_DIR    : C:/AvidBuild/msys/home/John/trunk/install/C:/AvidBuild/msys
Note the extra C:/ in the path name that causes trouble during the building of QT and Plugins.
These Cmake variables are set in the adminstallDir.cmake cmake file and are to do with the fake root install folder.
This is the code:
Code: [Select]
IF(NOT FAKEROOT)
SET(AVIDEMUX_FAKEROOT "")
else(NOT FAKEROOT)
SET(AVIDEMUX_FAKEROOT "${FAKEROOT}/")
endif(NOT FAKEROOT)
SET(AVIDEMUX_SEARCH_INCLUDE_DIR ${AVIDEMUX_FAKEROOT}${AVIDEMUX_INCLUDE_DIR})
SET(AVIDEMUX_SEARCH_LIB_DIR     ${AVIDEMUX_FAKEROOT}${AVIDEMUX_LIB_DIR})
These paths variables are responsible for the read error later on in the building (at least under windows!) simply because they append 2 path names together starting with the same root directory "C:/", and that doesn't resolve under windows (probably okay with the linux virtual directory approach). I presumed that MSYS would take care of these pathing differences but it seems not.

After a quick study of Cmake, there is this REGEX REPLACE command that lets me get rid of the extra C:/ viz;
Code: [Select]
IF(NOT FAKEROOT)
SET(AVIDEMUX_FAKEROOT "")
else(NOT FAKEROOT)
SET(AVIDEMUX_FAKEROOT "${FAKEROOT}/")
endif(NOT FAKEROOT)
STRING(REGEX REPLACE "C:/" "" AVIDEMUX_INCLUDE_DIR ${AVIDEMUX_INCLUDE_DIR})
STRING(REGEX REPLACE "C:/" "" AVIDEMUX_LIB_DIR ${AVIDEMUX_LIB_DIR})
SET(AVIDEMUX_SEARCH_INCLUDE_DIR ${AVIDEMUX_FAKEROOT}${AVIDEMUX_INCLUDE_DIR})
SET(AVIDEMUX_SEARCH_LIB_DIR     ${AVIDEMUX_FAKEROOT}${AVIDEMUX_LIB_DIR})

Doing this the build still fails by pointing to the wrong "AVIDEMUX_INCLUDE_DIR" in the fake root directory.
So I have to build core first, relocate that folder to where it is pointed to, then proceed with building QT/Plugins.
Even then its inconsistent in what it will build?
Removing the "C:/" is probably akin to deleting a path layer and causes these issues.

Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 12, 2014, 09:43:21 AM
Try 2 continued  :).

. Since the build process complained about using an older version of C, I've updated the Mingw package.
  It now uses gcc version 4.9.2

. Whilst doing build trials, I regressed to Cmake version 2.8.0 (made no difference except something about fakeroot!).
  I've now reverted back to Cmake 2.8.10v2.

Thankfully the build process now actually generates a working avidemux (of course still with the fiddles mentioned).

Next, how to compile in the optional audio and video encoders.
The wiki does have some older stuff on this, but no idea if that is still appropriate.
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on December 12, 2014, 10:25:52 AM
Most are internal (provided by mean).
Building in terminal window, should show found or not found and would indicate what is there.
You might need to install any not found separately.
Search for logs:  logbuildCore, logbuildQt4, logbuildCli, logbuildPluginsCommon, logbuildPluginsQt4, logbuildPluginsCLI. in each search for Error 1 if build fails.

terminal info while build:
buildCore:
Code: [Select]
...
**************************
***  Optional Library  ***
***      Summary       ***
**************************
*** Miscellaneous      ***
    gettext        Yes
    SDL            Yes
    XVideo         Yes
    VDPAU          Yes
    LIBVA          Yes
...
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on December 12, 2014, 10:41:35 AM
more from terminal while build:
Code: [Select]
-- Checking for Qt 4
-- *****************
...
-- Checking for x264
-- *****************
...
-- Checking for x265
-- *****************
-- Checking for FreeType2
-- **********************
...
**************************
***  Optional Library  ***
***      Summary       ***
**************************
*** Video Encoder      ***
    x264           Yes
    x265           Yes
*** Miscellaneous      ***
    OpenGL         Yes
    FreeType2      Yes
    FontConfig     Yes
    FRIBIDI        Yes
    FontConfig     Yes
*** User Interface     ***
    Common         No
    GTK+           No
    Qt 4           Yes
    CLI            No
...
should be something similar for windows
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 12, 2014, 11:53:14 AM
Yes it is much the same under the Msys terminal.

The Library Summary shows that I do not have a lot of these optional libraries available in my OS.
Presumably these DLL and their header files need to be placed in BIN and Include folders that are findable by the buildroot.
I hope it automatically looks for them, or that there is a config file to enable the lookup for these options.

I will try the Mingw BIN and Include folders as these are already in the system environment path (I guess globally prefixed!).

Since I've already broken so many rules I just did another no no, pinched them from a nighly build (works - well almost - 99%).
(just giving frankenADM some nuts!)

I am going to create a new setup, starting with the current status - "try 3.
In part to move this from the SSD to a HDD (just a little too much writing/deleting on my small SSD!)
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on December 12, 2014, 02:20:01 PM
I installed the missing programs under ubuntu, presume something same should go in windows
like: libx264-142, x264 video coding library
http://www.videolan.org/developers/x264.html (read me in source)
see also: http://stackoverflow.com/questions/23099999/windows-how-to-build-x264-lib-instead-of-dll
unless mean tells you to do something else ;)
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 13, 2014, 01:15:41 AM
Thanks Jan,

I'll try those approaches and see how/if it pans out under windows.
Working via MSYS, I expect that prefix info is needed to incorporate these libraries.

Pity there are no active member's that have paved the "windows" way.
This was never going to be straight forward (even with Cross platform Make!) without a deeper understanding of the whole avidemux build process.

I'll try a few other ideas about the pathing issues after I comprehend this need for a fake root directory with the fakeroot command.
It seems to me that since fakeroot is not needed by the later CMake versions, there is some fixit scope there.
It's probably a very simple fix with the "knowhow"! 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on December 13, 2014, 12:03:11 PM
Last entry for try 2:
After studying the adminstallDir.cmake file a bit more I trapped out the "C:\" issue just for the
AVIDEMUX_SEARCH_INCLUDE_DIR and AVIDEMUX_SEARCH_LIB_DIR   (by creating an intermediate variable for the regex replace command to work on!).

I'll put the revised code here later (after I clean it up from all the superfluous stuff I put in there!).
Code: [Select]

#
IF(NOT FAKEROOT)
SET(AVIDEMUX_FAKEROOT "")
else(NOT FAKEROOT)
SET(AVIDEMUX_FAKEROOT "${FAKEROOT}/")
endif(NOT FAKEROOT)

SET(adminclude ${AVIDEMUX_INCLUDE_DIR})
SET(admlib ${AVIDEMUX_LIB_DIR})
STRING(REGEX REPLACE "C:/" "" adminclude ${adminclude})
STRING(REGEX REPLACE "C:/" "" admlib ${admlib})
SET(AVIDEMUX_SEARCH_INCLUDE_DIR ${AVIDEMUX_FAKEROOT}${adminclude})
SET(AVIDEMUX_SEARCH_LIB_DIR     ${AVIDEMUX_FAKEROOT}${admlib})
#
MESSAGE(STATUS "FAKEROOT                   : ${AVIDEMUX_FAKEROOT}")
MESSAGE(STATUS "AVIDEMUX_BIN_DIR           : ${AVIDEMUX_BIN_DIR}")
MESSAGE(STATUS "AVIDEMUX_LIB_DIR           : ${AVIDEMUX_LIB_DIR}")
MESSAGE(STATUS "AVIDEMUX_INCLUDE_DIR       : ${AVIDEMUX_INCLUDE_DIR}")
MESSAGE(STATUS "AVIDEMUX_SEARCH_INCLUDE_DIR: ${AVIDEMUX_SEARCH_INCLUDE_DIR}")
MESSAGE(STATUS "AVIDEMUX_SEARCH_LIB_DIR    : ${AVIDEMUX_SEARCH_LIB_DIR}")
#

 
Within that section - the dirty fix it code is:

SET(adminclude ${AVIDEMUX_INCLUDE_DIR})
SET(admlib ${AVIDEMUX_LIB_DIR})
STRING(REGEX REPLACE "C:/" "" adminclude ${adminclude})
STRING(REGEX REPLACE "C:/" "" admlib ${admlib})
SET(AVIDEMUX_SEARCH_INCLUDE_DIR ${AVIDEMUX_FAKEROOT}${adminclude})
SET(AVIDEMUX_SEARCH_LIB_DIR     ${AVIDEMUX_FAKEROOT}${admlib})


If your build environment is not on the "C:/" HDD just replace that part with whatever the HDD mount point.

Now Core, QT4 and Plugins are build in one go (without me shifting folders around!) into the install folder.
The program seems to work okay but not really tested it in detail.

It does complain right at the end with:
make: *** no rule to make target 'install'. stop.     

In the install folder:
I am missing the IL8N folder and various support run time libraries.
Also have lots of dll.a link files in there that arent needed for the final product.
Is this last "make" action to fetch those extras and clean the unnecessary?

Title: Re: Building Avidemux 2.6x with MINGW
Post by: pitoloko on December 23, 2014, 11:42:47 PM
Hi

Two months ago I did a question in this topic, someone could answer me (even those who taken a "last courtesy" on me) ?:
Quote from: http://avidemux.org/smuf/index.php/topic,16289.msg71322.html#msg71322
This is to try to solve the forward/backward problem I'm right?

TL/DR I was confused because inactivity, I've moved these words to the right topic:
Now I see that the topic title changed to "Building Avidemux 2.6x with MINGW" but the OP started talking about the backward/forward  problem (or something related about it)?

While I don't know if the backward/forward is the purpose of this topic, and also I don't have the necessary Linux skills, I will not and I can't participate here.

But how is going the forward/backward problem resolution? good results? developers or helper users still working on that problem? I wonder yes.

There is any beta that I could test for Windows about this?, in the Avidemux sourceforge there is always the stable version... it is planning to update a new stable version when?

There is something that I could do about the backward/forward problem for you?

EDIT: Or maybe I'm confused and I'm in the wrong topic? sorr if yes


Thanks for read
Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on June 24, 2015, 04:40:03 AM
Just bumping this topic.
Will be restarting this exercise soon.
AFAIR I was able to build a working windows version of avidemux using MINGW64.
It was a frankenbuild in that various dependancies were from other sources (rather than compiled from within the same build root).

Also missing were various libraries that provided for various video and audio functionalities (eg Xvid).
WRT these missing libraries:
Does the bootstrap.bash bash script look to build these libraries from source as part of the avidemux build root?
Or do I need to build them separately (using the same compiler of course) and then package them with the rest of the avidemux files?

I never did manage to visualise all of the components and arrangements to fully build avidemux inside MINGW.

 
Title: Re: Building Avidemux 2.6x with MINGW
Post by: Jan Gruuthuse on June 24, 2015, 05:18:44 AM
Something was added in avidemux wiki, perhaps you did not notice and could have some additional info for you: For windows user, msysgit is available (http://www.avidemux.org/admWiki/doku.php?id=build:devel_2.6)

Title: Re: Building Avidemux 2.6x with MINGW
Post by: AQUAR on June 24, 2015, 05:58:36 AM
Thanks Jan,

Did not notice that but will check it out.
I see you are using valgrind and getting deeper into the issues of system building.

Finally bought an AVC capable media player (only $20) so haven't been transcoding to XVID lately.