Haiku is an open-source operating system dedicated to continue the rich tradition of BeOS. To continue being compatible with BeOS applications, however, Haiku developers have decided to make GCC 2 the default C compiler while providing a GCC 4 runtime in their recommended "GCC 2 hybrid" image for 32-bit x86. GCC 2 on Haiku is especially buggy, so some tinkering with
$PATH will be needed.
This problem does not exist on x86-64 images, since BeOS did not support that architecture and there is no need for backwards compatibility.
Note that only Haiku nightly images are supported. Alpha 4.1 release is deemed to be too out of date for FFmpeg.
First, to compile FFmpeg on Haiku you must have sufficient amount of disk space. The images supplied by Haiku does NOT have enough space. If you installed Haiku on your physical hard drive through the installer just make sure your Haiku partition has enough space. If it is a virtual machine installation you will need to increase disk image space.
Let's get started!
Installing required components
For x86 GCC 2 hybrid image:
pkgman install lame_x86_devel libtheora_x86_devel libvorbis_x86_devel libogg_x86_devel libvpx_x86_devel speex_x86_devel yasm
For x86 GCC 4 (hybrid and otherwise) and x86-64 images:
pkgman install lame_devel libtheora_devel libvorbis_devel libvpx_devel libogg_devel speex_devel yasm
The dependencies above are only the dependencies available from the binary distribution. If you would like to have more features, feel free to use
haikuporter to build more, although success is not guaranteed.
In particular, x264, x265, and Opus encoding support is only available by building the packages yourself.
Getting FFmpeg source
If you are running Haiku in a VM, then you probably should consider NOT to clone the repo with Git, but instead get the snapshot:
With Git metadata: https://ffmpeg.org/releases/ffmpeg-snapshot-git.tar.bz2 Without: https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
If performance is not a concern then you can simply:
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
Setting paths for hybrid build
This section is NOT necessary on x86-64. You also might want to put this into your
~/.profile if you will be building FFmpeg regularly.
As mentioned above, you will need to set
$PATH variable to give GCC 4 toolchain priority over the legacy GCC 2 stack, on an x86 GCC 2 hybrid build. To do so, execute the following in your shell:
You would also need to let FFmpeg find the libraries"
It is NOT recommended to install ffmpeg system-wide, as it is very possible that it would break the system installation, upon which the default web browser WebPositive is depended. In the following configuration, binaries and development files are installed to
/boot/home/ffmpeg-installed to avoid conflict, while man pages are installed to the standard directory.
cd ffmpeg prefix='/boot/home/ffmpeg-installed' ./configure \ --prefix="$prefix" \ --bindir="$prefix/bin/" \ --datadir="$prefix/data/" \ --incdir="$prefix/develop/headers" \ --libdir="$prefix/develop/lib" \ --docdir="$prefix/documentation/" \ --mandir='/system/documentation/man/' \ --enable-libmp3lame \ --enable-libvorbis \ --enable-libspeex \ --enable-libtheora \ --enable-libvpx \ --enable-gpl \ --disable-inline-asm
Unfortunately the last option is needed to work around #4474.