Script to help with cross compiling

Announcements made by users.
hydra3333
Posts: 123
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Sun Jan 31, 2016 12:38 am

Nearly, but no cigar.
make[2]: Entering directory '/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/win32/fontconfig-2.11.94/fc-cache'
CC fc-cache.o
CCLD fc-cache.exe
../src/.libs/libfontconfig.a(fccache.o):fccache.c:(.text+0x6b): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fccfg.o):fccfg.c:(.text+0x7): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fcdefault.o):fcdefault.c:(.text+0x7): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fcobjs.o):fcobjs.c:(.text+0x7): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fcxml.o):fcxml.c:(.text+0x7): undefined reference to `_mm_mfence'
collect2: error: ld returned 1 exit status
Makefile:492: recipe for target 'fc-cache.exe' failed
make[2]: *** [fc-cache.exe] Error 1
make[2]: Leaving directory '/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/win32/fontconfig-2.11.94/fc-cache'
Makefile:579: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/win32/fontconfig-2.11.94'
Makefile:463: recipe for target 'all' failed
make: *** [all] Error 2
Will try again from scratch in a fresh vm.

Is there a way to --prefer-stable=n just on the libvpX type stuff ?

hydra3333
Posts: 123
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Sun Jan 31, 2016 2:44 am

No. A fresh VM and still won't build.
Making all in fc-cache
make[2]: Entering directory '/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/win32/fontconfig-2.11.94/fc-cache'
CC fc-cache.o
CCLD fc-cache.exe
../src/.libs/libfontconfig.a(fccache.o):fccache.c:(.text+0x6b): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fccfg.o):fccfg.c:(.text+0x7): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fcdefault.o):fcdefault.c:(.text+0x7): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fcobjs.o):fcobjs.c:(.text+0x7): undefined reference to `_mm_mfence'
../src/.libs/libfontconfig.a(fcxml.o):fcxml.c:(.text+0x7): undefined reference to `_mm_mfence'
collect2: error: ld returned 1 exit status
Makefile:492: recipe for target 'fc-cache.exe' failed
make[2]: *** [fc-cache.exe] Error 1
make[2]: Leaving directory '/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/win32/fontconfig-2.11.94/fc-cache'
Makefile:579: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/u/Desktop/ffmpeg-windows-build-helpers-master/sandbox/win32/fontconfig-2.11.94'
Makefile:463: recipe for target 'all' failed
make: *** [all] Error 2

hydra3333
Posts: 123
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Mon Feb 08, 2016 10:15 am

Hello.
I tried again today (with fresh downloads) under a version of Ubuntu (15.10) which had worked for me previously.
The same VP8 compilation errors are reported.
Any suggestions or information would be very much welcomed.

hydra3333
Posts: 123
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Fri Feb 12, 2016 10:37 pm

https://groups.google.com/a/webmproject ... mU7TpTHAAJ
On Sat, Feb 6, 2016 at 11:21 PM, <[email protected]l.com> wrote:
> Thanks for support
> When I was applied your code (
> https://chromium-review.googlesource.com/#/c/326487/ )
> error occured at build
>
> In file included from ./vp8/common/threading.h:69:0,
> from vp8/encoder/onyx_int.h:25,
> from vp8/encoder/encodemv.h:15,
> from vp8/encoder/bitstream.c:13:
> /home/kgpbuild/ffmpegbuild5/sandbox/mingw-w64-i686/include/semaphore.h:152:8:
> error: unknown type name 'mode_t'
> mode_t mode,
> ^
>
This seems like a separate issue. Most mingw semaphore.h files I've
seen have a test for MODE_T/HAVE_MODE_T and apply a fallback typedef
if necessary. You can try including sys/types.h before semaphore.h to
see if it helps.
From that post, I appears as if a VP8 change killed vp8 cross compilation under ubuntu using rogerdpack's script.

I wonder how Zeranoe builds ffmpeg with it ? If it is from an earlier commit (?) then could rogerdpack's script be changed to use it ?

hydra3333
Posts: 123
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Sat Mar 26, 2016 12:51 pm

Sorry, it must have been my ubuntu build. swapped to a different mirror to for ubuntu and to my amazement most things worked fine (excepting vp8 which i didn't try).

Zeranoe,
thank you very much for your wonderful toolchain build script. I made a copy and slightly updated it to use the latest --mingw-w64-ver=4.0.5 --binutils-ver=2.26 --gcc-ver=5.3.0 and it works a treat. Hope I didn't break any licensing.

rodgerdpack,
thank you for your fine ffmpeg build script with your related source code patch files. I made a copy and slightly updated it to use some later sources that did compile, or zeranoe's sources, depending. Hope I didn't break any licensing.
I also finally got x264 to cross-compile with gpac for .mp4 compatibility and with ffmpeg lavf libraries so that it directly accepts input like .mpg etc as input ... using ubuntu, a variation of your script and a variation of zeranoe's toolchain build script (to use the latest compiler and related stuff). It's a train-wreck of a hacked up script based on the ffmpeg build script, but it did work to make an exe. As a linux knowledge free zone trying to learn, it seemed that the configure file for x264 has a number of non-obvious fixed dependencies, eg things like
- pkg-config had to be copied from /usr/bin/pkg-config into the cross-compiler folder with a different name based on a cross_prefix, since the toolchain build script didn't generage a pkg-config
- setup of PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR
- copying ffmpeg sources and libraries into specific folders
- copying gpac sources into a specific folder and a .a file to specific place with a specific name
- using a custom configure_flags to point to the right places
So now, to consider whether to spend any time to find out why the mp4box built via rogerdpack's script produces .mp4 files which don't behave right when played in mpc-hc, as compared to the the official mp4box; eg when playing a .mp4 and click say 3/4 down the timeline and then the audio plays but the video takes 5 seconds to catch up and start playing, whereas an .mp4 with same video and audio but produced by an older mp4box handles it just fine with no "catchup" (using the same commandline on mp4box).

rogerdpack
Posts: 1872
Joined: Fri Aug 05, 2011 9:56 pm

Re: Script to help with cross compiling

Post by rogerdpack » Tue Apr 19, 2016 1:14 pm

maybe official mp4box binaries behave differently? (if they exist)...

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Script to help with cross compiling

Post by cdlvcdlv » Sun Jul 31, 2016 1:45 am

Thanks for the script. I've compiled FFmpeg myself because I'm interested in some recent commits. I've tried to create a VP8a video but it stops with error:

Code: Select all

C:\Temp>ffmpeg -i https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_P
NG_example_bouncing_beach_ball.png -c:v libvpx -pix_fmt yuva420p -metadata:s:v:0
 alpha_mode="1" bouncing_ball_with_alpha.webm

ffmpeg version N-81186-g906ee41 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/cygdrive/c/ffmpe
g-windows-build-helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/
cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --d
isable-w32threads --enable-librubberband --enable-gpl
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 51.100 / 57. 51.100
  libavformat    57. 44.100 / 57. 44.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 49.100 /  6. 49.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, apng, from 'Animated_PNG_example_bouncing_beach_ball.png':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: apng, rgba(pc), 100x100, 13.33 fps, 13.33 tbr, 100k tbn,
 100k tbc
Unknown encoder 'libvpx'
I compiled it using the following command:

Code: Select all

./cross_compile_ffmpeg.sh --build-ffmpeg-static=y --disable-nonfree=n --build-intel-qsv=n --sandbox-ok=y --build-mp4box=n --build-mplayer=n --build-vlc=n --build-dvbtee=n --compiler-flavors=win32 --git-get-latest=y
Am I missing anything? Last XP-patchable Zeranoe's build (f41e37b, 13-Jul-2016 22:10) creates the video as expected.

Code: Select all

ffmpeg version N-80999-gf41e37b Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dx
va2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-lib
ebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --ena
ble-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfree
type --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enab
le-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-lib
openjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-lib
snappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
 --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-
libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enab
le-zlib
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 50.100 / 57. 50.100
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, apng, from 'Animated_PNG_example_bouncing_beach_ball.png':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: apng, rgba(pc), 100x100, 13.33 fps, 13.33 tbr, 100k tbn,
 100k tbc
File 'bouncing_ball_with_alpha.webm' already exists. Overwrite ? [y/N] y
[libvpx @ 04c66820] v1.5.0
[webm @ 04c45020] Using AVStream.codec to pass codec parameters to muxers is dep
recated, use AVStream.codecpar instead.
Output #0, webm, to 'bouncing_ball_with_alpha.webm':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0: Video: vp8 (libvpx), yuva420p, 100x100, q=-1--1, 200 kb/s, 13.3
3 fps, 1k tbn, 13.33 tbc
    Metadata:
      alpha_mode      : 1
      encoder         : Lavc57.50.100 libvpx
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (apng (native) -> vp8 (libvpx))
Press [q] to stop, [?] for help
frame=   20 fps=0.0 q=0.0 Lsize=      21kB time=00:00:01.42 bitrate= 122.0kbits/
s speed=4.57x
video:14kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: 54.630157%

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Script to help with cross compiling

Post by cdlvcdlv » Tue Aug 02, 2016 1:08 am

I saw you 'revert inadvertent line' commit a few hours old and thought it could be that, as it was something about config options, and my ffmpeg reported too few of them.

As the downloading-compiling takes hours I don't watch the messages, but I did it to test and there it was the librubberband-gpl at the end and nothing more:

Code: Select all

configuring ffmpeg_git_xp_compat (/cygdrive/c/ffmpeg-windows-build-helpers-maste
r/native_build/windows/ffmpeg_local_builds/sandbox/win32/ffmpeg_git_xp_compat) a
s $ PATH=/cygdri(...) ./configure --arch=x86 --target-os=mingw32 --cross-prefix=
/cygdrive/c/ffmpeg-windows-build-helpers-master/native_build/windows/ffmpeg_loca
l_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-conf
ig=pkg-config --disable-w32threads --enable-librubberband --enable-gpl
I downloaded the latest version, overwrote cross_compile_ffmpeg.sh (the two, just in case), run it again and...

Code: Select all

configuring ffmpeg_git_with_fdk_aac_xp_compat (/cygdrive/c/ffmpeg-windows-build-
helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/win32/ffmpeg_git
_with_fdk_aac_xp_compat) as $ PATH=/cygdri(...) ./configure --arch=x86 --target-
os=mingw32 --cross-prefix=/cygdrive/c/ffmpeg-windows-build-helpers-master/native
_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i6
86-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --enable-libsoxr --
enable-fontconfig --enable-libass --enable-libbluray --enable-iconv --enable-lib
twolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --e
nable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-decklink --ex
tra-libs=-loleaut32  --enable-libmp3lame --enable-version3 --enable-zlib --enabl
e-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libop
enjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --e
nable-bzlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo
-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-lib
wavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-avisynth --enab
le-gray --enable-libopenh264 --enable-nvenc --enable-libebur128 --enable-netcdf
 --enable-libflite --enable-lzma --enable-libsnappy --enable-libzimg --enable-gp
l --enable-libx264 --enable-libx265 --enable-frei0r --enable-filter=frei0r --ena
ble-librubberband --enable-libvidstab --enable-libxavs --enable-libxvid --extra-
libs=-lpsapi --extra-libs=-lspeexdsp --extra-cflags=-mtune=core2 --extra-cflags=
-O3 --enable-static --disable-shared  --prefix=/cygdrive/c/ffmpeg-windows-build-
helpers-master/native_build/windows/ffmpeg_local_builds/sandbox/cross_compilers/
mingw-w64-i686/i686-w64-mingw32 --enable-nonfree --enable-libfdk-aac --disable-l
ibfaac  --enable-runtime-cpudetect
That's more like it. 8-)

I let it working overnight, but I have a good feeling about this.

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Script to help with cross compiling

Post by cdlvcdlv » Mon Aug 08, 2016 12:35 am

Just to confirm that FFmpeg compiled OK. Thanks a lot.

cdlvcdlv
Posts: 28
Joined: Tue Mar 15, 2016 9:55 am

Re: Script to help with cross compiling

Post by cdlvcdlv » Tue Aug 23, 2016 10:08 pm

I would like to compile FFmpeg using your script with --disable-decoder=vp8,vp9 option. How could I?

Post Reply