• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Compiling FFmpeg From Source

Compiling FFmpeg From Source

Chris D

XenForo developer
Staff member
#1
Chris D submitted a new resource:

Compiling FFmpeg From Source - Steps to follow in order to compile FFmpeg from source manually

A popular support question we have been receiving since releasing XenForo Media Gallery 1.1 is how to get FFmpeg working.

It's not uncommon for distros and package managers to contain outdated versions. Considering the minimum requirement for XFMG is FFmpeg version 1.1 which was released in January 2013, this is somewhat surprising.

The FFmpeg developers themselves recommend using the most up to date version and this guide aims to help you through that installation process.

It's important...
Read more about this resource...
 

otto

Well-known member
#4
Hello,

I have ubuntu 12.0.4 LTS run and ffmpeg is properly installed at "/usr/bin/ffmpeg" - but when I will save this path in my gallery settings, then it says:

Could not execute FFMPEG at the path specified: /usr/bin/ffmpeg
Bevor I have set open_basedir to "none" to resolve a open_basedir error message...

Any idea?
 

Chris D

XenForo developer
Staff member
#5
First update to XFMG 1.1.1 and then try again. There was improved error detection added so you may get a more detailed error.
 

tonmo

Active member
#8
The wiki also has a CentOS guide (although it didn't work for me):

CompilationGuide/Centos – FFmpeg
What specifically didn't work?
I'm not sure what didn't work for Liam, however, I am on CentOS and my hosting provider helped install ffmpeg (after my own attempts failed). I've asked them if these were the instructions they followed.

I noticed that the CentOS instructions above do not include an install of libvo_aacenc. I raise this, because the error I am getting when entering settings in Gallery Options is as follows:

Code:
 XenForo Media Gallery requires the following encoders to be enabled in FFMPEG: libvo_aacenc
Any thoughts or guidance?
 

Chris D

XenForo developer
Staff member
#9
That guide doesn't cover the pre-requisites required for XFMG.

Specifically the libvo_aacenc encoder isn't installed.

If it's easier, you might want to consider just using a static build:

http://johnvansickle.com/ffmpeg/

The above URL is actually recommended as a source by the FFmpeg team. For the most part it should be as simple as downloading, extracting, and making the ffmpeg binary accessible on the server.
 

MattW

Well-known member
#10
That guide doesn't cover the pre-requisites required for XFMG.

Specifically the libvo_aacenc encoder isn't installed.

If it's easier, you might want to consider just using a static build:

http://johnvansickle.com/ffmpeg/

The above URL is actually recommended as a source by the FFmpeg team. For the most part it should be as simple as downloading, extracting, and making the ffmpeg binary accessible on the server.
This is also what I've started doing in all my server builds, and it works perfectly.
 

Chris D

XenForo developer
Staff member
#12
There has never been a version 4.9.3. I think the version string lists "gcc 4.9.3", this is the compiler version and not related to FFmpeg itself.

This guide is specifically about compiling the FFmpeg from its source code repository. If you follow the instructions you'll see that the http://johnvansickle.com/ffmpeg/ page is not mentioned.
 

Chris D

XenForo developer
Staff member
#16
You just download it from the link and that's it. You just point the FFmpeg binary path in the options to the ffmpeg file.
 

Nirjonadda

Active member
#17
You just download it from the link and that's it. You just point the FFmpeg binary path in the options to the ffmpeg file.
Is this correct to Installing FFmpeg?

Code:
# Download ffmpeg binaries to your /opt folder.
cd /opt
curl -O https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz

# Untar the downloaded file. tar -xf ffmpeg-release-64bit-static.tar.xz rm ffmpeg-release-64bit-static.tar.xz

Note: This require xz to be installed. If the untar command fails run

yum install xz

# Symlink FFmpeg and ffprobe to `/usr/bin` to make the commands accessible
# to the ftrack user.
# Replace the part between <> with the specific version installed.
ln -s /opt/ffmpeg-<FFMPEG VERSION>/ff* /usr/bin
OR

Code:
cd to the the /usr/local/bin directory

$ cd /usr/local/bin

Inside the /usr/local/bin directory, create an /ffmpeg directory

$ mkdir ffmpeg

cd into the new directory

$ cd ffmpeg

$ wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz

The file should now be in /usr/local/bin/ffmpeg. Untar it…

$ tar xf ffmpeg-release-64bit-static.tar.xz

Run it and check what the latest version is

$ ./ffmpeg -version

Move the contents of your static untarred folder into the parent /ffmpeg dir
$ mv * ../
If you want to be able to execute $ ffmpeg from any directory, you’ll need to create a symlink inside /usr/bin:
$ ln -s /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg
$ ln -s /usr/local/bin/ffmpeg/ffprobe /usr/bin/ffprobe #for ffprobe
done. You are now able to run the $ ffmpeg command from anywhere.
 

Matt C.

Active member
#20
Hi Chris. Do I run this all as one command?

Code:
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-version3 \
  --enable-libass \
  --enable-libfreetype \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-libx264 \
  --enable-libvo-aacenc