[Original] install FFMPEG for zero-basic learning video decoding

Source: Internet
Author: User

Before the article: FFmpeg is an open-source codec framework with powerful functions. However, if we use it for development, there is a severe polarization. the great gods are discussing profound issues, and most of the little white connections like me cannot go in. Recently, I accidentally learned how to get started. Now I write this series of articles "no basic learning video decoding" to help you get started. The blogger's development machine is based on Ubuntu 14.04 64-bit, so this series of articles are all completed under Ubuntu.

  1. Install SDL

  The C language does not have a graphics library, and SDL is relatively small and open-source, which is suitable for beginners to learn. In addition, when FFmpeg is installed, the system checks whether to install the SDL library. Otherwise, the installation fails, so install the SDL Library first.

Ubuntu already contains the SDL library, so you can install it using a few simple commands.

Sudo apt-Get install libsdl1.2-Dev (relatively large, about 10 MB) or install it in Ubuntu Software Center

Additional package:

Sudo apt-Get install libsdl-image1.2-dev

Sudo apt-Get install libsdl-mixer1.2-dev

Sudo apt-Get install libsdl-ttf2.0-dev

Sudo apt-Get install libsdl-gfx1.2-dev

After the installation is complete, an SDL folder in the directory/usr/include contains the required header file.

Run SDL-config -- version to check whether the installation is successful. if the version information is displayed, the installation is successful.

  Ii. Install FFMPEG

Method 1: Search for FFMPEG installation in Ubuntu Software Center.

Method 2: Run sudo apt-Get install FFMPEG on the command line.

Method 3: Download the source code, compile and install it by yourself:

1. Git clone https://github.com/FFmpeg/FFmpeg.git

2. Requirement configuration :. /configure -- prefix =/usr/local/FFMPEG -- enable-shared -- enable-nonfree -- enable-GPL -- enable-pthreads -- disable-yasm -- extra-cflags =-I/usr /local/FFMPEG/include/-- extra-ldflags =-L/usr/local/FFMPEG/lib

-- Prefix = Prefix: Set the FFMPEG installation directory.

-- Enable-shared settings allow compilation of shared libraries

-- Enable-nonfree -- enable-GPL sets the license restrictions for the use of paid code and GPL code.

-- Disable-yasm: Disable Assembler

-- Extra-ldflags

3. Compile and install:

Sudo make

Sudo make install

After the installation is complete, if we directly run the FFMPEG program, an error will be reported:

FFmpeg: Error while loading shared libraries: libavdevice. so.55: cannot open shared object file: no such file or directory

This is because some dynamic link libraries are not registered to the system. Step 2 register the dynamic link library.

4. register the Dynamic Link Library:

We have set the directory of the dynamic link library and need to register it in the system.

Echo "/usr/local/FFMPEG/lib">/etc/lD. So. conf. d/FFMPEG. conf



Run FFMPEG on the command line.

The following information is displayed. Congratulations, you have compiled and installed FFMPEG successfully:

FFmpeg version N-64965-g937eaba copyright (c) 2000-2014 the FFMPEG developers
Built on Jul 29 2014 01:28:01 with GCC 4.8 (Ubuntu 4.8.2-19ubuntu1)
Configuration: -- prefix =/usr -- disable-yasm -- enable-shared
Warning: Library configuration Mismatch
Swscale configuration: -- arch = amd64 -- enable-pthreads -- enable-runtime-cpudetect -- extra-version = '6: 9.14-0ubuntu0. 14.04.1 '-- libdir =/usr/lib/x86_64-linux-gnu -- prefix =/usr -- enable-bzlib -- enable-libdc1394 -- enable-libfreetype -- enable-frei0r -- enable-gnutls -- enable-libgsm -- enable-libmp3lame -- enable -librtmp -- enable-libopenjpeg -- enable-libopus -- enable-libpulse -- enable-Disable -- enable-libspeex -- enable-libtheora -- enable-vaapi -- enable-Disable -- enable-libvorbis -- enable -libvpx -- enable-zlib -- enable-GPL -- enable-swscale -- enable-libcdio -- enable-x11grab -- enable-libx264 -- enable-libxvid -- shlibdir =/usr/lib/x86_64-linux-gnu -- enable-shared -- disable-static
Libavutil 52. 92.101/52. 92.101
Libavcodec 55. 69.100/55. 69.100
Libavformat 55. 49.100/55. 49.100
Libavdevice 55. 13.102/55. 13.102
Libavfilter 11.102/11.102
Libswscale 2. 6.100/2. 1. 1
Libswresample 0. 19.100/0. 19.100
Hyper fast Audio and Video Encoder
Usage: FFMPEG [Options] [[infile options]-I infile]... {[OUTFILE options] OUTFILE }...

Use-h to get full help or, even better, run 'man FFMPEG'




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.