Hits

리눅스 생활일지편 입니다.

이번 포스팅에서는 우분투에서 ffmpeg 설치하는 방법에 대해 이야기합니다.


ffmpeg를 설치하기에 앞서 우분투에서 package update와 upgrade를 해줍니다.

$ sudo apt-get update
$ sudo apt-get upgrade


dependency libraries 설치

# dependency libraries 설치
$ sudo apt-get -y install autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev libgnutls28-dev libsdl2-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libx11-dev libxext-dev libxfixes-dev libxcb-xfixes0-dev pkg-config texinfo texi2html wget yasm zlib1g-dev


YASM install

$ mkdir ~/ffmpeg_sources
$ cd ~/ffmpeg_sources
$ wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
$ tar xzvf yasm-1.2.0.tar.gz
$ cd yasm-1.2.0
$ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
$ make
$ make install
$ make distclean


NASM install

$ cd ~/ffmpeg_sources && \
wget https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 && \
tar xjvf nasm-2.14.02.tar.bz2 && \
cd nasm-2.14.02 && \
./autogen.sh && \
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
make && \
make install


libx264 install

$ cd ~/ffmpeg_sources && \
git -C x264 pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/x264.git && \
cd x264 && \
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --enable-pic && \
PATH="$HOME/bin:$PATH" make && \
make install


libx265 install

$ apt-get install libx265-dev libnuma-dev


libvpx install

$ apt-get install libvpx-dev


libfdk-aac install

$ apt-get install libvpx-dev


libmp3lame install

$ apt-get install libvpx-dev


libopus install

$ apt-get install libvpx-dev


libaom install

$ apt-get install libvpx-dev


ffmpeg install

$ apt-get install libunistring-dev
$ cd ~/ffmpeg_sources && \
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="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-libs="-lpthread -lm" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-gnutls \
  --enable-libaom \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree && \
PATH="$HOME/bin:$PATH" make && \
make install && \
hash -r


ffmpeg 설치하느라 수고 많으셨습니다.

궁금하신 점이나 문의하실 점은 댓글로 남겨주세요.

지금까지 긴 글 읽어주셔서 감사합니다. :)