Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save willmasters/382fe6caba44a4345a3de95d98d3aae5 to your computer and use it in GitHub Desktop.
Save willmasters/382fe6caba44a4345a3de95d98d3aae5 to your computer and use it in GitHub Desktop.
#
sudo su -
cd /usr/local/bin
mkdir ffmpeg
cd ffmpeg
wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.2.1-amd64-static.tar.xz
tar xvf ffmpeg-4.2.1-amd64-static.tar.xz
mv ffmpeg-4.2.1-amd64-static/ffmpeg .
ln -s /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg
exit
@m1g0r
Copy link

m1g0r commented Feb 26, 2019

@narze
Copy link

narze commented Aug 26, 2019

@oharaandrew314
Copy link

oharaandrew314 commented Jan 7, 2020

Unfortunately, as ffmpeg is updated, the folder name inside the downloaded archive will change. This script is sadly useless for any sort of automated provisioning.

You may want to choose one of the older versions shown here, and hope they're not deleted over time. https://www.johnvansickle.com/ffmpeg/old-releases/

@Himank17Gupta
Copy link

thanks man it saved my ass...
for more newbies like me stumbling upon this please take care of editing script as following
1.) use new link specified in above comment and run line 9,10 accordingly to new link
2.) before executing line 11 , check existing directories ( run ls ) first to see whats the name of static ffmpeg folder by which it is saved,
(in my case it was ffmpeg-4.2.2-amd64-static ) ,then run line 11 accordingly.

@adam-kramer
Copy link

adam-kramer commented Apr 9, 2020

Version: AWS EC2 Linux Instance x86_64 Node.js:
A few things that I needed to change. This was the most helpful article I have seen from numerous google searches to date.
1.) Changed tar xvf ffmpeg-X.X.X-amd64-static.tar.xz to tar -xf ffmpeg-X.X.X-amd64-static.tar.xz (fill in X.X.X with your static build version)
2.) Because I didn't get it right the first time, or second, etc. I believe I needed to override the symbolic link originally created? I added the command to do just that and now its working. ln -sfn /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg

@stevebanik
Copy link

Thank you for this. Why doesn't Amazon Linux provide this via a package manager like yum in amazon-linux-extras or epel? Is epel just for CentOS?

@dheeraj032
Copy link

facing error while using ffmpeg

Input model at /usr/local/share/model/vmaf_v0.6.1.pkl cannot be read successfully.
Caught VmafException: Error loading model (.pkl): Trouble reading the file:/usr/local/share/model/vmaf_v0.6.1.pkl
[Parsed_libvmaf_0 @ 0x5d5aec0] libvmaf encountered an error, check log for details
Error while filtering: Invalid argument
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0
Conversion failed!

Can someone help in this ?

@willmasters
Copy link
Author

Not here no. Perhaps ask in https://github.com/FFmpeg/

@RichardTMiles
Copy link

RichardTMiles commented Apr 13, 2022

Use this, I modified this to fit our needs

wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz

mkdir ffmpeg-release-amd64-static

tar -xf ffmpeg-release-amd64-static.tar.xz --strip-components=1 -C ffmpeg-release-amd64-static

rm -f ffmpeg-release-amd64-static.tar.xz

ln -s /root/ffmpeg-release-amd64-static/ffmpeg /usr/local/bin/ffmpeg

@oharaandrew314
Copy link

Nice find @RichardTMiles

@AndySharez
Copy link

Although I installed it @RichardTMiles way, it won't work with my php script.

Checked the script; everything seems to be ok.

@januszm
Copy link

januszm commented Sep 21, 2022

@oharaandrew314 with the asterisk '*' you can get around the issue with varying version number

if [ ! -f /usr/local/bin/ffmpeg ]
then
  wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
  tar xvf ffmpeg-release-amd64-static.tar.xz
  mv ffmpeg-*-amd64-static/ff* /usr/local/bin/
fi

@claudiofabiao
Copy link

Thanks!

@akayalml
Copy link

I am following @RichardTMiles but getting following error while building my docker file for aws lambda. I see the filename is correct though.

Step 8/17 : RUN mkdir ffmpeg-release-amd64-static
 ---> Running in 83ef215b8ad1
Removing intermediate container 83ef215b8ad1
 ---> d99b1fe0ce57
Step 9/17 : RUN tar -xf ffmpeg-release-amd64-static.tar.xz --strip-components=1 -C ffmpeg-release-amd64-static
 ---> Running in 882c2087ead9
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
The command '/bin/sh -c tar -xf ffmpeg-release-amd64-static.tar.xz --strip-components=1 -C ffmpeg-release-amd64-static' returned a non-zero code: 2

[Container] 2023/01/23 13:30:24 Command did not exit successfully docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG . exit status 2

@ben-montra
Copy link

@akayalml Amazon Linux 2 doesn't have xz installed by default. You need to run yum install xz and tar -xf will work properly

@RichardTMiles
Copy link

Amazon Linux 2023 is out; one should upgrade as often as possible.

@Rudrabha
Copy link

$ wget https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
$ tar -xjvf ffmpeg-snapshot.tar.bz2
$ cd ffmpeg
$ ./configure
$ make
$ sudo make install
$ ffmpeg -version

This worked for me in 2024, Amazon Linux 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment