Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install FFmpeg on a Linux Box

###Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

#####http://ffmpeg.org

  • SSH into your instance and become root

    $ sudo su -

  • 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

  • Check the static build directory at:

    $ 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

The output should look something like this

ffmpeg version N-60675-g8fe1076
built on Feb 16 2014 05:45:47 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-
static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --
extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --
disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --
enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --
enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --
enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
libavutil 52. 64.100 / 52. 64.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 32.101 / 55. 32.101
libavdevice 55. 9.101 / 55. 9.101
libavfilter 4. 1.102 / 4. 1.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
  • 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.

credit: this AWS forum thread

@lexmart

This comment has been minimized.

Copy link

commented Jan 16, 2017

Thank you, you saved me a lot of hassle.

@mtvbrianking

This comment has been minimized.

Copy link

commented Feb 10, 2017

I had to sign in to leave a comment for you... you've put an end to the 6hrs of Googling Bravo

@Nirjonadda

This comment has been minimized.

Copy link

commented Mar 3, 2017

Please can you let me know that How To Install FFmpeg and FFmpeg-PHP Extension on CentOS 7 with cPanel?

@llogan

This comment has been minimized.

Copy link

commented Apr 5, 2017

Symlinking is messy, can interfere with ffmpeg packages from a repository, and is unnecessary. /usr/local/bin should already be listed in the PATH (see echo $PATH). If you place the ff* binaries directly in /usr/local/bin without making a directory you will not need to symlink.

@IftekharDani

This comment has been minimized.

Copy link

commented Aug 17, 2017

Thank you. it worked for me.

@elnurxf

This comment has been minimized.

Copy link

commented Nov 20, 2017

Thanks, mate!

@spookyUnknownUser

This comment has been minimized.

Copy link

commented Dec 26, 2017

Here's a shell script that should automate this https://gist.github.com/spookyUnknownUser/dd8c75319ec581c1028310cedaea786c

@gosman

This comment has been minimized.

Copy link

commented Jan 15, 2018

Saved me a ton of time, thank you.

@juniorknot

This comment has been minimized.

Copy link

commented Feb 20, 2018

Thank you. it worked for me.

@0x2f0713

This comment has been minimized.

Copy link

commented Mar 15, 2018

Thank you so much, it worked.!

@apolo56

This comment has been minimized.

Copy link

commented Mar 18, 2018

all worked !!!
thanks a lot .
i have one question !!!
can you compile ffmpeg with Nvenc and cuda ?
most users and me now use gpu transcoding with ffmpeg , this yours working with gpu but not with mpeg4_cuvid

thanks agen for great work

@gmDreamer

This comment has been minimized.

Copy link

commented Mar 19, 2018

good

@NABIAHAMAD

This comment has been minimized.

Copy link

commented Apr 4, 2018

Thanks, its working good

@ebelliveau

This comment has been minimized.

Copy link

commented May 16, 2018

Vansickle took his builds down and has a Patreon page sitting where the packages used to be. This won't work any more as of May 16, 2018.

@ghost

This comment has been minimized.

Copy link

commented May 17, 2018

2018-05-17 03:42:35 ERROR 404: Not Found.

@SankaitLaroiya

This comment has been minimized.

Copy link

commented Jul 9, 2018

Thanks!

@gtssunil

This comment has been minimized.

Copy link

commented Jul 26, 2018

Thanks, its working perfect.

@Maverton

This comment has been minimized.

Copy link

commented Aug 4, 2018

Newbie here I followed the instruction
Not sure why it won't untar when using instruction
tar xf ffmpeg-release-64bit-static.tar.xz

HTTP request sent, awaiting response... 200 OK
Length: 25878148 (25M) [application/x-xz]
Saving to: “ffmpeg-release-64bit-static.tar.xz.1”

100%[======================================>] 25,878,148 3.11M/s in 7.1s

2018-08-04 14:12:26 (3.47 MB/s) - “ffmpeg-release-64bit-static.tar.xz.1” saved [25878148/25878148]

Attempting to unzip/untar using instruction nothing happens.

@thisGy

This comment has been minimized.

Copy link

commented Dec 22, 2018

Thanks so much!

@SehgalDivij

This comment has been minimized.

Copy link

commented Jan 8, 2019

simply awesome. the content of this page must be present on johnvansickle's page which has links to the releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.