FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. It’s also useful to convert multimedia files between various formats. FFmpeg includes libavcodec audio/video codec library in it. 在這裡插入圖片描述

install ffmpeg

This article will describe you to how to install FFmpeg on Ubuntu, Debian and LinuxMint systems with easy steps.

  1. Step 1 – Adding FFmpeg PPA

FFmpeg is also available under default repositories but an older version. To install the updated version, first of all, You need to add PPA to your system.

Ubuntu 18.04/16.04:

sudo add-apt-repository ppa:jonathonf/ffmpeg-3

Ubuntu 14.04:

sudo add-apt-repository ppa:jonathonf/tesseract
  1. Step 2 – Install FFmpeg

After enabling the PPA, Lets exec below commands to install ffmpeg on your Ubuntu system.

sudo apt-get update
sudo apt-get install ffmpeg libav-tools x264 x265
  1. Step 3 – Check FFmpeg Version

After successfully install FFmpeg, let’s check the version installed on the system.

ffmpeg -version
ffmpeg -version
ffmpeg version 3.4.4-1~16.04.york0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --prefix=/usr --extra-version='1~16.04.york0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x
86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-sharedlibavutil      55. 78.100 / 55. 78.100
libavcodec     57.107.100 / 57.107.100
libavformat    57. 83.100 / 57. 83.100
libavdevice    57. 10.100 / 57. 10.100
libavfilter     6.107.100 /  6.107.100
libavresample   3.  7.  0 /  3.  7.  0
libswscale      4.  8.100 /  4.  8.100
libswresample   2.  9.100 /  2.  9.100
libpostproc    54.  7.100 / 54.  7.100
  1. Step 4 – FFmpeg Basic Commands

Here is the list of few ffmepg basic command options used with ffmpeg command line tool.

ffmpeg -version:            show version
ffmpeg -formats:            show available formats
ffmpeg -codecs:             show available codecs
ffmpeg -decoders:           show available decoders
ffmpeg -encoders:           show available encoders
ffmpeg -bsfs:               show available bit stream filters
ffmpeg -protocols:          show available protocols
ffmpeg -filters:            show available filters
ffmpeg -pix_fmts:           show available pixel formats
ffmpeg -layouts:            show standard channel layouts
ffmpeg -sample_fmts:        show available audio sample formats

Click here to read more about ffmpeg on its official site.

  1. Step 5 – Basic Examples

Below are some examples of uses of ffmpeg command line.

Reduce .mov File Size:

ffmpeg -i in.mov -c:v libx264 -c:a copy -crf 20 out.mov

Convert .move To .mp4

ffmpeg -i in.mov -vcodec copy -acodec aac -strict experimental -ab 128k out.mp4

參考