{"id":967,"date":"2014-05-02T02:44:36","date_gmt":"2014-05-01T18:44:36","guid":{"rendered":"https:\/\/cowman-chiang.no-ip.org\/wordpress\/?p=967"},"modified":"2019-06-20T10:25:07","modified_gmt":"2019-06-20T02:25:07","slug":"ffmpeg%ef%bc%9ainstall-in-the-ubuntu-12-04","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=967","title":{"rendered":"FFmpeg\uff1aInstall in the Ubuntu 12.04"},"content":{"rendered":"<pre lang=\"bash\">\n#!\/bin\/sh\n#\n# Name: ffmpeg git\n# Version: 0.01a\n# Description: ffmpeg git compilation with libvorbis, x264, mp3 lame support\n# Script_URI: http:\/\/www.techno-blog.net\n#\n# Author: Nikos\n\n\n###########################\n##### Run some checks #####\n###########################\n\n# Check if user is root\nif [ $(id -u) != \"0\" ]; then\n        echo \"Erreur : Vous devez \u00eatre root pour utiliser ce script, use sudo sh $0\"\n        exit 1\nfi\n\n#############################################\n##### Set some variables and functions ######\n#############################################\n\n# Directory where this script is located\nBASEDIR=\"$(dirname $0)\"\n\nerror_out() {\n        echo \"Could not ${1}, aborting\"\n        exit 1\n}\n\nwrap() {\n        local ErrorMsg=\"$1\"\n        shift\n        local cmd=\"$1\"\n        shift\n        $cmd \"$@\" || error_out \"$ErrorMsg\"\n}\n\n# Install aptitude\napt-get install aptitude\n\n# Function to install packages\ninstall_pkgs() {\n        aptitude -yq=3 install \"$@\"\n}\n\n# Function to remove packages\nremove_pkgs() {\n        aptitude -yq=3 remove \"$@\"\n}\n\n\n#################################\n##### The magic starts here #####\n#################################\n\n# Uninstall Packages\nwrap \"remove libmp3lame-dev ffmpeg yasm\" remove_pkgs libmp3lame-dev ffmpeg yasm\n\n# Install packages\nwrap \"install some dependancies\" install_pkgs quilt libsdl1.2-dev libogg-dev libvorbis-dev liba52-dev libdts-dev libimlib2-dev texi2html libraw1394-dev libdc1394-22-dev libtheora-dev libgsm1-dev libxvidcore-dev libfaac-dev libfaad-dev build-essential git-core checkinstall texi2html libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev nasm\n\n# Retrieving x264, libvorbis, mp3lame\nmkdir ffmpeg_source\ncd ffmpeg_source\n\nwrap \"diwnload yasm-1.2.0\" wget http:\/\/www.tortall.net\/projects\/yasm\/releases\/yasm-1.2.0.tar.gz\ntar xzvf yasm-1.2.0.tar.gz\ncd yasm-1.2.0\nwrap \"set up yasm\" .\/configure --prefix=\"$HOME\/ffmpeg_build\" --bindir=\"$HOME\/bin\"\nwrap \"compilation\" make\nwrap \"build DEB package\" make install\nmake distclean\nexport \"PATH=$PATH:$HOME\/bin\"\n\ncd ..\nwrap \"retrieving x264 from git sources\" git clone git:\/\/git.videolan.org\/x264\ncd x264\nwrap \"set up x264 config\" .\/configure --enable-static --disable-opencl\nwrap \"compilation with 3 cores\" make -j3\nwrap \"build install-lib-dev\" make install-lib-dev\nwrap \"build DEB package\" checkinstall --pkgname=x264 --default --pkgversion=\"3:$(.\/version.sh | awk -F'[\" ]' '\/POINT\/{print $4\"+git\"$5}')\" --backup=no --deldoc=yes\n\ncd ..\nmkdir -p \/usr\/local\/share\/doc\/lame\nwrap \"download lamemp3 source\" wget http:\/\/downloads.sourceforge.net\/project\/lame\/lame\/3.98.4\/lame-3.98.4.tar.gz\ntar xzvf lame-3.98.4.tar.gz\ncd lame-3.98.4\nwrap \"set up lamemp3\" .\/configure --enable-nasm --disable-shared\nwrap \"compilation\" make\nwrap \"build DEB package\" checkinstall --pkgname=lame-ffmpeg --pkgversion=\"3.98.4\" --backup=no --default --deldoc=yes\n\ncd ..\nwrap \"retrieving libvpx from git sources\" git clone http:\/\/git.chromium.org\/webm\/libvpx.git\ncd libvpx\nwrap \"set up libvpx config\" .\/configure\nwrap \"compilation with 3 cores\" make -j3\nwrap \"build DEB package\" checkinstall --pkgname=libvpx --pkgversion=\"$(date +%Y%m%d%H%M)-git\" --backup=no --default --deldoc=yes\n\ncd ..\nwrap \"retrieving ffmpeg from git sources\" git clone git:\/\/git.videolan.org\/ffmpeg\ncd ffmpeg\nwrap \"set up ffmpeg config\" .\/configure --enable-gpl --enable-postproc --enable-swscale --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-avfilter\nwrap \"compilation with 3 cores\" make -j3\nwrap \"build DEB package\" checkinstall --pkgname=ffmpeg --pkgversion=\"0.6.3-git\" --backup=no --deldoc=yes --default\nhash x264 ffmpeg ffplay ffprobe\n\necho \"#############################\"\necho \"##### Mission complete! #####\"\necho \"#############################\"\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/sh # # Name: ffmpeg git # Version: 0.01a # Description: ffmpeg git compilation with libvorbis, x264, mp3 lame support # Script_URI: http:\/\/www.techno-blog.net # # Author: Nikos ########################### ##### Run some checks ##### ########################### # Check if user is root &hellip; <a href=\"https:\/\/cowmanchiang.me\/wp\/?p=967\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,82],"tags":[],"class_list":["post-967","post","type-post","status-publish","format-standard","hentry","category-ffmpeg","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=967"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/967\/revisions"}],"predecessor-version":[{"id":2050,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/967\/revisions\/2050"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}