forked from mean00/avidemux2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcross-compiling.txt
134 lines (84 loc) · 4.69 KB
/
cross-compiling.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
******************************************************************************
*** Cross-compiling Avidemux on Linux for Windows ***
*** ***
*** Description of the default build environment setup ***
******************************************************************************
1. Install MXE (M cross environment) dependencies as described in
http://mxe.cc/#requirements
for your respective Linux distribution then clone the git repository as
described in
http://mxe.cc/#download
to /opt:
cd /opt
git clone https://github.com/mxe/mxe.git
(make /opt temporarily writable by the user or clone as root / using sudo).
Change the owner and the group of /opt/mxe to those of the user. In the
exemplary setup the 'mxe' folder has been subsequently moved elsewhere and
then bind-mounted to /opt/mxe to save write cycles of an SSD where /opt
resides. This has been done purely for convenience and is not required.
2. Create /opt/mxe/settings.mk with
MXE_TARGETS := i686-w64-mingw32.shared x86_64-w64-mingw32.shared
as content to build both 32 bit and 64 bit environments. Optionally, you can
set the variable MXE_TMP which determines where intermediate files are created
(e.g. to /tmp) by adding
MXE_TMP := /tmp
to the settings.mk file.
3. Build required MXE packages for the targets specified above with
cd /opt/mxe
make qttools qtwinextras sdl2 ogg vorbis lame a52dec faad2 fdk-aac libmad opus fribidi libass xvidcore x264
This pulls in all the dependencies and can take a couple of hours. The final
total size of the /opt/mxe folder may be about 2.2G. Please note that twolame
is not available as a shared library and x265 has not been packaged for MXE as
of this writing.
4. Download x265_2.4.tar.gz from
https://bitbucket.org/multicoreware/x265/downloads
extract the content of the tarball, enter the 'x265_2.4/build' directory,
create a new subdirectory, e.g. 'mingw-w32', enter this subdirectory, create
a 'build.cmake' file there with
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER i686-w64-mingw32.shared-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32.shared-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32.shared-windres)
SET(CMAKE_ASM_YASM_COMPILER yasm)
as content, ensure that /opt/mxe/usr/bin is in $PATH and run
cmake -DCMAKE_TOOLCHAIN_FILE=build.cmake -DCMAKE_INSTALL_PREFIX=/opt/mxe/usr/i686-w64-mingw32.shared -DENABLE_CLI=OFF ../../source
make -j $(nproc)
make install
(the last command has to be run as root or using sudo if the directory
'/opt/mxe/usr/i686-w64-mingw32.shared' is not writable by the user).
To build and install 64 bit x265, create e.g. 'mingw-w64' as a subdirectory of
'x265_2.4/build', enter this subdirectory, create a 'build.cmake' file there
with
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER x86_64-w64-mingw32.shared-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32.shared-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32.shared-windres)
SET(CMAKE_ASM_YASM_COMPILER yasm)
as content, again ensure that /opt/mxe/usr/bin is in $PATH and run
cmake -DCMAKE_TOOLCHAIN_FILE=build.cmake -DCMAKE_INSTALL_PREFIX=/opt/mxe/usr/x86_64-w64-mingw32.shared -DENABLE_CLI=OFF ../../source
make -j $(nproc)
make install
(the last command has to be run as root or using sudo if the directory
'/opt/mxe/usr/x86_64-w64-mingw32.shared' is not writable by the user).
Please note that you need yasm >= 1.3 to build a 64 bit x265 library, this
requirement is not met on Debian 8.
5. To enable hardware-accelerated encoding provided by NVIDIA graphics cards of
the Kepler generation and later, download the file "nvEncodeAPI.h" e.g. from
https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/compat/nvenc/nvEncodeAPI.h
and copy it to /opt/mxe/usr/i686-w64-mingw32.shared/include/ or
/opt/mxe/usr/x86_64-w64-mingw32.shared/include/ correspondingly.
6. Create a user-writable directory 'out' in '/opt/mxe/usr/x86_64-w64-mingw32.shared'
and in '/opt/mxe/usr/i686-w64-mingw32.shared' respectively.
7. Enter the Avidemux top source directory and run
bash bootStrapCrossMingwQt5_mxe.sh
to cross-compile a 32 bit Avidemux version or
bash bootStrapCrossMingwQt5_mxe.sh --64
to cross-compile a 64 bit version. Run
bash bootStrapCrossMingwQt5_mxe.sh -h
to see the list of all available options. It is assumed that 'zip' utility is
installed and in $PATH. Copy the 'avidemux_rYYMMDD-hhmmss_win{32,64}Qt5.zip'
file from the 'packaged_mingw_build_YYMMDD-hhmmss' directory to a Windows
partition, extract it on Windows and run 'avidemux.exe' from there.
8. Issues:
As of this writing, twolame, aften, vapoursynth and avsproxy are not available.
2017-06-13 UTC 23:00