1. Installation of SDL
SDL is an open-source multimedia development library that allows you to set up images and video rendering operations. If you do not install Sdl,ffmpeg, you will not be able to generate Ffplay.exe player. It's also easy to install SDL under Ubuntu, just execute the following commands in turn:
sudo Install libsdl1. 2-devsudoinstall libsdl-image1. 2-devsudoinstall libsdl-mixer1. 2-devsudoinstall LIBSDL-TTF2. 0-devsudoinstall gfx1. 2-dev
2, install Yasm, execute the following command:
sudo Install yasm
3. Install several codec libraries ffmpeg depend on, execute the following command in turn:
sudo install libx264-devsudoinstall libfaac-devsudoinstall libvo-aacenc-Devsudoinstall libmp3lame-devsudo Install Libfaad-dev
4. Install other dependent libraries:
sudo Install build-essential Subversion git-core checkinstall texi2html libtheora-dev Libx11-dev Libxvidcore-dev Zlib1g-dev Libopencore-amrnb Libopencore-amrwb-dev
5. Download FFmpeg:
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
6. Enter the FFmpeg directory and execute the following command to complete the compilation and installation:
./configure--ENABLE-GPL--enable-nonfree--enable-pthreads--enable-libfaac--enable-libvo-aacenc-- Enable-libmp3lame--enable-libtheora--enable-libx264--enable-libxvid--enable-x11grab -- ENABLE-LIBOPENCORE-AMRWB--enable-libopencore-amrnb--enable-version3--disable-optimizations--disable-ASM makesudomakeinstall
Then, as you can see, in/usr/local/bin, Ffmpeg.exe/ffplay.exe/ffprob.exe has been generated. You can use Ffplay.exe to play video files on the command line.
7. Use FFmpeg in QT
Because QT is a C + + environment, FFmpeg is a C environment that needs to include the following code:
extern " C " <libavcodec/avcodec.h><libswscale/swscale.h><libavformat/avformat.h > }
Include the following in the. Pro file:
LIBS + =-l/usr/+=-+ =-+-+ =-+-lswscale
Install ffmpeg under Ubuntu