• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Jeff Mikels

…biblical Christianity without conservative idolatry…

  • Home
  • All My Sermons
  • My Blog
    • Longer Articles
    • Christian Leadership
    • Spiritual Health
    • Tough Questions
    • Geekery
    • All Posts
  • About Me
    • My Books
    • My Church
    • FAQ
  • Show Search
Hide Search
Home/Geekery/ffmpeg compilation script for Ubuntu

ffmpeg compilation script for Ubuntu

Ubuntu doesn’t provide the latest ffmpeg or include the modules I use all the time, so I wrote a little script to automatically compile and install my own version:


#!/bin/sh

# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

# SERVER COMPILATION SKIPS ffplay AND A X11 DEPENDENCIES

echo 'THIS SCRIPT USES SUDO, SO IT MIGHT ASK FOR YOUR PASSWORD'
sudo apt-get update -qq

sudo apt-get -y install \
	autoconf \
	automake \
	build-essential \
	cmake \
	git \
	libass-dev \
	libfreetype6-dev \
	libtheora-dev \
	libtool \
	libvorbis-dev \
	mercurial \
	pkg-config \
	texinfo \
	wget \
	zlib1g-dev \
	yasm \
	libx264-dev \
	libvpx-dev \
	libfdk-aac-dev \
	libmp3lame-dev \
	libopus-dev



cd ~/src

# DO WE NEED NASM?
# wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2
# tar xjvf nasm-2.13.02.tar.bz2
# pushd nasm-2.13.02
# ./autogen.sh
# PATH="$HOME/bin:$PATH" ./configure --prefix="/usr/local" --bindir="/usr/local/bin"
# make
# sudo make install


# DO WE NEED x265
if cd x265 2> /dev/null; then hg pull && hg update; else hg clone https://bitbucket.org/multicoreware/x265; fi
cd x265/build/linux
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/usr/local/" -DENABLE_SHARED:bool=off ../../source
PATH="$HOME/bin:$PATH" make
sudo make install


# ACTUAL COMPILATION
cd ~/src
wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \
  --prefix="/usr/local" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I/usr/local/include" \
  --extra-ldflags="-L/usr/local/lib" \
  --extra-libs="-lpthread -lm" \
  --bindir="/usr/local/bin" \
  --enable-gpl \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree

make
sudo make install
hash -r


Written by:
Jeff Mikels
Published on:
May 15, 2018
Thoughts:
1 Comment

Categories: Geekery

Previous Post: « Wisdom Prayer 1
Next Post: Thank you Immanuel RPC »

Reader Interactions

Comments

  1. olivier galand

    December 25, 2018 at 11:28 pm

    Thanks a lot,

    it worked perfectly to set up ffmpeg with x265 on an ubuntu server 18.10 vm

    Olivier

    Reply

Leave a Reply to olivier galand Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Articles

Dear Christian Conservative: Vote Your Conscience

Today is Super Tuesday meaning that a large number of states are having their primaries for the Presidential election. Currently, for …

Continue Reading about Dear Christian Conservative: Vote Your Conscience

Let’s Talk about Salvation: Part 2

Salvation and Forgiveness in the Gospel of John In my previous post, I considered a large number of passages in the synoptic gospels (Matthew, …

Continue Reading about Let’s Talk about Salvation: Part 2

Let’s Talk About Salvation and Forgiveness: Part 1

I've been thinking a lot about this idea recently: What would it look like if we were as eager to forgive as Jesus was? This is a tough …

Continue Reading about Let’s Talk About Salvation and Forgiveness: Part 1

Evangelical Idolatry

I've been going through a dilemma. The question on my mind is this: How do I talk about my book with people who don't know me all that …

Continue Reading about Evangelical Idolatry

Explore more

Footer

About Me

Jeff Mikels • 765-404-0807

Copyright © 2025 · Log in

  • Home
  • Blog
  • About Me
  • FAQ
  • Contact