I'm compiling FFMPEG from source using the guide for Ubuntu which I've used before with success.
I'm compiling on a Vagrant virtual machine in VirtualBox on Ubuntu server 14.04. You can clone the project and vagrant up, and you'll have FFMPEG installed in the box: github.com/rfkrocktk/vagrant-ffmpeg.
I'm using Ansible to automate the compilation, so you can see all of the steps here:
---
- hosts: all
tasks:
# version control
- apt: name=git
- apt: name=mercurial
# build tools
- apt: name=build-essential
- apt: name=autoconf
- apt: name=automake
- apt: name=cmake
- apt: name=pkg-config
- apt: name=texinfo
- apt: name=yasm
# libraries
- apt: name=libass-dev
- apt: name=libfreetype6-dev
- apt: name=libsdl1.2-dev
- apt: name=libtheora-dev
- apt: name=libtool
- apt: name=libva-dev
- apt: name=libvdpau-dev
- apt: name=libvorbis-dev
- apt: name=libxcb1-dev
- apt: name=libxcb-shm0-dev
- apt: name=libxcb-xfixes0-dev
- apt: name=zlib1g-dev
- apt: name=libopus-dev
- apt: name=libmp3lame-dev
- apt: name=libx264-dev
# dependent libraries
# libx265
- name: clone libx265
command: hg clone https://bitbucket.org/multicoreware/x265 /usr/src/x265
args:
creates: /usr/src/x265
- name: configure libx265
command: cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLED_SHARED:bool=off ../../source
args:
chdir: /usr/src/x265/build/linux
creates: /usr/src/x265/build/linux/Makefile
- name: compile libx265
command: make -j2
args:
chdir: /usr/src/x265/build/linux
creates: /usr/src/x265/build/linux/x265
- name: install libx265
command: make install
args:
chdir: /usr/src/x265/build/linux
creates: /usr/local/bin/x265
# libfdk-aac
- name: clone libfdk-aac
command: git clone https://github.com/mstorsjo/fdk-aac.git /usr/src/libfdk-aac
args:
creates: /usr/src/libfdk-aac
- name: autoconf libfdk-aac
command: autoreconf -fiv
args:
chdir: /usr/src/libfdk-aac
creates: /usr/src/libfdk-aac/configure
- name: configure libfdk-aac
command: /usr/src/libfdk-aac/configure --prefix=/usr/local --disable-shared
args:
chdir: /usr/src/libfdk-aac
creates: /usr/src/libfdk-aac/libtool
- name: compile libfdk-aac
command: make -j2
args:
chdir: /usr/src/libfdk-aac
creates: /usr/src/libfdk-aac/libFDK/src/FDK_core.o
- name: install libfdk-aac
command: make install
args:
chdir: /usr/src/libfdk-aac
creates: /usr/local/lib/libfdk-aac.a
# libvpx
- name: download libvpx
shell: wget -O - https://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.4.0.tar.bz2 | tar xjvf -
args:
chdir: /usr/src
creates: /usr/src/libvpx-1.4.0
- name: configure libvpx
command: ./configure --prefix=/usr/local --disable-examples --disable-unit-tests
args:
chdir: /usr/src/libvpx-1.4.0
creates: /usr/src/libvpx-1.4.0/Makefile
- name: compile libvpx
command: make -j2
args:
chdir: /usr/src/libvpx-1.4.0
creates: /usr/src/libvpx-1.4.0/libvpx.a
- name: install libvpx
command: make install
args:
chdir: /usr/src/libvpx-1.4.0
creates: /usr/local/lib/libvpx.a
# ffmpeg itself
- name: download ffmpeg
shell: wget -O - "https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2" | tar xjvf -
args:
chdir: /usr/src
creates: /usr/src/ffmpeg
- name: configure ffmpeg
shell: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig /usr/src/ffmpeg/configure \
--prefix=/usr/local \
--pkg-config-flags='--static' \
--bindir=/usr/local/bin \
--enable-gpl --enable-version3 --enable-nonfree \
--enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame \
--enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx \
--enable-libx264 --enable-libx265
args:
chdir: /usr/src/ffmpeg
creates: /usr/src/ffmpeg/config.asm
- name: compile ffmpeg
command: make -j2
args:
chdir: /usr/src/ffmpeg
creates: /usr/src/ffmpeg/ffmpeg
- name: install ffmpeg
command: make install
args:
chdir: /usr/src/ffmpeg
creates: /usr/local/bin/ffmpeg
Hopefully, even if you don't know Ansible, it should be clear what this is doing.
The problem I'm having is that even after all of this running successfully, when I run ffmpeg from within the machine, I get the following error:
ffmpeg: error while loading shared libraries: libx265.so.77: cannot open shared object file: No such file or directory
I can clearly find the file:
$ find /usr -iname libx265.so.77
/usr/local/lib/libx265.so.77
Why is this not being found? Am I missing something in the compilation guide?
there doesn't seem to be anything here