| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update | |
| sudo apt-get -y install build-essential checkinstall git libfaac-dev libgpac-dev \ | |
| libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libtheora-dev \ | |
| libvorbis-dev pkg-config texi2html yasm zlib1g-dev | |
| # Install x264 | |
| sudo apt-get -y install libx264-dev | |
| cd | |
| git clone --depth 1 git://git.videolan.org/x264 | |
| cd x264 | |
| ./configure --enable-static | |
| make | |
| sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \ | |
| awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \ | |
| --fstrans=no --default | |
| # Install AAC audio decoder | |
| cd | |
| wget http://downloads.sourceforge.net/opencore-amr/fdk-aac-0.1.0.tar.gz | |
| tar xzvf fdk-aac-0.1.0.tar.gz | |
| cd fdk-aac-0.1.0 | |
| ./configure | |
| make | |
| sudo checkinstall --pkgname=fdk-aac --pkgversion="0.1.0" --backup=no \ | |
| --deldoc=yes --fstrans=no --default | |
| # Install VP8 video encoder and decoder. | |
| cd | |
| git clone --depth 1 https://chromium.googlesource.com/webm/libvpx | |
| cd libvpx | |
| ./configure | |
| make | |
| sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no \ | |
| --deldoc=yes --fstrans=no --default | |
| # Add lavf support to x264 | |
| # This allows x264 to accept just about any input that FFmpeg can handle and is useful if you want to use x264 directly. See a more detailed explanation of what this means. | |
| cd ~/x264 | |
| make distclean | |
| ./configure --enable-static | |
| make | |
| sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \ | |
| awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \ | |
| --fstrans=no --default | |
| # Installing FFmpeg | |
| cd | |
| git clone --depth 1 git://source.ffmpeg.org/ffmpeg | |
| cd ffmpeg | |
| ./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \ | |
| --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis \ | |
| --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 | |
| make | |
| sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(date +%Y%m%d%H%M)-git" --backup=no \ | |
| --deldoc=yes --fstrans=no --default | |
| hash x264 ffmpeg ffplay ffprobe | |
| # Optional: install qt-faststart | |
| # This is a useful tool if you're showing your H.264 in MP4 videos on the web. It relocates some data in the video to allow playback to begin before the file is completely downloaded. Usage: qt-faststart input.mp4 output.mp4. | |
| cd ~/ffmpeg | |
| make tools/qt-faststart | |
| sudo checkinstall --pkgname=qt-faststart --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \ | |
| --deldoc=yes --fstrans=no --default install -Dm755 tools/qt-faststart \ | |
| /usr/local/bin/qt-faststart |
frankie-loves-jesus
commented
Dec 3, 2014
|
Any way to make this work on 13.03?
|
frankie-loves-jesus
commented
Dec 3, 2014
|
Better just go here everyone: |
kccheung
commented
Dec 29, 2014
|
Thanks a million! Save my nightmare... |
cantor
commented
Mar 29, 2015
|
For ubuntu 12.04 I had to install yasm-1.2.0 to compile x264: wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz cd .. Great howto |
consciousimages
commented
Apr 27, 2015
|
This is pretty sweet, thanks! |
jomsie
commented
May 13, 2015
|
Thanks a lot! |
sethlo
commented
May 18, 2015
|
How can I modify this script to enable libfdk-aac? |
sameer1750
commented
May 27, 2015
|
thanks a lot |
robertsdotpm
commented
May 29, 2015
|
Wow, you probably saved me over 5+ hours installing this manually. Seriously nice work. |
impy88
commented
Jul 16, 2015
|
Thanks! Note, that multiverse repository have to be enabled |
bgth
commented
Jul 20, 2015
|
Thanks alot for the howto |
binarykitchen
commented
Aug 16, 2015
|
make a docker file out of it? |
shklnrj
commented
Aug 16, 2015
|
This is awesome. Saved a lot of time :) Thanks buddy! |
kr0
commented
Sep 3, 2015
|
Thanks!! |
jagadeesanpd
commented
Sep 9, 2015
|
Thank you |
mhui
commented
Sep 14, 2015
|
sweet |
tub216
commented
Sep 16, 2015
|
Awesome! life saving. |
samuelstevens9
commented
Sep 26, 2015
|
This was so awesome I don't even care if it left a trojan on my computer. |
dylanjha
commented
Sep 26, 2015
|
This seems to not be working for me.. Any help would be greatly appreaciated
|
samuelstevens9
commented
Sep 30, 2015
|
dylanjha, make sure the dependencies are getting installed. I tried this on a clean Ubuntu Server and the script would run and not give errors about failed dependencies. Might want to install try running the commands manually. |
doopz
commented
Oct 14, 2015
|
Thank you, it worked on Ubuntu 12.04.5 LTS perfectly. |
nadermx
commented
Dec 14, 2015
|
The issue I have is that when I try to put `--with-openssl`` it says it not found |
dawsonc623
commented
Dec 23, 2015
|
How would I go about reversing what this script has done? |
Xobi
commented
Jan 4, 2016
|
Installed successfully |
bulgin
commented
Jan 8, 2016
|
And if I needed to roll back this install, what would be the steps for a beginner in linux to do that? Thank you! |
bulgin
commented
Jan 8, 2016
|
Yes, I second dawsonc623's comment about reversing what this script has done? Does anyone know how? It's been half and hour and this script is still installing software and compiling lots of files all of which I know nothing about. . . . Thanks! |
chinmay235
commented
Jan 18, 2016
|
While install ffmpeg showing Sanity test failed? |
akshayminocha5
commented
Jan 20, 2016
|
I cannot thank you enough! :D |
amaboura
commented
Jan 25, 2016
|
In case the above didn't work ,try this : http://www.faqforge.com/linux/how-to-install-ffmpeg-on-ubuntu-14-04/ |
deeuu
commented
Jan 29, 2016
|
Thank you! |
omgbox
commented
Feb 3, 2016
|
ffplay is not included sux |
VasiliDarozhkin
commented
Feb 8, 2016
|
Thanks a lot. Works fine on Ubuntu 14.04 |
iEremin
commented
Feb 9, 2016
|
Don't use it! It's incorrect static building, and you can't be sure, that built ffmpeg uses last x264 from repo, not from system etc. this is not enough for a static build ./configure --enable-static You removed libx264-dev and installed it again. |
ananthu-nair707
commented
Feb 11, 2016
|
Thanks for this! |
SergeyKozlov
commented
Feb 18, 2016
|
Write "" in line # 65 |
Aristocles
commented
Feb 27, 2016
|
Thank you! |
xiaxianmao
commented
Mar 7, 2016
|
we can't clone this resources https://chromium.googlesource.com/webm/libvpx in Chinese Mainland. So it need replace to https://github.com/webmproject/libvpx/ |
MichalGallovic
commented
Mar 24, 2016
|
Thank you so much @xdamman. Just a minor improvement to run this faster (parallelize tasks on all available cores) every make, could be replaced with |
stonexer
commented
Apr 7, 2016
|
Thanks a lot for life saving... |
AnkitSiddhapura
commented
Apr 27, 2016
|
Thank You so much :) . |
emanuelpiza
commented
May 20, 2016
|
I love you. |
wklm
commented
May 22, 2016
|
thank's a lot! |
flexmax
commented
Jun 6, 2016
|
Hello, I want to transcode on my Dell T20 (Xeon) a stream with h264_qsv. It runs on an Ubuntu 14.04 Server with Media Server Studio Essentials 2016th I am following command input ... ... I get the following error message: ...
... I'm from the "Windows World" and am still relatively new to the "Linux World" Please therefore noob-friendly answer :) Thank you very much |
llogan
commented
Jun 22, 2016
|
This is basically an outdated copy of a copy of FFmpeg Wiki: Compile FFmpeg on Ubuntu/Debian. |
survivor956
commented
Jun 29, 2016
|
Thank you, before line 20 you need to mention to install "yasm" (Assembler stuff): |
xjfengck
commented
Aug 8, 2016
|
line 18, should change to: |
vicktorManuel
commented
Aug 16, 2016
|
ty!!! :D |
gentoolink
commented
Aug 29, 2016
|
Thanks for this! Awesome time saver. |
huytv593
commented
Sep 7, 2016
|
Thanks a lot! |
SanchitSahu
commented
Sep 21, 2016
|
When using the ffmpeg command from terminal I get I followed the whole process and everything went well, just I am not able to use the ffmpeg command. Any help with this? |
edantonio505
commented
Sep 21, 2016
|
This helped me solve a problem I was having with ffmpeg. I was ripping my face off! Thanks a lot man! |
CGTKamlesh
commented
Sep 27, 2016
|
Thanks Bro :) |
FooBarQuaxx
commented
Oct 9, 2016
|
Another Thank you. |
skoften
commented
Nov 24, 2016
|
on my 14.04 installation it breaks because of "--enable-libfaac" after removing it, it ran ok. |
azri445
commented
Dec 10, 2016
•
|
ok.... its been nearly a year... im trying to install ffmpeg on my dedicated server from dreamhost. as they told me that i need to install ffmpeg by myself. while i got no knowledge on installing it. my dedicated server ubunut 12.04 code name precise.... and my ffmpeg version 0.8 how to achieve a successful ffmpeg installation... been looking long time already.. didnt find the solution. try solution given here... but none is working. Hope i can get answer from you all.... thanks in advanced |
hohaidang
commented
Mar 17, 2017
•
|
It's really really good. Thanks a lot :D I spent 3 days try to install this package to my development board. It helped me a lot |
crclayton
commented
Apr 1, 2017
|
Maybe I'm missing something here, but I install
|
franciskim
commented
Apr 1, 2017
|
@crclayton this script seems to build from source, the repo u point out is an unofficial one as far as I'm aware. |
kevinashaw
commented
Apr 4, 2017
|
Outstanding! |
CGTKamlesh
commented
Apr 13, 2017
|
command: sudo add-apt-repository ppa:mc3man/trusty-media "And confirm the following message by pressing :" "Also note that with apt-get a sudo apt-get dist-upgrade is needed for initial setup & with some package upgrades Update the package list. command: sudo apt-get update "Now FFmpeg is available to be installed with apt:" command: sudo apt-get install ffmpeg That's it. Enjoy |
lispc
commented
May 24, 2017
•
|
nasm should be installed before running the script. And nasm cannot be installed by 'apt-get' because a new version is required while nasm in apt-get is too old. I compiled nasm from source. |
slhck
commented
Jun 19, 2017
|
Please find an always up-to-date guide here: http://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu This one also has proper instructions for nasm. |
yongsukjo93
commented
Jul 21, 2017
|
Thanks! You are my HERO. |
ikristher commentedOct 30, 2014
Thanks bro. You're the best!