Hamsa K
Editor
4 min read | 6 months ago

How to Install FFMPEG in Ubuntu 18 04

Install ffmpeg in Ubuntu 18.04

FFmpeg is a free and open-source command-line tool for transcoding multimedia files.It is used for converting media files to different formats, resize video, change sample rates for video and audio files.ffmpeg contains a set of shared libraries such as libswresample, libavcodec, libavformat, and libavutil and programs for handling video, audio, and other multimedia files and streams.

Step 1: Install ffmpeg 3.x

you can install ffmpeg from Ubuntu repositories by using apt 

root@ubuntu18:~# apt update
root@ubuntu18:~# apt install ffmpeg
root@ubuntu18:~# ffmpeg -version

Also Read -> How to Install Apache Kafka on Ubuntu 20 04

Step 2: Install ffmpeg 4.x

If you want to install latest version of ffmpeg 4.x then you need to add PPA repository and update repository pack.

root@ubuntu18:~# add-apt-repository ppa:jonathonf/ffmpeg-4
root@ubuntu18:~# apt update

Now we will install ffmpeg with following command

root@ubuntu18:~# apt install ffmpeg

Also Read -> How to Install and Configure VSFTPD server in Ubuntu 18 04

this will install many packages along with dependencies.once they are installed check ffmpeg version with following command.

root@ubuntu18:~# ffmpeg
ffmpeg version 4.2.2-0york0~18.04 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}..

To check ffmpeg encoders and decoders, you can see with below commands

root@ubuntu18:~# ffmpeg -encoders
root@ubuntu18:~# ffmpeg -decoders

For example, to convert from mp4 format to webm, run the command below.

ffmpeg -i input.mp4 output.webm

To convert an audio file from mp3 to ogg

ffmpeg -i input.mp3 output.ogg

Now you have learned how to install FFmpeg on your ubuntu 18.04 system.

Also Read -> How to Install Jenkins in Ubuntu 20 04 LTS



Warning! This site uses cookies
By continuing to browse the site, you are agreeing to our use of cookies. Read our terms and privacy policy