Compile FFmpeg for Ubuntu, Debian, or Mint

Contents

  1. Get the Dependencies
  2. Compilation & Installation
  3. Updating FFmpeg
  4. Reverting Changes made by this Guide
  5. FAQ
  6. If You Need Help
  7. Also See

 

This guide for supported releases of UbuntuDebian, and Linux Mint and will provide a local, non-system installation of FFmpeg with support for several common external encoding libraries.

You may also refer to the Generic Compilation Guide for additional information about compiling software.

Recent static builds are also available for lazy people or those who are unable to compile. The static builds do not support non-free encoders.

Note: FFmpeg is part of the Ubuntu packages and can be installed via apt-get install ffmpeg. You may still wish to compile if you want the latest version, experience a bug, or want to customize your build, and it will not interfere with the ffmpeg package in the repository.

 

This guide is designed to be non-intrusive and will create several directories in your home directory:

  • ffmpeg_sources – Where the source files will be downloaded. This can be deleted if desired when finished with the guide.
  • ffmpeg_build – Where the files will be built and libraries installed. This can be deleted if desired when finished with the guide.
  • bin – Where the resulting binaries (ffmpeg, ffplay, ffprobe, x264, x265) will be installed.

You can easily undo any of this as shown in Reverting Changes Made by This Guide.

 

libx264

H.264 video encoder. See the H.264 Encoding Guide for more information and usage examples.

Requires ffmpeg to be configured with --enable-gpl --enable-libx264.

If your repository provides libx264-dev version ≥ 118 then you can install that instead of compiling:

sudo apt-get install libx264-dev

Otherwise you can compile:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章